esp-idf/components/soc/include/hal
Ivan Grokhotkov e4d45608d3 soc: add ledc_caps.h, replace target-based ifdefs with caps-based 2019-12-28 20:33:21 +00:00
..
adc_hal.h
adc_types.h
dac_hal.h
dac_types.h
esp_flash_err.h
gpio_hal.h bugfix(gpio):fix esp32 s2 rtc io issue 2019-11-27 17:18:20 +08:00
gpio_types.h bugfix(gpio):fix esp32 s2 rtc io issue 2019-11-27 17:18:20 +08:00
hal_defs.h
i2c_hal.h bugfix(i2c): fix I2C driver breaking change issue. 2019-12-04 15:51:36 +08:00
i2c_types.h
i2s_hal.h
i2s_types.h
ledc_hal.h
ledc_types.h soc: add ledc_caps.h, replace target-based ifdefs with caps-based 2019-12-28 20:33:21 +00:00
mcpwm_hal.h
mcpwm_types.h
pcnt_hal.h
pcnt_types.h
readme.md
rmt_hal.h
rmt_types.h
rtc_io_hal.h
rtc_io_types.h
sdio_slave_hal.h sdio_slave: support HAL layer 2019-12-13 18:33:15 +08:00
sdio_slave_ll.h sdio_slave: support HAL layer 2019-12-13 18:33:15 +08:00
sdio_slave_types.h sdio_slave: support HAL layer 2019-12-13 18:33:15 +08:00
sigmadelta_hal.h
sigmadelta_types.h
spi_flash_hal.h ble_mesh_wifi_coexist example: Disable Wi-Fi RX IRAM optimisation 2019-11-28 09:20:00 +08:00
spi_flash_types.h ble_mesh_wifi_coexist example: Disable Wi-Fi RX IRAM optimisation 2019-11-28 09:20:00 +08:00
spi_hal.h
spi_slave_hal.h
spi_types.h
timer_hal.h
timer_types.h
touch_sensor_hal.h Refactor the touch sensor driver 2019-11-27 20:08:44 +08:00
touch_sensor_types.h Refactor the touch sensor driver 2019-11-27 20:08:44 +08:00
uart_hal.h add simplified API to set UART threshold values for RX FIFO full and TX FIFO empty 2019-12-16 20:26:04 +00:00
uart_types.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.