CN / EN
Doc Feedback
Thanks for your interest, welcome to contact us.
Thanks for your feedback
No matches were found 114page(s) matching the search query

API Classification

The HAL and LL driver APIs are categorized into two groups: generic APIs and extension APIs.

Generic APIs

Generic APIs offer common and generic functions for all GR551x SoCs series. Differences between HAL generic APIs and LL generic APIs are elaborated in the sections below.

HAL Generic APIs

Based on API roles, the HAL generic APIs are categorized into five types:

  • Initialization type: These APIs initialize/deinitialize peripherals and peripheral-specific public system resources. They help perform pull up/down for GPIO pins and functionality multiplexing, enable Nested Vectored Interrupt Controller (NVIC) interrupts, and initialize DMA channels. Example: hal_uart_init().
  • I/O operation type: These APIs allow data transmission and reception for UART. Example: hal_uart_transmit().
  • Interrupt handling and callback function type: These APIs are used to handle interrupts and call callback functions of peripherals. Examples: hal_uart_irq_handler() and hal_uart_tx_cplt_callback().
  • Control type: These APIs are used to set feature parameters of peripherals. Example: hal_spi_set_tx_fifo_threshold().
  • State and error type: These APIs are used to retrieve operating state and error code of HAL drivers. Example: hal_i2c_get_state().

LL Generic APIs

Based on API roles, the LL generic APIs are categorized into six types:

  • Initialization type: These APIs initialize/deinitialize peripherals. Example: ll_pwm_init().
  • Feature enablement type: These APIs enable/disable certain peripheral features. Example: ll_dma_enable_channel().
  • Parameter setting type: These APIs are used to set feature parameters of peripherals. Example: ll_dma_set_data_transfer_direction().
  • Flag and state type: These APIs used to indicate the flag and state of peripheral registers. Example: ll_i2c_is_active_flag_stop_det().
  • Interrupt control type: These APIs enable/disable certain peripheral interrupts. Example: ll_i2c_enable_it_stop_det().
  • DMA control type: These APIs enable/disable DMA requests from peripherals. Example: ll_i2c_enable_dma_req_tx().

Extension APIs

The extension APIs offer extensional functions that are unavailable on generic APIs for a certain SoC series. The classification rules of extension APIs are consistent with those of generic APIs for both HAL and LL drivers.

Scan to follow

Open WeChat, use "Scan" to follow.