MSP430F5529 SPI API¶
-
group
MSP430F5529_HAL_SPI
Functions
-
static hal_spi_bus
spi_bus
(KSPINum spi)¶ Helper function to convert SPI bus option.
- Return
- hal_spi_bus HAL specific SPI bus number
- Parameters
spi
: SPI bus number
-
static hal_spi_role
spi_role
(SPIRole spi)¶ Helper function to convert SPI roles.
- Return
- hal_spi_role HAL specific SPI role option
- Parameters
spi
: SPI bus role
-
static hal_spi_handle *
spi_handle
(KSPINum spi)¶ Helper function to get SPI handle.
- Return
- hal_spi_handle* pointer to SPI hardware handle
- Parameters
spi
: SPI bus number
-
static hal_spi_direction
spi_direction
(SPIDirection spi)¶ Helper function to convert SPI direction.
- Return
- hal_spi_direction HAL specific SPI bus direction option
- Parameters
spi
: SPI bus direction option
-
static hal_spi_data_size
spi_data_size
(SPIDataSize spi)¶ Helper function to convert SPI data size.
- Return
- hal_spi_data_size HAL specific data size (width) option
- Parameters
spi
: SPI bus data size (width) option
-
static hal_spi_clock_phase
spi_clock_phase
(SPIClockPhase phase)¶ Helper function to convert SPI clock phase.
- Return
- hal_spi_clock_phase HAL specific SPI bus clock phase option
- Parameters
phase
: SPI bus clock phase option
-
static hal_spi_clock_polarity
spi_clock_polarity
(SPIClockPolarity polarity)¶ Helper function to convert SPI clock polarity option.
- Return
- hal_spi_clock_polarity HAL specific clock polarity option
- Parameters
polarity
: SPI clock polarity option
-
static hal_spi_first_bit
spi_first_bit
(SPIFirstBit firstbit)¶ Helper function to convert SPI first bit option.
- Return
- hal_spi_first_bit HAL specific SPI first bit option
- Parameters
firstbit
: SPI bus first bit option
-
KSPIStatus
kprv_spi_dev_init
(KSPINum spi)¶ Setup and enable SPI bus.
- Return
- KSPIStatus SPI_OK if success, otherwise a specific error flag
- Parameters
spi
: SPI bus to initialize
-
KSPIStatus
kprv_spi_dev_terminate
(KSPINum spi)¶ SPI hardware cleanup and disabling.
- Return
- KSPIStatus SPI_OK if success, otherwise a specific error flag
- Parameters
spi
: bus num to terminate
-
KSPIStatus
kprv_spi_write
(KSPINum spi, uint8_t *buffer, uint32_t len)¶ Write data over SPI bus.
- Return
- KSPIStatus SPI_OK on success, otherwise failure
- Parameters
spi
: SPI bus to write tobuffer
: pointer to data bufferlen
: length of data to write
-
KSPIStatus
kprv_spi_read
(KSPINum spi, uint8_t *buffer, uint32_t len)¶ Read data over SPI bus.
- Return
- KSPIStatus SPI_OK on success, otherwise failure
- Parameters
spi
: SPI bus to read frombuffer
: pointer to data bufferlen
: length of data to read
-
KSPIStatus
kprv_spi_write_read
(KSPINum spi, uint8_t *txBuffer, uint8_t *rxBuffer, uint32_t len)¶ Write and read data over SPI bus.
- Return
- KSPIStatus SPI_OK on success, otherwise failure
- Parameters
spi
: SPI bus to write totxBuffer
: pointer to data buffer to write fromrxBuffer
: pointer to data buffer to read intolen
: length of data to write and read
-
static hal_spi_bus