Solaris Software
Loading...
Searching...
No Matches
halEsp32.c
Go to the documentation of this file.
1/**
2 * @file halEsp32.c
3 * @brief ESP32-S3 HAL port assembly.
4 *
5 * The per-driver implementations live in spi/, gpio/, storage/, time/ and
6 * uart/. This file only builds the SPP_HalPort_t descriptor consumed by the
7 * SPP core.
8 */
9
10/* ----------------------------------------------------------------
11 * INCLUDES
12 * ---------------------------------------------------------------- */
13#include "spp/hal/hal.h"
14#include "halEsp32.h"
15
16#include "spi/spiPort.h"
17#include "gpio/gpioPort.h"
18#include "storage/storagePort.h"
19#include "time/timePort.h"
20#include "uart/uartPort.h"
21
22/* ----------------------------------------------------------------
23 * PORT DESCRIPTORS
24 * ---------------------------------------------------------------- */
28 .spiDeviceInit = SPP_PORTS_HAL_ESP32_spiDeviceInit,
30 .spiDeviceSetSpeed = SPP_PORTS_HAL_ESP32_spiDeviceSetSpeed,
31 .spiTransmitRaw = SPP_PORTS_HAL_ESP32_spiTransmitRaw,
32};
33
35 .gpioConfigInterrupt = SPP_PORTS_HAL_ESP32_gpioConfigInterrupt,
36 .gpioRegisterIsr = SPP_PORTS_HAL_ESP32_gpioRegisterIsr,
39};
40
45
51
56};
57
59 .spi = s_esp32HalSpi,
60 .gpio = s_esp32HalGpio,
61 .storage = s_esp32HalStorage,
62 .time = s_esp32HalTime,
63 .uart = s_esp32HalUart,
64};
65
66/* ----------------------------------------------------------------
67 * PUBLIC FUNCTIONS
68 * ---------------------------------------------------------------- */
69
70/**
71 * @brief Returns a pointer to the ESP32-S3 HAL port descriptor.
72 * @return Pointer to the static @ref SPP_HalPort_t.
73 */
SPP_RetVal_t SPP_PORTS_HAL_ESP32_gpioConfigInterrupt(spp_uint32_t pin, spp_uint32_t intrType, spp_uint32_t pull)
Definition gpioPort.c:30
SPP_RetVal_t SPP_PORTS_HAL_ESP32_gpioRegisterIsr(spp_uint32_t pin, void *p_isrCtx)
Definition gpioPort.c:61
spp_uint16_t SPP_PORTS_HAL_ESP32_gpioRead(spp_uint32_t pin)
Definition gpioPort.c:87
SPP_RetVal_t SPP_PORTS_HAL_ESP32_gpioWrite(spp_uint32_t pin, spp_uint8_t level)
Definition gpioPort.c:94
ESP32-S3 GPIO port implementation.
static const SPP_HALTime_t s_esp32HalTime
Definition halEsp32.c:46
static const SPP_HALStorage_t s_esp32HalStorage
Definition halEsp32.c:41
static const SPP_HALGpio_t s_esp32HalGpio
Definition halEsp32.c:34
static const SPP_HALSpi_t s_esp32HalSpi
Definition halEsp32.c:25
static const SPP_HALUart_t s_esp32HalUart
Definition halEsp32.c:52
static const SPP_HalPort_t s_esp32HalPorts
Definition halEsp32.c:58
const SPP_HalPort_t * SPP_PORTS_ESP32S3_getHalPorts(void)
Returns a pointer to the ESP32-S3 HAL port descriptor.
Definition halEsp32.c:74
ESP32-S3 HAL port descriptor for SPP.
This file contains the structs that contain all the pointers to the functions that are used by the SP...
SPP_RetVal_t SPP_PORTS_HAL_ESP32_spiBusInit(void)
Definition spiPort.c:32
void * SPP_PORTS_HAL_ESP32_spiGetHandle(spp_uint8_t deviceIdx)
Returns the storage location of an SPI device handle.
Definition spiPort.c:70
SPP_RetVal_t SPP_PORTS_HAL_ESP32_spiDeviceSetSpeed(void *p_handle, spp_uint32_t speedHz)
Reconfigures an SPI device with a new clock frequency.
Definition spiPort.c:191
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.
Definition spiPort.c:144
SPP_RetVal_t SPP_PORTS_HAL_ESP32_spiDeviceInit(void *p_handle)
Definition spiPort.c:79
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.
Definition spiPort.c:223
ESP32-S3 SPI port implementation.
SPP_RetVal_t SPP_PORTS_HAL_ESP32_storageWrite(const void *p_buffer, spp_uint32_t first_block, spp_uint16_t count)
Writes raw 512-byte sectors directly to the SD card.
Definition storagePort.c:90
SPP_RetVal_t SPP_PORTS_HAL_ESP32_storageInit(void)
Initializes the SD card using SDSPI.
Definition storagePort.c:33
ESP32-S3 SD card storage port implementation.
GPIO struct that contains all the pointers to the GPIO functions.
Definition hal.h:129
SPI bus struct that contains all the pointers to the SPI functions.
Definition hal.h:22
Storage struct that contains all the pointers to the storage functions.
Definition hal.h:173
Time struct that contains all the pointers to the Time functions.
Definition hal.h:199
UART port struct that contains all the pointers to the UART functions.
Definition hal.h:95
Ports struct that contains all the pointers to the Ports functions.
Definition hal.h:234
spp_uint32_t SPP_PORTS_HAL_ESP32_getTimeUs(void)
Definition timePort.c:22
spp_uint32_t SPP_PORTS_HAL_ESP32_getTimeMs(void)
Definition timePort.c:17
void SPP_PORTS_HAL_ESP32_delayMs(spp_uint32_t ms)
Definition timePort.c:27
ESP32-S3 time port implementation.
SPP_RetVal_t SPP_PORTS_HAL_ESP32_uartTransmit(const void *p_data, spp_uint32_t len)
Definition uartPort.c:65
SPP_RetVal_t SPP_PORTS_HAL_ESP32_uartPortInit(void)
Definition uartPort.c:19
SPP_RetVal_t SPP_PORTS_HAL_ESP32_uartRead(void *p_data, spp_uint32_t len, spp_uint32_t *p_readBytes)
Reads data from the ESP32 UART.
Definition uartPort.c:91
ESP32-S3 UART port implementation.