RTEMS 6.1-rc6
|
A simple SPI bus driver that just uses GPIO pins. More...
Modules | |
RTEMSDeviceIMXSPIGPIO | |
A SPI bus driver that uses the i.MX/i.MXRT GPIO pins. | |
Files | |
file | spi-gpio.h |
This header file provides the interfaces of RTEMSDeviceSPIGPIO. | |
file | spi-gpio.c |
This file provides the implementation of RTEMSDeviceSPIGPIO. | |
Data Structures | |
struct | spi_gpio_params |
Parameters for the driver. More... | |
Macros | |
#define | SPI_GPIO_MAX_CS 4 |
Typedefs | |
typedef void() | spi_gpio_set_pin_fn(void *arg, bool level) |
Type of the functions that set pins. | |
typedef bool() | spi_gpio_get_pin_fn(void *arg) |
Type of the functions that read pins. | |
Functions | |
rtems_status_code | spi_gpio_init (const char *device, const struct spi_gpio_params *params) |
A simple SPI bus driver that just uses GPIO pins.
Implements a SPI that is emulated by toggling GPIO pins. Callbacks are used to set or get the pins so that it can be easily adapted to various GPIO controllers.
NOTE: This driver is slow! If you need performance: Don't use it. The intended use case is (for example) a one time configuration of some SPI peripheral.
The driver will just work as fast as it can. Setting a speed limit is currently not supported.
typedef bool() spi_gpio_get_pin_fn(void *arg) |
Type of the functions that read pins.
Get current level of GPIO pin. Should return either 0 for low or anything else for high. arg is an application specific parameter.
typedef void() spi_gpio_set_pin_fn(void *arg, bool level) |
Type of the functions that set pins.
Set a GPIO pin to level. level is false for low or true for high. arg is an application specific parameter.
rtems_status_code spi_gpio_init | ( | const char * | device, |
const struct spi_gpio_params * | params | ||
) |
Register a new SPI GPIO instance at the device path device.
To save memory, params will be used directly. Make sure that the structure remains valid during the complete application run time.