Driver API for OSC32KCTRL (plib_osc32kctrl.h) More...
Typedefs | |
| typedef uint16_t | OSC32KCTRL_XOSC32K_CSUT |
| XOSC32K startup time selection (CSUT field). | |
| typedef uint32_t | OSC32KCTRL_OSC32K_CSUT |
| OSC32K startup time selection (CSUT field). | |
| typedef void(* | OSC32KCTRL_CALLBACK) (OSC32KCTRL_IRQ_SOURCE source) |
| Callback function type for OSC32KCTRL events. | |
Enumerations | |
| enum | OSC32KCTRL_IRQ_SOURCE { OSC32KCTRL_IRQ_XOSC32KRDY = 0U , OSC32KCTRL_IRQ_OSC32KRDY , OSC32KCTRL_IRQ_CLKFAIL } |
| Interrupt Source Enumeration. More... | |
Functions | |
| void | OSC32KCTRL_Initialize (void) |
| Initializes the OSC32KCTRL peripheral. | |
| bool | OSC32KCTRL_XOSC32K_IsReady (void) |
| Checks if the XOSC32K oscillator is ready. | |
| void | OSC32KCTRL_XOSC32K_Enable (void) |
| Enables the XOSC32K oscillator sub-peripheral. | |
| void | OSC32KCTRL_XOSC32K_Disable (void) |
| Disables the XOSC32K oscillator sub-peripheral. | |
| void | OSC32KCTRL_XOSC32K_EnableCrystalOsc (void) |
| Enables crystal oscillator source of XOSC32K. | |
| void | OSC32KCTRL_XOSC32K_DisableCrystalOsc (void) |
| Disables crystal oscillator source of XOSC32K. External clock source is set. as default source. | |
| void | OSC32KCTRL_XOSC32K_EnableOnDemand (void) |
| Enables On-Demand mode. XOSC32K Oscillators will keep running across resets when set. Except for POR (Power-On Reset). | |
| void | OSC32KCTRL_XOSC32K_DisableOnDemand (void) |
| Disables On-Demand mode for the XOSC32K oscillator. | |
| void | OSC32KCTRL_XOSC32K_SetStartUpTime (OSC32KCTRL_XOSC32K_CSUT startup_time) |
| Set the desired startup time for the XOSC32K oscillator. CFD is only effective after the startup time has elapsed. | |
| void | OSC32KCTRL_CFD_Enable (void) |
| Enables the Clock Failure Detection (CFD) feature for XOSC32K. | |
| void | OSC32KCTRL_CFD_Disable (void) |
| Disables the Clock Failure Detection (CFD) feature. | |
| bool | OSC32KCTRL_CFD_GetClockFailureStatus (void) |
| Check for clock failure status. There must be at least one rising and one falling XOSC32K clock edge during 4 safe clockperiods to meet non-failure conditions. | |
| bool | OSC32KCTRL_CFD_ClockIsSwitched (void) |
| When a clock failure is detected, the XOSC32K clock is replaced by the safe clock in order to maintain an active clock during the XOSC32K clock failure. | |
| void | OSC32KCTRL_OSC32K_SetCalibValue (uint32_t calib_value) |
| The frequency of the OSC32K oscillator is controlled by OSC32K.CALIB. Before using the OSC32K, this Calibration field must be loaded with production calibration values. | |
| bool | OSC32KCTRL_OSC32K_IsReady (void) |
| Once the oscillator is stable and ready to be used as a clock source, the OSC32KRDY bit in the STATUS register is set. | |
| void | OSC32KCTRL_OSC32K_EnableOsc (void) |
| Enables the OSC32K oscillator sub-peripheral. | |
| void | OSC32KCTRL_OSC32K_DisableOsc (void) |
| Disables the OSC32K oscillator sub-peripheral. | |
| void | OSC32KCTRL_OSC32K_Enable1K (void) |
| Enables the 1 kHz output of the OSC32K oscillator. | |
| void | OSC32KCTRL_OSC32K_Disable1K (void) |
| Disables the 1 kHz output of the OSC32K oscillator. | |
| void | OSC32KCTRL_OSC32K_Enable32K (void) |
| Enables the 32 kHz output of the OSC32K oscillator. | |
| void | OSC32KCTRL_OSC32K_Disable32K (void) |
| Disables the 32 kHz output of the OSC32K oscillator. | |
| void | OSC32KCTRL_OSC32K_EnableOnDemand (void) |
| Enables On-Demand mode. OSC32K Oscillator will keep running across resets when set. Except for POR (Power-On Reset). | |
| void | OSC32KCTRL_OSC32K_DisableOnDemand (void) |
| Disables On-Demand mode for the OSC32K oscillator. | |
| void | OSC32KCTRL_OSC32K_SetStartUpTime (OSC32KCTRL_OSC32K_CSUT startup_time) |
| During the start-up time, the oscillator output is masked to ensure that no unstable clock propagates to the digital logic. Set the desired startup time. | |
| void | OSC32KCTRL_CFD_EnableEventOutput (void) |
| Enables the clock failure event output for CFD. The CFD clock failure will be output on the Event Output. | |
| void | OSC32KCTRL_CFD_DisableEventOutput (void) |
| Disables the clock failure event output for CFD. | |
| void | OSC32KCTRL_EnableInterrupt (OSC32KCTRL_IRQ_SOURCE irq_source) |
| Enables the specified OSC32KCTRL interrupt source. | |
| void | OSC32KCTRL_DisableInterrupt (OSC32KCTRL_IRQ_SOURCE irq_source) |
| Disables the specified OSC32KCTRL interrupt source. | |
| bool | OSC32KCTRL_InterruptFlagIsSet (OSC32KCTRL_IRQ_SOURCE irq_source) |
| Reads the INTFLAG register for the specified OSC32KCTRL interrupt source. | |
| void | OSC32KCTRL_ClearInterruptFlag (OSC32KCTRL_IRQ_SOURCE irq_source) |
| Clears the interrupt flag for the specified OSC32KCTRL interrupt source. | |
| void | OSC32KCTRL_SetCallbackHandler (OSC32KCTRL_CALLBACK callback) |
| Registers a callback function for OSC32KCTRL interrupt events. | |
Driver API for OSC32KCTRL (plib_osc32kctrl.h)
| typedef void(* OSC32KCTRL_CALLBACK) (OSC32KCTRL_IRQ_SOURCE source) |
Callback function type for OSC32KCTRL events.
| source | Interrupt source |
OSC32K startup time selection (CSUT field).
This type is intended to be configured using the device family pack (DFP) field macros for the OSC32K STARTUP setting.
OSC32KCTRL_OSC32K_STARTUP_CYCLE* macros, for example:OSC32KCTRL_OSC32K_STARTUP_CYCLE3 (short startup)OSC32KCTRL_OSC32K_STARTUP_CYCLE10 (medium startup)OSC32KCTRL_OSC32K_STARTUP_CYCLE34 (longer startup)OSC32KCTRL_OSC32K_STARTUP_CYCLE130 (very long startup) XOSC32K startup time selection (CSUT field).
This type is intended to be configured using the device family pack (DFP) field macros for the XOSC32K STARTUP setting.
OSC32KCTRL_XOSC32K_STARTUP_CYCLE* macros, for example:OSC32KCTRL_XOSC32K_STARTUP_CYCLE1 (short startup)OSC32KCTRL_XOSC32K_STARTUP_CYCLE32 (medium startup)OSC32KCTRL_XOSC32K_STARTUP_CYCLE2048 (longer startup)OSC32KCTRL_XOSC32K_STARTUP_CYCLE32768 (very long startup) | bool OSC32KCTRL_CFD_ClockIsSwitched | ( | void | ) |
When a clock failure is detected, the XOSC32K clock is replaced by the safe clock in order to maintain an active clock during the XOSC32K clock failure.
| None. |
| void OSC32KCTRL_CFD_Disable | ( | void | ) |
Disables the Clock Failure Detection (CFD) feature.
| None. |
| void OSC32KCTRL_CFD_DisableEventOutput | ( | void | ) |
Disables the clock failure event output for CFD.
| None. |
| void OSC32KCTRL_CFD_Enable | ( | void | ) |
Enables the Clock Failure Detection (CFD) feature for XOSC32K.
| None. |
| void OSC32KCTRL_CFD_EnableEventOutput | ( | void | ) |
Enables the clock failure event output for CFD. The CFD clock failure will be output on the Event Output.
| None. |
| bool OSC32KCTRL_CFD_GetClockFailureStatus | ( | void | ) |
Check for clock failure status. There must be at least one rising and one falling XOSC32K clock edge during 4 safe clockperiods to meet non-failure conditions.
| None. |
| void OSC32KCTRL_ClearInterruptFlag | ( | OSC32KCTRL_IRQ_SOURCE | irq_source | ) |
Clears the interrupt flag for the specified OSC32KCTRL interrupt source.
| irq_source | The interrupt source for which to clear the flag (OSC32KCTRL_IRQ_SOURCE). |
| void OSC32KCTRL_DisableInterrupt | ( | OSC32KCTRL_IRQ_SOURCE | irq_source | ) |
Disables the specified OSC32KCTRL interrupt source.
| irq_source | The interrupt source to disable (OSC32KCTRL_IRQ_SOURCE). |
| void OSC32KCTRL_EnableInterrupt | ( | OSC32KCTRL_IRQ_SOURCE | irq_source | ) |
Enables the specified OSC32KCTRL interrupt source.
| irq_source | The interrupt source to enable (OSC32KCTRL_IRQ_SOURCE). |
| void OSC32KCTRL_Initialize | ( | void | ) |
Initializes the OSC32KCTRL peripheral.
| None. |
| bool OSC32KCTRL_InterruptFlagIsSet | ( | OSC32KCTRL_IRQ_SOURCE | irq_source | ) |
Reads the INTFLAG register for the specified OSC32KCTRL interrupt source.
| irq_source | The interrupt source to check (OSC32KCTRL_IRQ_SOURCE). |
| void OSC32KCTRL_OSC32K_Disable1K | ( | void | ) |
Disables the 1 kHz output of the OSC32K oscillator.
| None. |
| void OSC32KCTRL_OSC32K_Disable32K | ( | void | ) |
Disables the 32 kHz output of the OSC32K oscillator.
| None. |
| void OSC32KCTRL_OSC32K_DisableOnDemand | ( | void | ) |
Disables On-Demand mode for the OSC32K oscillator.
| None. |
| void OSC32KCTRL_OSC32K_DisableOsc | ( | void | ) |
Disables the OSC32K oscillator sub-peripheral.
| None. |
| void OSC32KCTRL_OSC32K_Enable1K | ( | void | ) |
Enables the 1 kHz output of the OSC32K oscillator.
| None. |
| void OSC32KCTRL_OSC32K_Enable32K | ( | void | ) |
Enables the 32 kHz output of the OSC32K oscillator.
| None. |
| void OSC32KCTRL_OSC32K_EnableOnDemand | ( | void | ) |
Enables On-Demand mode. OSC32K Oscillator will keep running across resets when set. Except for POR (Power-On Reset).
| None. |
| void OSC32KCTRL_OSC32K_EnableOsc | ( | void | ) |
Enables the OSC32K oscillator sub-peripheral.
| None. |
| bool OSC32KCTRL_OSC32K_IsReady | ( | void | ) |
Once the oscillator is stable and ready to be used as a clock source, the OSC32KRDY bit in the STATUS register is set.
| None. |
| void OSC32KCTRL_OSC32K_SetCalibValue | ( | uint32_t | calib_value | ) |
The frequency of the OSC32K oscillator is controlled by OSC32K.CALIB. Before using the OSC32K, this Calibration field must be loaded with production calibration values.
| calib_value | Calibration value. |
| void OSC32KCTRL_OSC32K_SetStartUpTime | ( | OSC32KCTRL_OSC32K_CSUT | startup_time | ) |
During the start-up time, the oscillator output is masked to ensure that no unstable clock propagates to the digital logic. Set the desired startup time.
| startup_time | The desired startup time (OSC32KCTRL_CSUT). |
| void OSC32KCTRL_SetCallbackHandler | ( | OSC32KCTRL_CALLBACK | callback | ) |
Registers a callback function for OSC32KCTRL interrupt events.
| callback | Pointer to the callback function to be registered. |
| void OSC32KCTRL_XOSC32K_Disable | ( | void | ) |
Disables the XOSC32K oscillator sub-peripheral.
| None. |
| void OSC32KCTRL_XOSC32K_DisableCrystalOsc | ( | void | ) |
Disables crystal oscillator source of XOSC32K. External clock source is set. as default source.
| None. |
| void OSC32KCTRL_XOSC32K_DisableOnDemand | ( | void | ) |
Disables On-Demand mode for the XOSC32K oscillator.
| None. |
| void OSC32KCTRL_XOSC32K_Enable | ( | void | ) |
Enables the XOSC32K oscillator sub-peripheral.
| None. |
| void OSC32KCTRL_XOSC32K_EnableCrystalOsc | ( | void | ) |
Enables crystal oscillator source of XOSC32K.
| None. |
| void OSC32KCTRL_XOSC32K_EnableOnDemand | ( | void | ) |
Enables On-Demand mode. XOSC32K Oscillators will keep running across resets when set. Except for POR (Power-On Reset).
| None. |
| bool OSC32KCTRL_XOSC32K_IsReady | ( | void | ) |
Checks if the XOSC32K oscillator is ready.
| None. |
| void OSC32KCTRL_XOSC32K_SetStartUpTime | ( | OSC32KCTRL_XOSC32K_CSUT | startup_time | ) |
Set the desired startup time for the XOSC32K oscillator. CFD is only effective after the startup time has elapsed.
| startup_time | The desired startup time (OSC32KCTRL_CSUT). |