ESP32 HAL port for SPP — polling SPI, no FreeRTOS dependency. More...
#include "spp/hal/hal.h"#include "spp/hal/gpio/gpio.h"#include "spp/hal/uart/uart.h"#include "spp/core/returnTypes.h"#include "spp/core/types.h"#include "macrosEsp32.h"#include "halEsp32.h"#include "driver/spi_common.h"#include "driver/spi_master.h"#include "driver/gpio.h"#include "driver/sdspi_host.h"#include "sdmmc_cmd.h"#include "esp_log.h"#include "esp_timer.h"#include "driver/uart.h"#include <string.h>Go to the source code of this file.
Variables | |
| static const SPP_HALSpi_t | s_esp32HalSpi |
| static const SPP_HALGpio_t | s_esp32HalGpio |
| static const SPP_HALStorage_t | s_esp32HalStorage |
| static const SPP_HALTime_t | s_esp32HalTime |
| static const SPP_HALUart_t | s_esp32HalUart |
| static const SPP_HalPort_t | s_esp32HalPorts |
| static const char *const | k_tag = "SPP_HAL" |
| static spi_device_handle_t | s_spiHandles [K_ESP32_MAX_SPI_DEVICES] |
| static spp_uint8_t | s_spiDevCount = 0U |
| static spp_bool_t | s_busInitialized = false |
| static sdspi_dev_handle_t | sdHandle |
| static sdmmc_card_t | sdCard |
| static spp_bool_t | s_storageInitialized = false |
ESP32 HAL port for SPP — polling SPI, no FreeRTOS dependency.
Register g_esp32HalPort before calling SPP_CORE_init().
Definition in file halEsp32.c.
|
static |
Definition at line 128 of file halEsp32.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().
|
static |
Definition at line 166 of file halEsp32.c.
References K_ESP32_MAX_SPI_DEVICES, s_spiHandles, and SPP_PORTS_HAL_ESP32_spiGetHandle().
Referenced by SPP_PORTS_HAL_ESP32_spiGetHandle().
|
static |
Definition at line 175 of file halEsp32.c.
References K_ESP32_MAX_SPI_DEVICES, K_ESP32_PIN_CS_BMP, K_ESP32_PIN_CS_ICM, K_ESP32_SPI_HOST, K_ESP32_SPI_IDX_BMP, K_ESP32_SPI_IDX_ICM, K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, k_tag, s_spiDevCount, and SPP_PORTS_HAL_ESP32_spiDeviceInit().
Referenced by SPP_PORTS_HAL_ESP32_spiDeviceInit().
|
static |
Definition at line 220 of file halEsp32.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().
|
static |
Definition at line 267 of file halEsp32.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().
|
static |
Definition at line 304 of file halEsp32.c.
References K_SPP_OK, and SPP_PORTS_HAL_ESP32_gpioConfigInterrupt().
Referenced by SPP_PORTS_HAL_ESP32_gpioConfigInterrupt().
|
static |
Definition at line 327 of file halEsp32.c.
References K_SPP_OK, SPP_PORTS_HAL_ESP32_gpioIsr(), and SPP_PORTS_HAL_ESP32_gpioRegisterIsr().
Referenced by SPP_PORTS_HAL_ESP32_gpioRegisterIsr().
|
static |
Definition at line 343 of file halEsp32.c.
References K_ESP32_PIN_CS_BMP, K_ESP32_PIN_CS_ICM, K_ESP32_PIN_CS_SDC, K_ESP32_SPI_HOST, K_SPP_ERROR, K_SPP_OK, s_busInitialized, s_storageInitialized, sdCard, sdHandle, and SPP_PORTS_HAL_ESP32_storageInit().
Referenced by SPP_PORTS_HAL_ESP32_storageInit().
|
static |
Definition at line 398 of file halEsp32.c.
References K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, s_storageInitialized, sdCard, and SPP_PORTS_HAL_ESP32_storageWrite().
Referenced by SPP_PORTS_HAL_ESP32_storageWrite().
|
static |
Definition at line 430 of file halEsp32.c.
References SPP_PORTS_HAL_ESP32_getTimeMs().
Referenced by SPP_PORTS_HAL_ESP32_delayMs(), and SPP_PORTS_HAL_ESP32_getTimeMs().
|
static |
Definition at line 435 of file halEsp32.c.
References SPP_PORTS_HAL_ESP32_getTimeUs().
Referenced by SPP_PORTS_HAL_ESP32_getTimeUs().
|
static |
Definition at line 440 of file halEsp32.c.
References SPP_PORTS_HAL_ESP32_delayMs(), and SPP_PORTS_HAL_ESP32_getTimeMs().
Referenced by SPP_PORTS_HAL_ESP32_delayMs().
|
static |
Definition at line 451 of file halEsp32.c.
References K_ESP32_UART_BAUD_RATE, K_ESP32_UART_CTS_PIN, K_ESP32_UART_PORT_ID, K_ESP32_UART_RTS_PIN, K_ESP32_UART_RX_BUFFER_SIZE, K_ESP32_UART_RX_PIN, K_ESP32_UART_TX_BUFFER_SIZE, K_ESP32_UART_TX_PIN, K_SPP_ERROR, K_SPP_OK, and SPP_PORTS_HAL_ESP32_uartPortInit().
Referenced by SPP_PORTS_HAL_ESP32_uartPortInit().
|
static |
Definition at line 497 of file halEsp32.c.
References K_ESP32_UART_PORT_ID, K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, and SPP_PORTS_HAL_ESP32_uartTransmit().
Referenced by SPP_PORTS_HAL_ESP32_uartTransmit().
|
static |
Reads data from the ESP32 UART.
| [out] | p_data | Pointer to the buffer where received data will be stored. |
| [in] | len | Number of bytes to read. |
| [out] | p_readBytes | Pointer to the variable where the number of bytes read will be stored. |
Definition at line 523 of file halEsp32.c.
References K_ESP32_UART_MAX_DELAY, K_ESP32_UART_PORT_ID, K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, and SPP_PORTS_HAL_ESP32_uartRead().
Referenced by SPP_PORTS_HAL_ESP32_uartRead().
| const SPP_HalPort_t * SPP_PORTS_ESP32S3_getHalPorts | ( | void | ) |
Returns a pointer to the ESP32-S3 HAL port descriptor.
Definition at line 105 of file halEsp32.c.
References s_esp32HalPorts, and SPP_PORTS_ESP32S3_getHalPorts().
Referenced by app_main(), and SPP_PORTS_ESP32S3_getHalPorts().
|
static |
Definition at line 298 of file halEsp32.c.
References SPP_GpioIsrCtx_t::p_flag, and SPP_PORTS_HAL_ESP32_gpioIsr().
Referenced by SPP_PORTS_HAL_ESP32_gpioIsr(), and SPP_PORTS_HAL_ESP32_gpioRegisterIsr().
|
static |
Definition at line 58 of file halEsp32.c.
|
static |
Definition at line 66 of file halEsp32.c.
|
static |
Definition at line 71 of file halEsp32.c.
|
static |
Definition at line 76 of file halEsp32.c.
|
static |
Definition at line 82 of file halEsp32.c.
|
static |
Definition at line 89 of file halEsp32.c.
Referenced by SPP_PORTS_ESP32S3_getHalPorts().
|
static |
Definition at line 114 of file halEsp32.c.
Referenced by SPP_PORTS_HAL_ESP32_spiBusInit(), SPP_PORTS_HAL_ESP32_spiDeviceInit(), and SPP_PORTS_HAL_ESP32_spiDeviceSetSpeed().
|
static |
Definition at line 116 of file halEsp32.c.
Referenced by SPP_PORTS_HAL_ESP32_spiGetHandle().
|
static |
Definition at line 117 of file halEsp32.c.
Referenced by SPP_PORTS_HAL_ESP32_spiDeviceInit().
|
static |
Definition at line 118 of file halEsp32.c.
Referenced by SPP_PORTS_HAL_ESP32_spiBusInit(), and SPP_PORTS_HAL_ESP32_storageInit().
|
static |
Definition at line 120 of file halEsp32.c.
Referenced by SPP_PORTS_HAL_ESP32_storageInit().
|
static |
Definition at line 121 of file halEsp32.c.
Referenced by SPP_PORTS_HAL_ESP32_storageInit(), and SPP_PORTS_HAL_ESP32_storageWrite().
|
static |
Definition at line 122 of file halEsp32.c.
Referenced by SPP_PORTS_HAL_ESP32_storageInit(), and SPP_PORTS_HAL_ESP32_storageWrite().