ESP32-S3 SPI port implementation. More...
Go to the source code of this file.
Functions | |
| SPP_RetVal_t | SPP_PORTS_HAL_ESP32_spiBusInit (void) |
| void * | SPP_PORTS_HAL_ESP32_spiGetHandle (spp_uint8_t deviceIdx) |
| Returns the storage location of an SPI device handle. | |
| SPP_RetVal_t | SPP_PORTS_HAL_ESP32_spiDeviceInit (void *p_handle) |
| SPP_RetVal_t | SPP_PORTS_HAL_ESP32_spiTransmit (void *p_handle, spp_uint8_t *p_data, spp_uint8_t length) |
| Performs register-based SPI transactions. | |
| SPP_RetVal_t | SPP_PORTS_HAL_ESP32_spiDeviceSetSpeed (void *p_handle, spp_uint32_t speedHz) |
| Reconfigures an SPI device with a new clock frequency. | |
| SPP_RetVal_t | SPP_PORTS_HAL_ESP32_spiTransmitRaw (void *p_handle, spp_uint8_t *p_data, spp_uint8_t length) |
| Performs a raw full-duplex SPI transaction. | |
| spp_bool_t | SPP_PORTS_HAL_ESP32_spiIsBusInitialized (void) |
| Check whether the SPI bus has been initialised. | |
ESP32-S3 SPI port implementation.
Definition in file spiPort.h.
| SPP_RetVal_t SPP_PORTS_HAL_ESP32_spiBusInit | ( | void | ) |
Definition at line 32 of file spiPort.c.
References K_ESP32_PIN_CLK, K_ESP32_PIN_MISO, K_ESP32_PIN_MOSI, K_ESP32_SPI_HOST, K_SPP_ERROR, K_SPP_OK, k_tag, s_busInitialized, and SPP_PORTS_HAL_ESP32_spiBusInit().
Referenced by SPP_PORTS_HAL_ESP32_spiBusInit().
| void * SPP_PORTS_HAL_ESP32_spiGetHandle | ( | spp_uint8_t | deviceIdx | ) |
Returns the storage location of an SPI device handle.
| deviceIdx | Index of the SPI device. |
Definition at line 70 of file spiPort.c.
References K_ESP32_MAX_SPI_DEVICES, s_spiHandles, and SPP_PORTS_HAL_ESP32_spiGetHandle().
Referenced by SPP_PORTS_HAL_ESP32_spiGetHandle().
| SPP_RetVal_t SPP_PORTS_HAL_ESP32_spiDeviceInit | ( | void * | p_handle | ) |
Definition at line 79 of file spiPort.c.
References K_ESP32_MAX_SPI_DEVICES, K_ESP32_PIN_CS_BMP, K_ESP32_PIN_CS_ICM, K_ESP32_PIN_CS_SX1262, K_ESP32_SPI_HOST, K_ESP32_SPI_IDX_BMP, K_ESP32_SPI_IDX_ICM, K_ESP32_SPI_IDX_SX1262, K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, k_tag, s_spiHandles, and SPP_PORTS_HAL_ESP32_spiDeviceInit().
Referenced by SPP_PORTS_HAL_ESP32_spiDeviceInit().
| SPP_RetVal_t SPP_PORTS_HAL_ESP32_spiTransmit | ( | void * | p_handle, |
| spp_uint8_t * | p_data, | ||
| spp_uint8_t | length ) |
Performs register-based SPI transactions.
Uses bit 7 of each command byte to distinguish reads (3 bytes) from writes (2 bytes). Read responses overwrite the input buffer.
| p_handle | Pointer to the SPI device handle. |
| p_data | Transaction buffer. |
| length | Total buffer length in bytes. |
Definition at line 144 of file spiPort.c.
References K_SPP_ERROR_NULL_POINTER, K_SPP_ERROR_ON_SPI_TRANSACTION, K_SPP_OK, and SPP_PORTS_HAL_ESP32_spiTransmit().
Referenced by SPP_PORTS_HAL_ESP32_spiTransmit().
| SPP_RetVal_t SPP_PORTS_HAL_ESP32_spiDeviceSetSpeed | ( | void * | p_handle, |
| spp_uint32_t | speedHz ) |
Reconfigures an SPI device with a new clock frequency.
Removes and re-adds the device using the SD card CS pin.
| p_handle | Pointer to the SPI device handle. |
| speedHz | New SPI clock frequency in Hz. |
Definition at line 191 of file spiPort.c.
References K_ESP32_PIN_CS_SDC, K_ESP32_SPI_HOST, K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, k_tag, and SPP_PORTS_HAL_ESP32_spiDeviceSetSpeed().
Referenced by SPP_PORTS_HAL_ESP32_spiDeviceSetSpeed().
| SPP_RetVal_t SPP_PORTS_HAL_ESP32_spiTransmitRaw | ( | void * | p_handle, |
| spp_uint8_t * | p_data, | ||
| spp_uint8_t | length ) |
Performs a raw full-duplex SPI transaction.
Transmitted data is overwritten by the received data.
| p_handle | Pointer to the SPI device handle. |
| p_data | Transmission and reception buffer. |
| length | Number of bytes to transfer. |
Definition at line 223 of file spiPort.c.
References K_SPP_ERROR_NULL_POINTER, K_SPP_ERROR_ON_SPI_TRANSACTION, K_SPP_OK, and SPP_PORTS_HAL_ESP32_spiTransmitRaw().
Referenced by SPP_PORTS_HAL_ESP32_spiTransmitRaw().
| spp_bool_t SPP_PORTS_HAL_ESP32_spiIsBusInitialized | ( | void | ) |
Check whether the SPI bus has been initialised.
Definition at line 218 of file spiPort.c.
References s_busInitialized, and SPP_PORTS_HAL_ESP32_spiIsBusInitialized().
Referenced by SPP_PORTS_HAL_ESP32_spiIsBusInitialized(), and SPP_PORTS_HAL_ESP32_storageInit().