Drive Tiering
Note
The driver layered model is applicable to all peripherals. This section takes UART as an example to explain.
Example
The following figure lists the files related to UART driver implementation.
- armino
- middleware
- driver
- include
- uart.h
- uart
- uart_driver.c
- uart_driver.h
- uart_statis.c
- uart_statis.h
- arch
- bk7256
- soc
- uart_cap.h
- uart_reg.h
- uart_struct.h
- hal
- uart_ll.c
- uart_ll.h
- common
- hal
- include
- uart_hal.h
- uart_types.h
- uart_hal.c
- soc
- include
- uart_hw.h
Tiering Overview
UART (Drive is divided into drive layer), HAL (Hardware abstraction layer), LL (Register interface layer) and SOC (Register definition layer):
Layer |
Function Overview |
---|---|
drive |
|
HAL |
|
LL |
|
SoC |
Provide register definition |
Document description
Layer |
Header file name |
Function Overview |
---|---|---|
Driver |
uart_types.h uart.h uart_driver.c uart_driver.h uart_statis.c uart_statis.h |
UART API Type Definition UART API statement UART Drive implementation UART Drive private data types and macro definitions UART Driver statistics related information UART Similar definitions related to driver statistics |
HAL |
uart_hal.h uart_hal.c uart_ll.h |
Hardware abstraction layer API statement, shared by different boards UART Hardware Abstraction Layer Interface Implementation Packaging register access interface, making the deposit code more readable |
SoC |
uart_reg.h uart_struct.h uart_cap.h |
Register macro definition, board dependent Define register in the form of C structure Hardware capability parameters |