Files | |
file | spi.c |
Kubos-HAL-MSP430F5529 - SPI module. | |
Functions | |
KSPIStatus | kprv_spi_dev_init (KSPINum spi) |
Setup and enable SPI bus. More... | |
KSPIStatus | kprv_spi_dev_terminate (KSPINum spi) |
SPI hardware cleanup and disabling. More... | |
KSPIStatus | kprv_spi_write (KSPINum spi, uint8_t *buffer, uint32_t len) |
Write data over SPI bus. More... | |
KSPIStatus | kprv_spi_read (KSPINum spi, uint8_t *buffer, uint32_t len) |
Read data over SPI bus. More... | |
KSPIStatus | kprv_spi_write_read (KSPINum spi, uint8_t *txBuffer, uint8_t *rxBuffer, uint32_t len) |
Write and read data over SPI bus. More... | |
Function Documentation
KSPIStatus kprv_spi_dev_init | ( | KSPINum | spi | ) |
Setup and enable SPI bus.
- Parameters
-
spi SPI bus to initialize
- Returns
- KSPIStatus SPI_OK if success, otherwise a specific error flag
KSPIStatus kprv_spi_dev_terminate | ( | KSPINum | spi | ) |
SPI hardware cleanup and disabling.
- Parameters
-
spi bus num to terminate
- Returns
- KSPIStatus SPI_OK if success, otherwise a specific error flag
KSPIStatus kprv_spi_read | ( | KSPINum | spi, |
uint8_t * | buffer, | ||
uint32_t | len | ||
) |
Read data over SPI bus.
- Parameters
-
spi SPI bus to read from buffer pointer to data buffer len length of data to read
- Returns
- KSPIStatus SPI_OK on success, otherwise failure
KSPIStatus kprv_spi_write | ( | KSPINum | spi, |
uint8_t * | buffer, | ||
uint32_t | len | ||
) |
Write data over SPI bus.
- Parameters
-
spi SPI bus to write to buffer pointer to data buffer len length of data to write
- Returns
- KSPIStatus SPI_OK on success, otherwise failure
KSPIStatus kprv_spi_write_read | ( | KSPINum | spi, |
uint8_t * | txBuffer, | ||
uint8_t * | rxBuffer, | ||
uint32_t | len | ||
) |
Write and read data over SPI bus.
- Parameters
-
spi SPI bus to write to txBuffer pointer to data buffer to write from rxBuffer pointer to data buffer to read into len length of data to write and read
- Returns
- KSPIStatus SPI_OK on success, otherwise failure