Doc Feedback
Thanks for your interest, welcome to contact us.
Thanks for your feedback
No matches were found 114page(s) matching the search query
Documentation > GR551x HAL and LL Drivers User Manual/ Overview/ GR551x Peripheral Drivers Copy URL

GR551x Peripheral Drivers

The GR551x peripheral drivers comprise Hardware Abstraction Layer (HAL) drivers and Low Layer (LL) drivers. The driver architecture is shown in Figure 1.

Figure 1 GR551x driver architecture

At the software layer, the HAL is in close association with the LL. LL APIs are called when internal HAL registers are accessed. In general, developers need to use HAL APIs to implement corresponding functions. For some special functions that cannot be implemented by using HAL APIs, developers need to call LL APIs to quickly encapsulate the required APIs.

HAL Drivers

The HAL drivers encapsulate most-commonly-used functions of all peripherals into a set of easy-to-use APIs, allowing developers to implement interactions between LL peripherals and upper-layer applications.

The HAL drivers provide the following features:

  • Intra-series APIs covering the common SoC functions as well as extension APIs for special SoC functions
  • Three API programming modes: polling, interrupt, and Direct Memory Access (DMA)
  • Fully reentrant and RTOS-compliant APIs
  • Support of multi-instance, allowing concurrent API calls for multiple instances of a peripheral (such as I2C0 and I2C1 in I2C)
  • Call for user callback functions in initialization/deinitialization APIs to initialize or deinitialize General Purpose Input/Output (GPIO), interrupt, and DMA
  • Call for callback functions in peripheral interrupt and error events to inform users that certain events have been triggered
  • Support of locking mechanism, enabling safe access to shared resources
  • Timeout for polling operations to prevent an infinite loop

LL Drivers

The LL drivers encapsulate atomic operations of all peripheral registers by using inline functions. The LL drivers which are closer to hardware than the HAL drivers offer API functions covering all peripheral features. Developers can use LL drivers to configure peripheral features that are not covered by the HAL drivers. For performance-demanding scenarios or those with limited storage space, developers can directly use LL drivers.

The LL drivers provide the following features:

  • Support of inline functions to prevent function call overhead
  • Encapsulation of register operations in LL drivers with a high-level portability and ease-of-reuse
  • Offering a wide range of features functionalities

Scan to follow

Open WeChat, use "Scan" to follow.