2.0.0.4R9
Software Development Kit
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
Serial Peripheral Interface (SPI)

Data Structures

struct  ltrx_spi_descriptor
 Describes input and output buffers for data transfer. More...
 
struct  ltrx_spi_protocol
 Represents a SPI protocol for registration. More...
 

Functions

void ltrx_spi_close (uint16_t zeroBasedSPI)
 Relinquish a Serial Peripheral Interface previously opened. More...
 
bool ltrx_spi_open (uint16_t zeroBasedSPI, uint32_t blockTimeMsec)
 Open a Serial Peripheral Interface for exclusive use. More...
 
void ltrx_spi_register_protocol (const struct ltrx_spi_protocol *lsp)
 Register a SPI protocol. More...
 
bool ltrx_spi_transfer (uint16_t zeroBasedSPI, const struct ltrx_spi_descriptor *descriptor)
 Transfer data. More...
 

Detailed Description

The Serial Peripheral Interface (SPI) refers to a clocked serial interface. These definitions relate to operation of the interface.

Function Documentation

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]zeroBasedSPI0 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
trueSuccess.
falseFailed.
Parameters
[in]zeroBasedSPI0 for SPI 1, 1 for SPI 2, and so on.
[in]blockTimeMsecHow long to wait if line is in use. To wait indefinitely, use TIME_WAIT_FOREVER.
void ltrx_spi_register_protocol ( const struct ltrx_spi_protocol lsp)

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]lspDesignates 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
trueSuccess.
falseFailure.
Parameters
[in]zeroBasedSPI0 for SPI 1, 1 for SPI 2, and so on.
[in]descriptorProvides input and output buffer information.