Driver API for MCLK (plib_mclk.h)
More...
|
| typedef void(* | MCLK_CALLBACK) (void) |
| | Callback type for clock ready event.
|
| |
| typedef uint32_t | MCLK_AHB_MODULE |
| | AHB module bit-mask type used for clock gating.
|
| |
| typedef uint32_t | MCLK_APBA_MODULE |
| | APBA module bit-mask type used for clock gating.
|
| |
| typedef uint32_t | MCLK_APBB_MODULE |
| | APBB module bit-mask type used for clock gating.
|
| |
| typedef uint32_t | MCLK_APBC_MODULE |
| | APBC module bit-mask type used for clock gating.
|
| |
Driver API for MCLK (plib_mclk.h)
◆ MCLK_AHB_MODULE
AHB module bit-mask type used for clock gating.
This is a bit-mask type (uint32_t), not an enum type. This ensures the public API does not expose a closed set of peripherals.
How to choose the mask:
- Use the CMSIS device header mask directly:
MCLK_AHBMASK_<PERIPHERAL>_Msk / ...._Msk (exact spelling depends on the device header)
Multiple peripherals may be enabled/disabled by bitwise-OR'ing masks.
void MCLK_EnableAHBClock(MCLK_AHB_MODULE module)
Enables the AHB clock for a specific module.
◆ MCLK_APBA_MODULE
APBA module bit-mask type used for clock gating.
This is a bit-mask type (uint32_t), not an enum type. This ensures the public API does not expose a closed set of peripherals.
How to choose the mask:
- Use the CMSIS device header mask directly (exact spelling depends on the device header):
MCLK_APBAMASK_<PERIPHERAL>_Msk (or ..._Msk)
Multiple peripherals may be enabled/disabled by bitwise-OR'ing masks.
◆ MCLK_APBB_MODULE
APBB module bit-mask type used for clock gating.
This is a bit-mask type (uint32_t), not an enum type.
How to choose the mask:
- Use the CMSIS device header mask directly, e.g.
MCLK_APBBMASK_<PERIPHERAL>_Msk / ..._Msk (device-header dependent).
◆ MCLK_APBC_MODULE
APBC module bit-mask type used for clock gating.
This is a bit-mask type (uint32_t), not an enum type.
How to choose the mask:
- Use the CMSIS device header mask directly, e.g.
MCLK_APBCMASK_<PERIPHERAL>_Msk / ..._Msk (device-header dependent).
◆ MCLK_CALLBACK
| typedef void(* MCLK_CALLBACK) (void) |
Callback type for clock ready event.
◆ MCLK_CPU_CLOCK_DIVIDER
CPU clock division factors for MCLK.
| Enumerator |
|---|
| MCLK_CPU_CLK_DIV_1 | |
| MCLK_CPU_CLK_DIV_2 | |
| MCLK_CPU_CLK_DIV_4 | |
| MCLK_CPU_CLK_DIV_8 | |
| MCLK_CPU_CLK_DIV_16 | |
| MCLK_CPU_CLK_DIV_32 | |
| MCLK_CPU_CLK_DIV_64 | |
| MCLK_CPU_CLK_DIV_128 | |
◆ MCLK_ClearClockReadyFlag()
| void MCLK_ClearClockReadyFlag |
( |
void | | ) |
|
Clears the Clock Ready interrupt flag.
- Parameters
-
- Returns
- None.
◆ MCLK_ClockIsReady()
| bool MCLK_ClockIsReady |
( |
void | | ) |
|
Checks if the clock is ready (CKRDY flag).
- Parameters
-
- Returns
- true if the clock is ready, false otherwise.
◆ MCLK_DisableAHBClock()
Disables the AHB clock for a specific module.
- Parameters
-
| module | The AHB module to disable the clock for. |
- Returns
- None.
◆ MCLK_DisableAPBAClock()
Disables the APB clock for a module with APBA bus.
- Parameters
-
| module | The APBA module to disable the clock for. |
- Returns
- None.
◆ MCLK_DisableAPBBClock()
Disables the APB clock for a module with APBB bus.
- Parameters
-
| module | The APBB module to disable the clock for. |
- Returns
- None.
◆ MCLK_DisableAPBCClock()
Disables the APB clock for a module with APBC bus.
- Parameters
-
| module | The APBC module to disable the clock for. |
- Returns
- None.
◆ MCLK_DisableClockReadyInterrupt()
| void MCLK_DisableClockReadyInterrupt |
( |
void | | ) |
|
Disables the Clock Ready interrupt.
- Parameters
-
- Returns
- None.
◆ MCLK_EnableAHBClock()
Enables the AHB clock for a specific module.
- Parameters
-
| module | The AHB module to enable the clock for. |
- Returns
- None.
◆ MCLK_EnableAPBAClock()
Enables the APB clock for a module with APBA bus.
- Parameters
-
| module | The APBA module to enable the clock for. |
- Returns
- None.
◆ MCLK_EnableAPBBClock()
Enables the APB clock for a module with APBB bus.
- Parameters
-
| module | The APBB module to enable the clock for. |
- Returns
- None.
◆ MCLK_EnableAPBCClock()
Enables the APB clock for a module with APBC bus.
- Parameters
-
| module | The APBC module to enable the clock for. |
- Returns
- None.
◆ MCLK_EnableClockReadyInterrupt()
| void MCLK_EnableClockReadyInterrupt |
( |
void | | ) |
|
Enables the Clock Ready interrupt.
- Parameters
-
- Returns
- None.
◆ MCLK_GetCPUClockDivider()
| uint8_t MCLK_GetCPUClockDivider |
( |
void | | ) |
|
Gets the current CPU clock division factor.
- Parameters
-
- Returns
- Current CPU clock division factor.
◆ MCLK_Initialize()
| void MCLK_Initialize |
( |
void | | ) |
|
Initializes the MCLK peripheral.
- Parameters
-
- Returns
- None.
◆ MCLK_SetCallbackHandler()
Registers a callback for the Clock Ready event.
- Parameters
-
| callback | Function pointer to the callback to be registered. |
- Returns
- None.
◆ MCLK_SetCPUClockDivider()
Sets the CPU clock division factor.
- Parameters
-
| div | Division factor to set for the CPU clock. |
- Returns
- None.