esp-idf/components/hal/include/hal
..
adc_hal.h
adc_hal_common.h
adc_oneshot_hal.h
adc_types.h
adc_types_private.h
aes_hal.h
aes_types.h
apm_hal.h
apm_types.h
brownout_hal.h
cache_hal.h
cache_types.h
clk_tree_hal.h
dac_types.h
dma_types.h
ds_hal.h
ecc_hal.h
ecc_types.h
ecdsa_hal.h
ecdsa_types.h
efuse_hal.h
emac_hal.h
esp_flash_err.h
eth_types.h
etm_hal.h
gdma_hal.h
gdma_types.h
glitch_filter_types.h
gpio_hal.h
gpio_types.h
hmac_hal.h
i2c_hal.h
i2c_types.h
i2s_hal.h
i2s_types.h
ieee802154_common_ll.h
lcd_hal.h
lcd_types.h
ledc_hal.h
ledc_types.h
lp_timer_types.h
mcpwm_hal.h
mcpwm_types.h
memprot_types.h
mmu_hal.h
mmu_types.h
modem_clock_hal.h
modem_clock_types.h
mpu_hal.h
mpu_types.h
parlio_hal.h
parlio_types.h
pau_hal.h
pau_types.h
pcnt_hal.h
pcnt_types.h
pmu_types.h
readme.md
rmt_hal.h
rmt_types.h
rtc_hal.h
rtc_io_hal.h
rtc_io_types.h
sdio_slave_hal.h
sdio_slave_types.h
sdm_hal.h
sdm_types.h
sha_hal.h
sha_types.h
spi_flash_encrypt_hal.h
spi_flash_hal.h
spi_flash_types.h
spi_hal.h
spi_slave_hal.h
spi_slave_hd_hal.h
spi_types.h
systimer_hal.h
systimer_types.h
temperature_sensor_types.h
timer_hal.h
timer_types.h
touch_sensor_hal.h
touch_sensor_types.h
twai_hal.h
twai_types.h
uart_hal.h
uart_types.h
uhci_types.h
usb_dwc_hal.h
usb_dwc_ll.h
usb_hal.h
usb_phy_hal.h
usb_phy_types.h
usb_types_private.h
wdt_hal.h
wdt_types.h
xt_wdt_hal.h

readme.md

HAL Layer Readme

The HAL layer is designed to be used by the drivers. We don't guarantee the stability and back-compatibility among versions. The HAL layer may update very frequently with the driver. Please don't use them in the applications or treat them as stable APIs.

The HAL layer consists of two layers: HAL (upper) and Lowlevel(bottom). The HAL layer defines the steps and data required by the peripheral. The lowlevel is a translation layer converting general conceptions to register configurations.

Lowlevel

This layer should be all static inline. The first argument of LL functions is usually a pointer to the beginning address of the peripheral register. Each chip should have its own LL layer. The functions in this layer should be atomic and independent from each other so that the upper layer can change/perform one of the options/operation without touching the others.

HAL

This layer should depend on the operating system as little as possible. It's a wrapping of LL functions, so that the upper layer can combine basic steps into different working ways (polling, non-polling, interrupt, etc.). Without using queues/locks/delay/loop/etc., this layer can be easily port to other os or simulation systems.

To get better performance and better porting ability, contexts are used to hold sustainable data and pass the parameters.

To develop your own driver, it is suggested to copy the HAL layer to your own code and keep them until manual update.