![]() |
MT2523 API Reference
LinkIt SDK v4
|
This section introduces the Clock APIs including terms and acronyms, Clock function groups, enums, structures and functions. More...
This section introduces the Clock APIs including terms and acronyms, Clock function groups, enums, structures and functions.
The Clock Manager provides APIs to manage the clocks and the Clock Gating (CG), such as enabling and disabling the clock through the CG and querying the clock status.
The following provides descriptions of the terms commonly used in the Clock driver.
| Terms | Details |
|---|---|
| CG | Clock gating, applied to disable the clock. |
| PLL | Phase-locked loop. |
The clock configuration is chipset dependent and more details can be found in reference manual of the chipset.
The PLL, divider and MUX settings are configured in the booting stage. The Clock API is for turning on/off the clock gates and is mainly used in the peripheral drivers.
Call hal_clock_init() to initialize the clock only once before using any Clock API, otherwise the return status of the functions hal_clock_enable() and hal_clock_disable() will be HAL_CLOCK_STATUS_UNINITIALIZED.
The hal_clock_enable() and hal_clock_disable() APIs contain a reference counter that counts the number of times the API is called to support multiple users.
The Clock API supports sharing a single clock with multiple users.
Consider the following suggestions when calling hal_clock_enable() and hal_clock_disable():
Functions | |
| hal_clock_status_t | hal_clock_init (void) |
| This function initializes the clock driver and CG before using any Clock API. More... | |
| hal_clock_status_t | hal_clock_enable (hal_clock_cg_id clock_id) |
| This function enables a specific CG clock. More... | |
| hal_clock_status_t | hal_clock_disable (hal_clock_cg_id clock_id) |
| This function disables a specific CG clock. More... | |
| bool | hal_clock_is_enabled (hal_clock_cg_id clock_id) |
| This function queries the status of a specific CG clock. More... | |
| uint32_t | hal_clock_get_mcu_clock_frequency (void) |
| This function gets the MCU clock frequency. More... | |
Modules | |
| Clock Gate | |
| Enum | |
| hal_clock_status_t hal_clock_disable | ( | hal_clock_cg_id | clock_id | ) |
This function disables a specific CG clock.
| [in] | clock_id | is a unique clock identifier. |
| hal_clock_status_t hal_clock_enable | ( | hal_clock_cg_id | clock_id | ) |
This function enables a specific CG clock.
| [in] | clock_id | is a unique clock identifier. |
| uint32_t hal_clock_get_mcu_clock_frequency | ( | void | ) |
This function gets the MCU clock frequency.
| hal_clock_status_t hal_clock_init | ( | void | ) |
This function initializes the clock driver and CG before using any Clock API.
| bool hal_clock_is_enabled | ( | hal_clock_cg_id | clock_id | ) |
This function queries the status of a specific CG clock.
| [in] | clock_id | is a unique clock identifier. |