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) |
| Performs SPI register transactions. | |
| SPP_RetVal_t(*) | spiDeviceSetSpeed (void *p_handle, spp_uint32_t speedHz) |
| Remove and re-add a SPI device with a new clock speed. | |
| SPP_RetVal_t(*) | spiTransmitRaw (void *p_handle, spp_uint8_t *p_data, spp_uint8_t length) |
| Performs a raw full-duplex SPI transaction. | |
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) |
Performs SPI register transactions.
The ESP32 port uses the MSB of the command byte to distinguish reads from writes and processes the buffer accordingly.
| p_handle | SPI device handle. |
| p_data | Transmission buffer, also used for received data on reads. |
| length | Buffer length in bytes. |
Definition at line 64 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 77 of file hal.h.
Referenced by SPP_HAL_SPI_deviceSetSpeed().
| SPP_RetVal_t(*) SPP_HALSpi_t::spiTransmitRaw(void *p_handle, spp_uint8_t *p_data, spp_uint8_t length) |
Performs a raw full-duplex SPI transaction.
| p_handle | SPI device handle. |
| p_data | Transmission and reception buffer. |
| length | Number of bytes to transfer. |
Definition at line 86 of file hal.h.
Referenced by SPP_HAL_SPI_transmitRaw().