This is the latest (main) BeagleBoard documentation. If you are looking for stable releases, use the drop-down menu on the bottom-left and select the desired version.

Function rc_spi_init_manual_slave

Function Documentation

int rc_spi_init_manual_slave(int bus, int slave, int bus_mode, int speed_hz, int chip, int pin)

Initializes an SPI bus and GPIO pin for use as a manual SPI slave select pin.

The provided gpio chip/pin will then be remembered and tied to the provided slave number and bus. Note that on the BeagleBone and probably other platforms, there are only two files provided by the driver for interfacing to the bus, /dev/spi1.0 and /dev/spi1.1. When using a slave in manual mode, the first interface (slave 0 in software) will be used to talk to the manual slaves. Therefore this slave can not be used as an automatic slave.

For the BeagleBone Blue and RoboticsCape, this will also ensure that the pinmux is set correctly for that pin. The available manual slave select pins for these two boards are defined in this header for convenience. If using other boards it’s up to the user to make sure the pin they are using is set up correctly in the device tree.

  • bus[in] The spi bus

  • slave[in] The slave identifier (up to 16)

  • bus_mode[in] The bus mode

  • speed_hz[in] The speed hz

  • chip[in] The gpio chip

  • pin[in] The gpio pin


0 on succcess or -1 on failure