SPI bus struct that contains all the pointers to the SPI functions. More...
#include <hal.h>
Data Fields | |
| SPP_RetVal_t(*) | spiBusInit (void) |
| Initialise the SPI bus. | |
| void *(*) | spiGetHandle (spp_uint8_t deviceIdx) |
| Obtain the handle for the next SPI device slot. | |
| SPP_RetVal_t(*) | spiDeviceInit (void *p_handle) |
| Initialise a specific SPI device. | |
| SPP_RetVal_t(*) | spiTransmit (void *p_handle, spp_uint8_t *p_data, spp_uint8_t length) |
| Perform a full-duplex SPI transaction. | |
| SPP_RetVal_t(*) | spiDeviceSetSpeed (void *p_handle, spp_uint32_t speedHz) |
| Remove and re-add a SPI device with a new clock speed. | |
SPI bus struct that contains all the pointers to the SPI functions.
| SPP_RetVal_t(*) SPP_HALSpi_t::spiBusInit(void) |
Initialise the SPI bus.
May be called multiple times; subsequent calls must be no-ops.
Definition at line 30 of file hal.h.
Referenced by SPP_HAL_SPI_busInit().
| void *(*) SPP_HALSpi_t::spiGetHandle(spp_uint8_t deviceIdx) |
Obtain the handle for the next SPI device slot.
Devices are numbered sequentially starting from 0. The port determines which physical device each index maps to.
| [in] | deviceIdx | Zero-based device index. |
Definition at line 42 of file hal.h.
Referenced by SPP_HAL_SPI_getHandle().
| SPP_RetVal_t(*) SPP_HALSpi_t::spiDeviceInit(void *p_handle) |
Initialise a specific SPI device.
| [in] | p_handle | Handle returned by spiGetHandle. |
Definition at line 51 of file hal.h.
Referenced by SPP_HAL_SPI_deviceInit().
| SPP_RetVal_t(*) SPP_HALSpi_t::spiTransmit(void *p_handle, spp_uint8_t *p_data, spp_uint8_t length) |
Perform a full-duplex SPI transaction.
The buffer p_data is used for both TX and RX. The port inspects the MSB of the first byte to determine read (1) vs write (0).
| [in,out] | p_handle | SPI device handle. |
| [in,out] | p_data | TX data in, RX data out. |
| [in] | length | Number of bytes in the transaction. |
Definition at line 65 of file hal.h.
Referenced by SPP_HAL_SPI_transmit().
| SPP_RetVal_t(*) SPP_HALSpi_t::spiDeviceSetSpeed(void *p_handle, spp_uint32_t speedHz) |
Remove and re-add a SPI device with a new clock speed.
Intended for devices that require a lower speed during initialisation and a higher speed for normal operation (e.g. SD cards).
| [in] | p_handle | Handle returned by spiGetHandle. |
| [in] | speedHz | New clock frequency in Hz. |
Definition at line 78 of file hal.h.
Referenced by SPP_HAL_SPI_deviceSetSpeed().