![]() |
RTEMS 6.3
|
SPI HAL module driver. More...
Topics | |
| Linux SPI User-Space API | |
| RTEMS port of Linux SPI user-space API. | |
| RTEMSDeviceSPIGPIO | |
| A simple SPI bus driver that just uses GPIO pins. | |
| SPI Exported Constants | |
| SPI Exported Macros | |
| SPI Exported Types | |
| SPI Private Macros | |
| SPI_Exported_Functions | |
Files | |
| file | cpukit/include/dev/spi/spi.h |
| Serial Peripheral Interface (SPI) Driver API. | |
Data Structures | |
| struct | spi_bus |
| SPI bus control. More... | |
Macros | |
| #define | SPI_BUS_OBTAIN _IO(SPI_IOC_MAGIC, 13) |
| Obtains the bus. | |
| #define | SPI_BUS_RELEASE _IO(SPI_IOC_MAGIC, 23) |
| Releases the bus. | |
Functions | |
| int | spi_bus_init (spi_bus *bus) |
| Initializes a bus control. | |
| spi_bus * | spi_bus_alloc_and_init (size_t size) |
| Allocates a bus control from the heap and initializes it. | |
| void | spi_bus_destroy (spi_bus *bus) |
| Destroys a bus control. | |
| void | spi_bus_destroy_and_free (spi_bus *bus) |
| Destroys a bus control and frees its memory. | |
| int | spi_bus_register (spi_bus *bus, const char *bus_path) |
| Registers a bus control. | |
SPI HAL module driver.
Serial Peripheral Interface (SPI) bus driver support.
| #define SPI_BUS_OBTAIN _IO(SPI_IOC_MAGIC, 13) |
Obtains the bus.
This command has no argument.
| #define SPI_BUS_RELEASE _IO(SPI_IOC_MAGIC, 23) |
Releases the bus.
This command has no argument.
| spi_bus * spi_bus_alloc_and_init | ( | size_t | size | ) |
Allocates a bus control from the heap and initializes it.
After a sucessful allocation and initialization the bus control must be destroyed via spi_bus_destroy_and_free(). A registered bus control will be automatically destroyed in case the device file is unlinked. Make sure to call spi_bus_destroy_and_free() in a custom destruction handler.
| [in] | size | The size of the bus control. This enables the addition of bus controller specific data to the base bus control. The bus control is zero initialized. |
| non-NULL | The new bus control. |
| NULL | An error occurred. The errno is set to indicate the error. |
| void spi_bus_destroy | ( | spi_bus * | bus | ) |
Destroys a bus control.
| [in] | bus | The bus control. |
| void spi_bus_destroy_and_free | ( | spi_bus * | bus | ) |
Destroys a bus control and frees its memory.
| [in] | bus | The bus control. |
| int spi_bus_init | ( | spi_bus * | bus | ) |
Initializes a bus control.
After a sucessful initialization the bus control must be destroyed via spi_bus_destroy(). A registered bus control will be automatically destroyed in case the device file is unlinked. Make sure to call spi_bus_destroy() in a custom destruction handler.
| [in] | bus | The bus control. |
| 0 | Successful operation. |
| -1 | An error occurred. The errno is set to indicate the error. |
| int spi_bus_register | ( | spi_bus * | bus, |
| const char * | bus_path ) |
Registers a bus control.
This function claims ownership of the bus control regardless if the registration is successful or not.
| [in] | bus | The bus control. |
| [in] | bus_path | The path to the bus device file. |
| 0 | Successful operation. |
| -1 | An error occurred. The errno is set to indicate the error. |