Myriota UltraLite SDK 2.4.0
Loading...
Searching...
No Matches

Serial Peripheral Interface (SPI) master for high-speed data transfer. More...

Enumerations

enum  SPIBaudrate { SPI_BAUDRATE_DEFAULT = 1000000 , SPI_BAUDRATE_MAX = 24000000 }
 SPI baudrate. More...
 

Functions

MYRIOTA_HARDWARE_API int SPIInit (uint32_t BaudRate)
 Initialise SPI master.
 
MYRIOTA_HARDWARE_API void SPIDeinit (void)
 Deinitialise SPI master.
 
MYRIOTA_HARDWARE_API int SPIWrite (const uint8_t *Tx, size_t Length)
 Write to an SPI device synchronously.
 
MYRIOTA_HARDWARE_API int SPITransfer (const uint8_t *Tx, uint8_t *Rx, size_t Length)
 SPI data transfer.
 

Detailed Description

Serial Peripheral Interface (SPI) master for high-speed data transfer.

Enumeration Type Documentation

◆ SPIBaudrate

SPI baudrate.

Enumerator
SPI_BAUDRATE_DEFAULT 

1 MHz.

SPI_BAUDRATE_MAX 

24 MHz.

Function Documentation

◆ SPIInit()

MYRIOTA_HARDWARE_API int SPIInit ( uint32_t  BaudRate)

Initialise SPI master.

Parameters
BaudRateThe SPI baudrate.
Returns
0 if initialisation succeeds, -1 if initialisation fails.

◆ SPIDeinit()

MYRIOTA_HARDWARE_API void SPIDeinit ( void  )

Deinitialise SPI master.

Disables SPI communications and releases associated hardware resources.

◆ SPIWrite()

MYRIOTA_HARDWARE_API int SPIWrite ( const uint8_t *  Tx,
size_t  Length 
)

Write to an SPI device synchronously.

Parameters
Tx[in]Pointer to the data to be transmitted.
LengthLength of the data to be transmitted.
Returns
0 if write succeeds, -1 if write fails.

◆ SPITransfer()

MYRIOTA_HARDWARE_API int SPITransfer ( const uint8_t *  Tx,
uint8_t *  Rx,
size_t  Length 
)

SPI data transfer.

Parameters
Tx[in]Pointer to the data to be transmitted.
Rx[out]Pointer to the buffer to store the received data.
LengthLength of the data to be transferred.
Returns
0 if transfer succeeds, -1 if transfer fails.