Solaris Software
Loading...
Searching...
No Matches
spiPort.h File Reference

ESP32-S3 SPI port implementation. More...

Include dependency graph for spiPort.h:
This graph shows which files directly or indirectly include this file:

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.

Detailed Description

ESP32-S3 SPI port implementation.

Definition in file spiPort.h.

Function Documentation

◆ SPP_PORTS_HAL_ESP32_spiBusInit()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_PORTS_HAL_ESP32_spiGetHandle()

void * SPP_PORTS_HAL_ESP32_spiGetHandle ( spp_uint8_t deviceIdx)

Returns the storage location of an SPI device handle.

Parameters
deviceIdxIndex of the SPI device.
Returns
Pointer to the static handle, or NULL if the index is invalid.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_PORTS_HAL_ESP32_spiDeviceInit()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_PORTS_HAL_ESP32_spiTransmit()

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.

Parameters
p_handlePointer to the SPI device handle.
p_dataTransaction buffer.
lengthTotal buffer length in bytes.
Returns
K_SPP_OK on success, error code otherwise.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_PORTS_HAL_ESP32_spiDeviceSetSpeed()

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.

Parameters
p_handlePointer to the SPI device handle.
speedHzNew SPI clock frequency in Hz.
Returns
K_SPP_OK on success, error code otherwise.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_PORTS_HAL_ESP32_spiTransmitRaw()

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.

Parameters
p_handlePointer to the SPI device handle.
p_dataTransmission and reception buffer.
lengthNumber of bytes to transfer.
Returns
K_SPP_OK on success, error code otherwise.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_PORTS_HAL_ESP32_spiIsBusInitialized()

spp_bool_t SPP_PORTS_HAL_ESP32_spiIsBusInitialized ( void )

Check whether the SPI bus has been initialised.

Returns
true if SPP_PORTS_HAL_ESP32_spiBusInit succeeded.

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().

Here is the call graph for this function:
Here is the caller graph for this function: