components/esp_hal_gpspi/README.md
[!NOTE] This component is currently in beta. Its API, behavior, and compatibility may change at any time and without notice; backward compatibility is not guaranteed. Use caution when integrating into production systems.
The esp_hal_spi component provides a Hardware Abstraction Layer for the General Purpose SPI (GPSPI) peripherals across all ESP-IDF supported targets. It serves as a foundation for the higher-level SPI drivers, offering a consistent interface to interact with SPI hardware while hiding the complexities of chip-specific implementations.
The HAL architecture consists of two primary layers:
HAL Layer (Upper): Defines the operational sequences and data structures required to interact with SPI peripherals, including:
Low-Level Layer (Bottom): Acts as a translation layer between the HAL and the register definitions in the soc component, handling:
This component is primarily used by ESP-IDF peripheral drivers such as esp_driver_spi. It provides the low-level hardware abstraction needed for SPI communication with external devices.
For advanced developers implementing custom SPI solutions, the HAL functions can be used directly. However, please note that the interfaces provided by this component are internal to ESP-IDF and are subject to change.
Master Mode (without DMA):
setup_device to update parameters for a specific devicesetup_trans to update parameters for a specific transactionSlave Mode (without DMA):
spi_slave_hal_initspi_slave_hal_setup_device to update parameters for the devicespi_slave_hal_set_trans_bitlen to set transaction bit lengthspi_slave_hal_user_start to trigger the SPI transaction to startspi_slave_hal_usr_is_donespi_slave_hal_store_result to store the received dataspi_slave_hal_get_rcv_bitlen to get the received data lengthsoc: Provides chip-specific register definitionshal: Core hardware abstraction utilities and macrosesp_hal_gpio: Required for ESP32 to access GPIO matrix delay information