The Serial Peripheral Interface (SPI) refers to a clocked serial interface. These definitions relate to operation of the interface.
void ltrx_spi_close |
( |
uint16_t |
zeroBasedSPI | ) |
|
Relinquish a Serial Peripheral Interface previously opened.
Previously you would have called ltrx_spi_open() and saw it return true
. This will allow other threads to open the SPI.
- Parameters
-
[in] | zeroBasedSPI | 0 for SPI 1, 1 for SPI 2, and so on. |
bool ltrx_spi_open |
( |
uint16_t |
zeroBasedSPI, |
|
|
uint32_t |
blockTimeMsec |
|
) |
| |
Open a Serial Peripheral Interface for exclusive use.
Warning: Check the return value even if you specify TIME_WAIT_FOREVER because your thread can return early if another thread calls ltrx_thread_wake().
- Return values
-
true | Success. |
false | Failed. |
- Parameters
-
[in] | zeroBasedSPI | 0 for SPI 1, 1 for SPI 2, and so on. |
[in] | blockTimeMsec | How long to wait if line is in use. To wait indefinitely, use TIME_WAIT_FOREVER. |
Register a SPI protocol.
Registers procedures into the system for supporting another protocol on Serial Peripheral Interfaces.
Registration must be done in early module initialization.
- Parameters
-
[in] | lsp | Designates the procedures to start and stop this protocol. |
bool ltrx_spi_transfer |
( |
uint16_t |
zeroBasedSPI, |
|
|
const struct ltrx_spi_descriptor * |
descriptor |
|
) |
| |
Transfer data.
- Return values
-
true | Success. |
false | Failure. |
- Parameters
-
[in] | zeroBasedSPI | 0 for SPI 1, 1 for SPI 2, and so on. |
[in] | descriptor | Provides input and output buffer information. |