The MCUxpreeso SDK provides a driver for the 32kHz Clock Control Module (CCM32K)
Control 32kHz free-running oscillator
The function CCM32K_Enable32kFro() can be used to enable/disable 32kHz free-running oscillator. To trim the frequency of output clock when the clock source is selected as 32kHz free-running oscillator, the function CCM32K_Get32kFroTrimValue() has been provided to realize this feature.
Control 32kHz crystal oscillator
The function CCM32K_Set32kOscConfig() can be used to enable/disable/bypass 32kHz Crystal Oscillator. If the parameter "mode" is selected as kCCM32K_Disable32kHzCrystalOsc it means to disable the 32kHz Crystal Oscillator. If the parameter "mode" is selected as kCCM32K_Bypass32kHzCrystalOsc, it means the application uses the 32kHz Oscillator or 32kHz external clock from EXTAL pin.
|
enum | ccm32k_osc_xtal_cap_t {
kCCM32K_OscXtal0pFCap = 0x0U,
kCCM32K_OscXtal2pFCap = 0x1U,
kCCM32K_OscXtal4pFCap = 0x2U,
kCCM32K_OscXtal6pFCap = 0x3U,
kCCM32K_OscXtal8pFCap = 0x4U,
kCCM32K_OscXtal10pFCap = 0x5U,
kCCM32K_OscXtal12pFCap = 0x6U,
kCCM32K_OscXtal14pFCap = 0x7U,
kCCM32K_OscXtal16pFCap = 0x8U,
kCCM32K_OscXtal18pFCap = 0x9U,
kCCM32K_OscXtal20pFCap = 0xAU,
kCCM32K_OscXtal22pFCap = 0xBU,
kCCM32K_OscXtal24pFCap = 0xCU,
kCCM32K_OscXtal26pFCap = 0xDU,
kCCM32K_OscXtal28pFCap = 0xEU,
kCCM32K_OscXtal30pFCap = 0xFU
} |
| The enumerator of internal capacitance of OSC's XTAL pin. More...
|
|
enum | ccm32k_osc_extal_cap_t {
kCCM32K_OscExtal0pFCap = 0x0U,
kCCM32K_OscExtal2pFCap = 0x1U,
kCCM32K_OscExtal4pFCap = 0x2U,
kCCM32K_OscExtal6pFCap = 0x3U,
kCCM32K_OscExtal8pFCap = 0x4U,
kCCM32K_OscExtal10pFCap = 0x5U,
kCCM32K_OscExtal12pFCap = 0x6U,
kCCM32K_OscExtal14pFCap = 0x7U,
kCCM32K_OscExtal16pFCap = 0x8U,
kCCM32K_OscExtal18pFCap = 0x9U,
kCCM32K_OscExtal20pFCap = 0xAU,
kCCM32K_OscExtal22pFCap = 0xBU,
kCCM32K_OscExtal24pFCap = 0xCU,
kCCM32K_OscExtal26pFCap = 0xDU,
kCCM32K_OscExtal28pFCap = 0xEU,
kCCM32K_OscExtal30pFCap = 0xFU
} |
| The enumerator of internal capacitance of OSC's EXTAL pin. More...
|
|
enum | ccm32k_osc_coarse_adjustment_value_t |
| The enumerator of osc amplifier coarse fine adjustment. More...
|
|
enum | ccm32k_osc_mode_t {
kCCM32K_Disable32kHzCrystalOsc = 0x0U,
kCCM32K_Enable32kHzCrystalOsc = 0x1U,
kCCM32K_Bypass32kHzCrystalOsc = 0x3U
} |
| The enumerator of 32kHz oscillator. More...
|
|
enum | {
kCCM32K_32kOscReadyStatusFlag = CCM32K_STATUS_OSC32K_RDY_MASK,
kCCM32K_32kOscActiveStatusFlag = CCM32K_STATUS_OSC32K_ACTIVE_MASK,
kCCM32K_32kFroActiveStatusFlag = CCM32K_STATUS_FRO32K_ACTIVE_MASK,
kCCM32K_ClockDetectStatusFlag = CCM32K_STATUS_CLOCK_DET_MASK
} |
| The enumerator of CCM32K status flag. More...
|
|
enum | ccm32k_state_t {
kCCM32K_Both32kFro32kOscDisabled,
kCCM32K_Only32kFroEnabled = 0x1U,
kCCM32K_Only32kOscEnabled = 0x2U,
kCCM32K_Both32kFro32kOscEnabled = ((uint8_t)kCCM32K_Only32kFroEnabled | (uint8_t)kCCM32K_Only32kOscEnabled)
} |
| The enumerator of module state. More...
|
|
enum | ccm32k_clock_source_t {
kCCM32K_ClockSourceNone = 0x0U,
kCCM32K_ClockSource32kFro = 0x1U,
kCCM32K_ClockSource32kOsc = 0x2U
} |
| The enumerator of clock source. More...
|
|
enum | ccm32k_clock_monitor_freq_trim_value_t {
kCCM32K_ClockMonitor2CycleAssert = 0x0U,
kCCM32K_ClockMonitor4CycleAssert,
kCCM32K_ClockMonitor6CycleAssert,
kCCM32K_ClockMonitor8CycleAssert
} |
| Clock monitor frequency trim values. More...
|
|
enum | ccm32k_clock_monitor_divide_trim_value_t {
kCCM32K_ClockMonitor_1kHzFro32k_1kHzOsc32k = 0x0U,
kCCM32K_ClockMonitor_64HzFro32k_1kHzOsc32k = 0x1U,
kCCM32K_ClockMonitor_1KHzFro32k_64HzOsc32k = 0x2U,
kCCM32K_ClockMonitor_64HzFro32k_64HzOsc32k = 0x3U
} |
| Clock monitor divide trim values. More...
|
|
enum | ccm32k_clock_source_select_t {
kCCM32K_ClockSourceSelectFro32k = 0x0U,
kCCM32K_ClockSourceSelectOsc32k
} |
| CCM32K clock source enumeration. More...
|
|
enum | ccm32k_clock_output_peripheral_t {
kCCM32K_ClockOutToRtc = 1U << 0U,
kCCM32K_ClockOutToRfmc = 1U << 1U,
kCCM32K_ClockOutToNbu = 1U << 2U,
kCCM32K_ClockOutToWuuRmcPortD = 1U << 3U,
kCCM32K_ClockOutToOtherModules = 1U << 4U
} |
| 32kHz clock output peripheral bit map. More...
|
|
struct ccm32k_clock_monitor_config_t |
bool ccm32k_clock_monitor_config_t::enableClockMonitor |
struct ccm32k_osc_config_t |
bool ccm32k_osc_config_t::enableInternalCapBank |
Enumerator |
---|
kCCM32K_OscXtal0pFCap |
The internal capacitance for XTAL pin is 0pF.
|
kCCM32K_OscXtal2pFCap |
The internal capacitance for XTAL pin is 2pF.
|
kCCM32K_OscXtal4pFCap |
The internal capacitance for XTAL pin is 4pF.
|
kCCM32K_OscXtal6pFCap |
The internal capacitance for XTAL pin is 6pF.
|
kCCM32K_OscXtal8pFCap |
The internal capacitance for XTAL pin is 8pF.
|
kCCM32K_OscXtal10pFCap |
The internal capacitance for XTAL pin is 10pF.
|
kCCM32K_OscXtal12pFCap |
The internal capacitance for XTAL pin is 12pF.
|
kCCM32K_OscXtal14pFCap |
The internal capacitance for XTAL pin is 14pF.
|
kCCM32K_OscXtal16pFCap |
The internal capacitance for XTAL pin is 16pF.
|
kCCM32K_OscXtal18pFCap |
The internal capacitance for XTAL pin is 18pF.
|
kCCM32K_OscXtal20pFCap |
The internal capacitance for XTAL pin is 20pF.
|
kCCM32K_OscXtal22pFCap |
The internal capacitance for XTAL pin is 22pF.
|
kCCM32K_OscXtal24pFCap |
The internal capacitance for XTAL pin is 24pF.
|
kCCM32K_OscXtal26pFCap |
The internal capacitance for XTAL pin is 26pF.
|
kCCM32K_OscXtal28pFCap |
The internal capacitance for XTAL pin is 28pF.
|
kCCM32K_OscXtal30pFCap |
The internal capacitance for XTAL pin is 30pF.
|
Enumerator |
---|
kCCM32K_OscExtal0pFCap |
The internal capacitance for EXTAL pin is 0pF.
|
kCCM32K_OscExtal2pFCap |
The internal capacitance for EXTAL pin is 2pF.
|
kCCM32K_OscExtal4pFCap |
The internal capacitance for EXTAL pin is 4pF.
|
kCCM32K_OscExtal6pFCap |
The internal capacitance for EXTAL pin is 6pF.
|
kCCM32K_OscExtal8pFCap |
The internal capacitance for EXTAL pin is 8pF.
|
kCCM32K_OscExtal10pFCap |
The internal capacitance for EXTAL pin is 10pF.
|
kCCM32K_OscExtal12pFCap |
The internal capacitance for EXTAL pin is 12pF.
|
kCCM32K_OscExtal14pFCap |
The internal capacitance for EXTAL pin is 14pF.
|
kCCM32K_OscExtal16pFCap |
The internal capacitance for EXTAL pin is 16pF.
|
kCCM32K_OscExtal18pFCap |
The internal capacitance for EXTAL pin is 18pF.
|
kCCM32K_OscExtal20pFCap |
The internal capacitance for EXTAL pin is 20pF.
|
kCCM32K_OscExtal22pFCap |
The internal capacitance for EXTAL pin is 22pF.
|
kCCM32K_OscExtal24pFCap |
The internal capacitance for EXTAL pin is 24pF.
|
kCCM32K_OscExtal26pFCap |
The internal capacitance for EXTAL pin is 26pF.
|
kCCM32K_OscExtal28pFCap |
The internal capacitance for EXTAL pin is 28pF.
|
kCCM32K_OscExtal30pFCap |
The internal capacitance for EXTAL pin is 30pF.
|
Tunes the internal transconductance (gm) by increasing the current.
Enumerator |
---|
kCCM32K_Disable32kHzCrystalOsc |
Disable 32kHz Crystal Oscillator.
|
kCCM32K_Enable32kHzCrystalOsc |
Enable 32kHz Crystal Oscillator.
|
kCCM32K_Bypass32kHzCrystalOsc |
Bypass 32kHz Crystal Oscillator, use the 32kHz Oscillator or external 32kHz clock.
|
Enumerator |
---|
kCCM32K_32kOscReadyStatusFlag |
Indicates the 32kHz crystal oscillator is stable.
|
kCCM32K_32kOscActiveStatusFlag |
Indicates the 32kHz crystal oscillator is active and in use.
|
kCCM32K_32kFroActiveStatusFlag |
Indicates the 32kHz free running oscillator is active and in use.
|
kCCM32K_ClockDetectStatusFlag |
Indicates the clock monitor has detected an error.
|
Enumerator |
---|
kCCM32K_Both32kFro32kOscDisabled |
Indicates both 32kHz free running oscillator and 32kHz crystal oscillator are disabled.
|
kCCM32K_Only32kFroEnabled |
Indicates only 32kHz free running oscillator is enabled.
|
kCCM32K_Only32kOscEnabled |
Indicates only 32kHz crystal oscillator is enabled.
|
kCCM32K_Both32kFro32kOscEnabled |
Indicates both 32kHz free running oscillator and 32kHz crystal oscillator are enabled.
|
Enumerator |
---|
kCCM32K_ClockSourceNone |
None clock source.
|
kCCM32K_ClockSource32kFro |
32kHz free running oscillator is the clock source.
|
kCCM32K_ClockSource32kOsc |
32kHz crystal oscillator is the clock source.
|
Enumerator |
---|
kCCM32K_ClockMonitor2CycleAssert |
Clock monitor asserts 2 cycle after expected edge (assert after 10 cycles with no edge).
|
kCCM32K_ClockMonitor4CycleAssert |
Clock monitor asserts 4 cycle after expected edge (assert after 12 cycles with no edge).
|
kCCM32K_ClockMonitor6CycleAssert |
Clock monitor asserts 6 cycle after expected edge (assert after 14 cycles with no edge).
|
kCCM32K_ClockMonitor8CycleAssert |
Clock monitor asserts 8 cycle after expected edge (assert after 16 cycles with no edge).
|
Enumerator |
---|
kCCM32K_ClockMonitor_1kHzFro32k_1kHzOsc32k |
Clock monitor operates at 1 kHz for both FRO32K and OSC32K.
|
kCCM32K_ClockMonitor_64HzFro32k_1kHzOsc32k |
Clock monitor operates at 64 Hz for FRO32K and clock monitor operates at 1 kHz for OSC32K.
|
kCCM32K_ClockMonitor_1KHzFro32k_64HzOsc32k |
Clock monitor operates at 1K Hz for FRO32K and clock monitor operates at 64 Hz for OSC32K.
|
kCCM32K_ClockMonitor_64HzFro32k_64HzOsc32k |
Clock monitor operates at 64 Hz for FRO32K and clock monitor operates at 64 Hz for OSC32K.
|
Enumerator |
---|
kCCM32K_ClockSourceSelectFro32k |
FRO32K clock output is selected as clock source.
|
kCCM32K_ClockSourceSelectOsc32k |
OSC32K clock output is selected as clock source.
|
Enumerator |
---|
kCCM32K_ClockOutToRtc |
32kHz clock output to RTC.
|
kCCM32K_ClockOutToRfmc |
32kHz clock output to Rfmc.
|
kCCM32K_ClockOutToNbu |
32kHz clock output to NBU.
|
kCCM32K_ClockOutToWuuRmcPortD |
32kHz clock output to WUU/RMC/PORTD.
|
kCCM32K_ClockOutToOtherModules |
32kHz clock output to Other modules.
|
static void CCM32K_Enable32kFro |
( |
CCM32K_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Note
- There is a start up time before clocks are output from the FRO.
- Parameters
-
base | CCM32K peripheral base address. |
enable | Boolean value to enable or disable the 32kHz free-running oscillator. true – Enable 32kHz free-running oscillator. false – Disable 32kHz free-running oscillator. |
static void CCM32K_Lock32kFroWriteAccess |
( |
CCM32K_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
static uint16_t CCM32K_Get32kFroTrimValue |
( |
CCM32K_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
- Returns
- The current trim value.
void CCM32K_Set32kFroTrimValue |
( |
CCM32K_Type * |
base, |
|
|
uint16_t |
trimValue |
|
) |
| |
- Note
- The frequency is decreased monotonically when the trimValue is changed progressively from 0x0U to 0x7FFU.
-
If the FRO32 is enabled before invoking this function, then in this function the FRO32 will be disabled, after updating trim value the FRO32 will be re-enabled.
- Parameters
-
base | CCM32K peripheral base address. |
trimValue | The frequency trim value. |
static void CCM32K_Disable32kFroIFRLoad |
( |
CCM32K_Type * |
base, |
|
|
bool |
disable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
disable | Boolean value to disable or enable IFR loading function. true – Disable IFR loading function. false – Enable IFR loading function. |
static void CCM32K_Lock32kFroTrimWriteAccess |
( |
CCM32K_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
static void CCM32K_Lock32kOscWriteAccess |
( |
CCM32K_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
static void CCM32K_EnableClockMonitor |
( |
CCM32K_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
enable | Used to enable/disable clock monitor.
- turn Enable clock monitor.
- false Disable clock monitor.
|
static void CCM32K_LockClockMonitorWriteAccess |
( |
CCM32K_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
static void CCM32K_EnableCLKOutToPeripherals |
( |
CCM32K_Type * |
base, |
|
|
uint8_t |
peripheralMask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
peripheralMask | The mask of peripherals to enable 32kHz clock output, should be the OR'ed value of ccm32k_clock_output_peripheral_t. |
static void CCM32K_DisableCLKOutToPeripherals |
( |
CCM32K_Type * |
base, |
|
|
uint8_t |
peripheralMask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
peripheralMask | The mask of peripherals to disable 32kHz clock output, should be the OR'ed value of ccm32k_clock_output_peripheral_t. |
static void CCM32K_LockClockGateWriteAccess |
( |
CCM32K_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
static uint32_t CCM32K_GetStatusFlag |
( |
CCM32K_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | CCM32K peripheral base address. |
- Returns
- The status flag of the current node. The enumerator of status flags have been provided, please see the Enumerations title for details.
- Parameters
-
base | CCM32K peripheral base address. |
- Returns
- The CCM32K's current state, please refer to ccm32k_state_t for details.
- Parameters
-
base | CCM32K peripheral base address. |
- Return values
-
kCCM32K_ClockSourceNone | The none clock source is selected. |
kCCM32K_ClockSource32kFro | 32kHz free-running oscillator is selected as clock source. |
kCCM32K_ClockSource32kOsc | 32kHz crystal oscillator is selected as clock source.. |