Driver API for MCLK (plib_mclk.h) More...
Typedefs | |
| 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. | |
Enumerations | |
| enum | MCLK_CPU_CLOCK_DIVIDER { MCLK_CPU_CLK_DIV_1 = 0x01U , MCLK_CPU_CLK_DIV_2 = 0x02U , MCLK_CPU_CLK_DIV_4 = 0x04U , MCLK_CPU_CLK_DIV_8 = 0x08U , MCLK_CPU_CLK_DIV_16 = 0x10U , MCLK_CPU_CLK_DIV_32 = 0x20U , MCLK_CPU_CLK_DIV_64 = 0x40U , MCLK_CPU_CLK_DIV_128 = 0x80U } |
| CPU clock division factors for MCLK. More... | |
| enum | MCLK_AHB_MODULE_ENUM |
| Convenience AHB module masks. More... | |
| enum | MCLK_APBA_MODULE_ENUM |
| Convenience APBA module masks. More... | |
| enum | MCLK_APBB_MODULE_ENUM |
| Convenience APBB module masks. More... | |
| enum | MCLK_APBC_MODULE_ENUM |
| Convenience APBC module masks. More... | |
Functions | |
| void | MCLK_Initialize (void) |
| Initializes the MCLK peripheral. | |
| uint8_t | MCLK_GetCPUClockDivider (void) |
| Gets the current CPU clock division factor. | |
| void | MCLK_SetCPUClockDivider (MCLK_CPU_CLOCK_DIVIDER cpu_div) |
| Sets the CPU clock division factor. | |
| void | MCLK_EnableAHBClock (MCLK_AHB_MODULE module) |
| Enables the AHB clock for a specific module. | |
| void | MCLK_DisableAHBClock (MCLK_AHB_MODULE module) |
| Disables the AHB clock for a specific module. | |
| void | MCLK_EnableAPBAClock (MCLK_APBA_MODULE module) |
| Enables the APB clock for a module with APBA bus. | |
| void | MCLK_EnableAPBBClock (MCLK_APBB_MODULE module) |
| Enables the APB clock for a module with APBB bus. | |
| void | MCLK_EnableAPBCClock (MCLK_APBC_MODULE module) |
| Enables the APB clock for a module with APBC bus. | |
| void | MCLK_DisableAPBAClock (MCLK_APBA_MODULE module) |
| Disables the APB clock for a module with APBA bus. | |
| void | MCLK_DisableAPBBClock (MCLK_APBB_MODULE module) |
| Disables the APB clock for a module with APBB bus. | |
| void | MCLK_DisableAPBCClock (MCLK_APBC_MODULE module) |
| Disables the APB clock for a module with APBC bus. | |
| bool | MCLK_ClockIsReady (void) |
| Checks if the clock is ready (CKRDY flag). | |
| void | MCLK_EnableClockReadyInterrupt (void) |
| Enables the Clock Ready interrupt. | |
| void | MCLK_DisableClockReadyInterrupt (void) |
| Disables the Clock Ready interrupt. | |
| void | MCLK_ClearClockReadyFlag (void) |
| Clears the Clock Ready interrupt flag. | |
| void | MCLK_SetCallbackHandler (MCLK_CALLBACK callback) |
| Registers a callback for the Clock Ready event. | |
Driver API for MCLK (plib_mclk.h)
| typedef uint32_t 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:
MCLK_AHB_DMAC.MCLK_AHBMASK_<PERIPHERAL>_Msk / ...._Msk (exact spelling depends on the device header), ORMultiple peripherals may be enabled/disabled by bitwise-OR'ing masks.
| typedef uint32_t 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:
MCLK_APBA_GCLK.MCLK_APBAMASK_<PERIPHERAL>_Msk (or ..._Msk), ORMultiple peripherals may be enabled/disabled by bitwise-OR'ing masks.
| typedef uint32_t 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:
MCLK_APBBMASK_<PERIPHERAL>_Msk / ..._Msk (device-header dependent). | typedef uint32_t 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:
MCLK_APBCMASK_<PERIPHERAL>_Msk / ..._Msk (device-header dependent). | typedef void(* MCLK_CALLBACK) (void) |
Callback type for clock ready event.
| enum MCLK_AHB_MODULE_ENUM |
Convenience AHB module masks.
These are provided as enumerators for discoverability in IDEs, but the API parameter type remains MCLK_AHB_MODULE (a uint32_t mask).
Convenience APBA module masks.
These are provided as enumerators for discoverability in IDEs, but the API parameter type remains MCLK_APBA_MODULE (a uint32_t mask).
Convenience APBB module masks.
Convenience APBC module masks.
| void MCLK_ClearClockReadyFlag | ( | void | ) |
Clears the Clock Ready interrupt flag.
| None. |
| bool MCLK_ClockIsReady | ( | void | ) |
Checks if the clock is ready (CKRDY flag).
| None. |
| void MCLK_DisableAHBClock | ( | MCLK_AHB_MODULE | module | ) |
Disables the AHB clock for a specific module.
| module | The AHB module to disable the clock for. |
| void MCLK_DisableAPBAClock | ( | MCLK_APBA_MODULE | module | ) |
Disables the APB clock for a module with APBA bus.
| module | The APBA module to disable the clock for. |
| void MCLK_DisableAPBBClock | ( | MCLK_APBB_MODULE | module | ) |
Disables the APB clock for a module with APBB bus.
| module | The APBB module to disable the clock for. |
| void MCLK_DisableAPBCClock | ( | MCLK_APBC_MODULE | module | ) |
Disables the APB clock for a module with APBC bus.
| module | The APBC module to disable the clock for. |
| void MCLK_DisableClockReadyInterrupt | ( | void | ) |
Disables the Clock Ready interrupt.
| None. |
| void MCLK_EnableAHBClock | ( | MCLK_AHB_MODULE | module | ) |
Enables the AHB clock for a specific module.
| module | The AHB module to enable the clock for. |
| void MCLK_EnableAPBAClock | ( | MCLK_APBA_MODULE | module | ) |
Enables the APB clock for a module with APBA bus.
| module | The APBA module to enable the clock for. |
| void MCLK_EnableAPBBClock | ( | MCLK_APBB_MODULE | module | ) |
Enables the APB clock for a module with APBB bus.
| module | The APBB module to enable the clock for. |
| void MCLK_EnableAPBCClock | ( | MCLK_APBC_MODULE | module | ) |
Enables the APB clock for a module with APBC bus.
| module | The APBC module to enable the clock for. |
| void MCLK_EnableClockReadyInterrupt | ( | void | ) |
Enables the Clock Ready interrupt.
| None. |
| uint8_t MCLK_GetCPUClockDivider | ( | void | ) |
Gets the current CPU clock division factor.
| None. |
| void MCLK_Initialize | ( | void | ) |
Initializes the MCLK peripheral.
| None. |
| void MCLK_SetCallbackHandler | ( | MCLK_CALLBACK | callback | ) |
Registers a callback for the Clock Ready event.
| callback | Function pointer to the callback to be registered. |
| void MCLK_SetCPUClockDivider | ( | MCLK_CPU_CLOCK_DIVIDER | cpu_div | ) |
Sets the CPU clock division factor.
| div | Division factor to set for the CPU clock. |