Hardware Abstraction Layer (HAL)

The HAL is the topmost driver layer and the only one that most users should interact with. This layer is a common, reusable interface supporting a range of devices and architectures. This layer abstracts away the peculiarities of hardware and provides the same services to the programmer irrespectively of the hardware implementing the HAL. The HAL layer contains functions allowing the user access to the driver's functionality. Therefore, many of the functions are driver specific and may perform things such as:

Driver handle

As part of the abstraction between a specific hardware implementation and the HAL interface, the HAL driver specifies its own handle to store necessary data like hardware register interface pointers, buffer pointers, etc. The handle is used as a parameter to HAL functions in order to identify which resource to address.

The handles have the following definition:

struct [namespace]_descriptor
Example: struct usart_sync_descriptor USART0;