Index of /rpi-mcu/expansion/LPC1114/src/spi-agent-lib

      Name                        Last modified       Size  

[DIR] Parent Directory 22-Jan-2019 19:55 - [   ] Makefile 04-Feb-2019 09:08 7k [TXT] README.txt 07-Sep-2017 07:41 3k [TXT] adc.c 25-Jan-2018 09:42 2k [DIR] clients/ 15-Mar-2016 10:03 - [TXT] config.c 16-May-2018 09:34 4k [   ] control 10-Dec-2016 15:04 1k [   ] errmsg.inc 11-Jan-2018 10:21 1k [TXT] gpio.c 11-Jan-2018 10:21 3k [TXT] interrupt.c 09-Feb-2019 19:52 4k [TXT] legorc.c 25-Jan-2018 09:42 2k [TXT] pwm.c 18-May-2019 19:57 4k [TXT] resolve.c 11-Jan-2018 10:21 2k [TXT] resolve.h 11-Jan-2018 10:21 1k [TXT] sfr.c 11-Jan-2018 10:21 2k [TXT] spi_agent_services.c 07-Jan-2019 11:28 5k [TXT] spi_agent_services_http.c 25-Jan-2018 09:42 6k [TXT] spi_agent_services_i2c.c 16-May-2018 09:34 3k [TXT] spi_agent_services_ioctl.c 16-May-2018 09:34 4k [TXT] spi_agent_services_oncrpc.c 25-Jan-2018 09:42 3k [TXT] spi_agent_services_spi.c 16-May-2018 09:34 3k [TXT] spi_agent_services_xmlrpc.c 25-Jan-2018 09:42 5k [TXT] timer.c 18-May-2019 19:57 7k

Raspberry Pi LPC1114 I/O Processor Expansion Board SPI Agent Shared Library

The shared library libspiagent.so encapsulates abstract services for communicating with the Raspberry Pi LPC1114 I/O Processor Expansion Board SPI Agent firmware, using various local and network transport services.

The following declarations, extracted from spi-agent.h, specify the abstract services that are available:

// SPI Agent Firmware services

extern void spiagent_open(const char *servername, int32_t *error);

extern void spiagent_command(SPIAGENT_COMMAND_MSG_t *cmd, SPIAGENT_RESPONSE_MSG_t *resp, int32_t *error);

extern void spiagent_close(int32_t *error);

The service transport scheme and server hostname or IP address are encoded in the servername parameter supplied to spiagent_open(), using a form of URL notation. The following service transport schemes are defined:

ioctl://localhost Linux ioctl() SPI device API (Raspberry Pi Linux, local machine only)
http://<servername> HTTP via libcurl
oncrpc://<servername> ONC/RPC Remote Procedure Call (over UDP)
xmlrpc://<servername> XML-RPC Remote Procedure Call (over HTTP)

Operating System Notes

Unix Derivatives (Linux, MacOS X, OpenBSD, etc.)

Ada, C, Free Pascal, Java, and Python3 all fully support libspiagent.so. Each of these programming languages has its own thin binding module.

All of the service transports described above are included in the prebuilt library for the Raspberry Pi, and the ioctl() transport is default for best performance.

For a Unix derivative network client, libspiagent.so can be built to include HTTP, ONC/RPC, and XML-RPC service transports. The default service transport is ONC/RPC over UDP for best performance.

Microsoft Windows

Microsoft Windows is problematic. It is possible to build libspiagent.dll using Cygwin. That DLL can then be used for C and Python3 clients using Cygwin tools, but not with GNAT Ada, nor Free Pascal, nor ActivePython for Windows nor the official Python for Windows. The DLL also malfunctions with the Cygwin GNAT Ada compiler toolchain, causing hangs at program exit.

The Cygwin libspiagent.dll can be built to include HTTP, ONC/RPC, and XML-RPC transports. The default service transport is ONC/RPC over UDP for best performance.


Questions or comments to Philip Munts phil@munts.net

I am available for custom system development (hardware and software) of products using the Raspberry Pi or other ARM microcomputers.