Driver API for OSC32KCTRL (plib_osc32kctrl.h) More...
Macros | |
| #define | OSC32KCTRL_WP_KEY (0x4F5343U) |
| Write Protection Key (device-specific, example value) | |
Typedefs | |
| typedef void(* | OSC32KCTRL_CALLBACK) (OSC32KCTRL_IRQ_SOURCE source) |
| Callback function type for OSC32KCTRL events. | |
Enumerations | |
| enum | OSC32KCTRL_RTC_CLOCK { OSC32KCTRL_RTCSEL_OSC1K = 0x02U , OSC32KCTRL_RTCSEL_OSC32K = 0x03U , OSC32KCTRL_RTCSEL_XOSC1K = 0x04U , OSC32KCTRL_RTCSEL_XOSC32K = 0x05U } |
| RTC Clock Source Selection. More... | |
| enum | OSC32KCTRL_XTAL_SOURCE { XOSC32K_EXTCLK = 0x00U , XOSC32K_CRYSTAL = 0x04U } |
| XOSC32K Clock Source Selection. More... | |
| enum | OSC32K_CFD_PRESCALER { OSC32K_DIV_1 = 0x0U , OSC32K_DIV_2 = 0x1U } |
| CFD XOSC32K Prescaler Selection. More... | |
| enum | OSC32KCTRL_CSUT { XOSC23K_1K_CYCLES = 0x0U , XOSC23K_16K_CYCLES = 0x1U , XOSC23K_32K_CYCLES = 0x2U } |
| XOSC32K Startup Time Selection. More... | |
| enum | OSC32KCTRL_IRQ_SOURCE { OSC32KCTRL_IRQ_XOSC32KRDY = 0U , OSC32KCTRL_IRQ_OSC32KRDY = 1U , OSC32KCTRL_IRQ_CLKFAIL = 2U } |
| Interrupt Source Enumeration. More... | |
Functions | |
| void | OSC32KCTRL_Initialize (void) |
| Initializes the OSC32KCTRL peripheral. | |
| bool | OSC32KCTRL_OSC32K_IsReady (void) |
| Checks if the OSC32K oscillator is ready. | |
| void | OSC32KCTRL_OSC32K_EnableOnDemand (void) |
| Enables On-Demand mode for the OSC32K oscillator. | |
| void | OSC32KCTRL_OSC32K_DisableOnDemand (void) |
| Disables On-Demand mode for the OSC32K oscillator. | |
| bool | OSC32KCTRL_OSC32K_OnDemandIsEnabled (void) |
| Reads the On-Demand mode status of the OSC32K oscillator. | |
| void | OSC32KCTRL_RTC_SelectClockSource (OSC32KCTRL_RTC_CLOCK rtc_sel) |
| Sets the RTC clock source. | |
| uint32_t | OSC32KCTRL_RTC_GetClockSource (void) |
| Gets the current RTC clock source selection. | |
| bool | OSC32KCTRL_XOSC32K_IsReady (void) |
| Checks if the XOSC32K oscillator is ready. | |
| void | OSC32KCTRL_XOSC32K_SelectClockSource (OSC32KCTRL_XTAL_SOURCE xtal_source) |
| Selects the external source for the XOSC32K oscillator. | |
| void | OSC32KCTRL_XOSC32K_Enable (void) |
| Enables the XOSC32K oscillator. | |
| void | OSC32KCTRL_XOSC32K_Disable (void) |
| Disables the XOSC32K oscillator. | |
| void | OSC32KCTRL_XOSC32K_EnableOnDemand (void) |
| Enables On-Demand mode for the XOSC32K oscillator. | |
| void | OSC32KCTRL_XOSC32K_DisableOnDemand (void) |
| Disables On-Demand mode for the XOSC32K oscillator. | |
| bool | OSC32KCTRL_XOSC32K_OnDemandIsEnabled (void) |
| Reads the On-Demand mode status of the XOSC32K oscillator. | |
| void | OSC32KCTRL_XOSC32K_SetStartUpTime (OSC32KCTRL_CSUT startup_time) |
| Sets the startup time for the XOSC32K oscillator. | |
| uint32_t | OSC32KCTRL_XOSC32K_GetStartUpTime (void) |
| Gets the current startup time setting for the XOSC32K oscillator. | |
| void | OSC32KCTRL_XOSC32K_EnableLowPowerMode (void) |
| Enables Low Power mode for the XOSC32K oscillator. | |
| void | OSC32KCTRL_XOSC32K_DisableLowPowerMode (void) |
| Disables Low Power mode for the XOSC32K oscillator. | |
| bool | OSC32KCTRL_XOSC32K_LowPowerIsEnabled (void) |
| Reads the Low Power mode status of the XOSC32K oscillator. | |
| void | OSC32KCTRL_CFD_Enable (void) |
| Enables the Clock Failure Detection (CFD) feature for XOSC32K. Make sure the XOSC32K oscillator is disabled before calling this function. Not following this guideline can lead to a false clock failure detection. | |
| void | OSC32KCTRL_CFD_Disable (void) |
| Disables the Clock Failure Detection (CFD) feature. | |
| bool | OSC32KCTRL_CFD_GetClockFailureStatus (void) |
| Reads the clock failure status. | |
| void | OSC32KCTRL_CFD_EnableEventOutput (void) |
| Enables the clock failure event output for CFD. | |
| void | OSC32KCTRL_CFD_DisableEventOutput (void) |
| Disabled the clock failure event output for CFD. | |
| bool | OSC32KCTRL_CFD_ClockIsSwitched (void) |
| Gets the switch back status for CFD. | |
| void | OSC32KCTRL_CFD_SetSwitchBack (void) |
| Sets the switch back for CFD if CFD is enabled. | |
| bool | OSC32KCTRL_CFD_GetSwitchBack (void) |
| Returns the status of the switch back field in CFDCTRL. | |
| void | OSC32KCTRL_CFD_SetOsc32kPrescaler (OSC32K_CFD_PRESCALER prescaler) |
| Sets the OSC32K prescaler for CFD. | |
| uint32_t | OSC32KCTRL_CFD_GetOsc32kPrescaler (void) |
| Gets the current OSC32K prescaler setting 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_InterruptIsEnabled (OSC32KCTRL_IRQ_SOURCE irq_source) |
| Reads the interrupt enable status for the specified OSC32KCTRL interrupt source. | |
| void | OSC32KCTRL_SetReadyFlag (OSC32KCTRL_IRQ_SOURCE irq_source) |
| Sets the ready flag for the specified OSC32KCTRL interrupt source. | |
| bool | OSC32KCTRL_IntFlagSetIsEnabled (OSC32KCTRL_IRQ_SOURCE irq_source) |
| Reads the INTFLAGSET register for 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_EnableWriteProtection (void) |
| Enables write protection for the OSC32KCTRL peripheral. | |
| void | OSC32KCTRL_DisableWriteProtection (void) |
| Disables write protection for the OSC32KCTRL peripheral. | |
| bool | OSC32KCTRL_WriteProtectionIsEnabled (void) |
| Reads the current write protection status for the OSC32KCTRL peripheral. | |
| void | OSC32KCTRL_WPCTRL_EnableWriteLock (void) |
| Enables the write lock for the OSC32KCTRL write protection register. | |
| void | OSC32KCTRL_SetCallbackHandler (OSC32KCTRL_CALLBACK callback) |
| Registers a callback function for OSC32KCTRL interrupt events. | |
Driver API for OSC32KCTRL (plib_osc32kctrl.h)
| #define OSC32KCTRL_WP_KEY (0x4F5343U) |
Write Protection Key (device-specific, example value)
| typedef void(* OSC32KCTRL_CALLBACK) (OSC32KCTRL_IRQ_SOURCE source) |
Callback function type for OSC32KCTRL events.
| source | Interrupt source |
| enum OSC32K_CFD_PRESCALER |
| enum OSC32KCTRL_CSUT |
| enum OSC32KCTRL_RTC_CLOCK |
| bool OSC32KCTRL_CFD_ClockIsSwitched | ( | void | ) |
Gets the switch back status for CFD.
| None. |
| void OSC32KCTRL_CFD_Disable | ( | void | ) |
Disables the Clock Failure Detection (CFD) feature.
| None. |
| void OSC32KCTRL_CFD_DisableEventOutput | ( | void | ) |
Disabled the clock failure event output for CFD.
| None. |
| void OSC32KCTRL_CFD_Enable | ( | void | ) |
Enables the Clock Failure Detection (CFD) feature for XOSC32K. Make sure the XOSC32K oscillator is disabled before calling this function. Not following this guideline can lead to a false clock failure detection.
| None. |
| void OSC32KCTRL_CFD_EnableEventOutput | ( | void | ) |
Enables the clock failure event output for CFD.
| None. |
| bool OSC32KCTRL_CFD_GetClockFailureStatus | ( | void | ) |
Reads the clock failure status.
| None. |
| uint32_t OSC32KCTRL_CFD_GetOsc32kPrescaler | ( | void | ) |
Gets the current OSC32K prescaler setting for CFD.
| None. |
| bool OSC32KCTRL_CFD_GetSwitchBack | ( | void | ) |
Returns the status of the switch back field in CFDCTRL.
| None. |
| void OSC32KCTRL_CFD_SetOsc32kPrescaler | ( | OSC32K_CFD_PRESCALER | prescaler | ) |
Sets the OSC32K prescaler for CFD.
| prescaler | The prescaler value to set (OSC32K_CFD_PRESCALER). |
| void OSC32KCTRL_CFD_SetSwitchBack | ( | void | ) |
Sets the switch back for CFD if CFD is enabled.
| 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_DisableWriteProtection | ( | void | ) |
Disables write protection for the OSC32KCTRL peripheral.
| None. |
| 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_EnableWriteProtection | ( | void | ) |
Enables write protection for the OSC32KCTRL peripheral.
| None. |
| 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). |
| bool OSC32KCTRL_InterruptIsEnabled | ( | OSC32KCTRL_IRQ_SOURCE | irq_source | ) |
Reads the interrupt enable status for the specified OSC32KCTRL interrupt source.
| irq_source | The interrupt source to check (OSC32KCTRL_IRQ_SOURCE). |
| bool OSC32KCTRL_IntFlagSetIsEnabled | ( | OSC32KCTRL_IRQ_SOURCE | irq_source | ) |
Reads the INTFLAGSET register for the specified OSC32KCTRL interrupt source.
| irq_source | The interrupt source to check (OSC32KCTRL_IRQ_SOURCE). |
| void OSC32KCTRL_OSC32K_DisableOnDemand | ( | void | ) |
Disables On-Demand mode for the OSC32K oscillator.
| None. |
| void OSC32KCTRL_OSC32K_EnableOnDemand | ( | void | ) |
Enables On-Demand mode for the OSC32K oscillator.
| None. |
| bool OSC32KCTRL_OSC32K_IsReady | ( | void | ) |
Checks if the OSC32K oscillator is ready.
| None. |
| bool OSC32KCTRL_OSC32K_OnDemandIsEnabled | ( | void | ) |
Reads the On-Demand mode status of the OSC32K oscillator.
| None. |
| uint32_t OSC32KCTRL_RTC_GetClockSource | ( | void | ) |
Gets the current RTC clock source selection.
| None. |
| void OSC32KCTRL_RTC_SelectClockSource | ( | OSC32KCTRL_RTC_CLOCK | rtc_sel | ) |
Sets the RTC clock source.
| rtc_sel | The clock source selection for the RTC. |
| 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_SetReadyFlag | ( | OSC32KCTRL_IRQ_SOURCE | irq_source | ) |
Sets the ready flag for the specified OSC32KCTRL interrupt source.
| irq_source | The interrupt source for which to set the ready flag (OSC32KCTRL_IRQ_SOURCE). |
| void OSC32KCTRL_WPCTRL_EnableWriteLock | ( | void | ) |
Enables the write lock for the OSC32KCTRL write protection register.
| None. |
| bool OSC32KCTRL_WriteProtectionIsEnabled | ( | void | ) |
Reads the current write protection status for the OSC32KCTRL peripheral.
| None. |
| void OSC32KCTRL_XOSC32K_Disable | ( | void | ) |
Disables the XOSC32K oscillator.
| None. |
| void OSC32KCTRL_XOSC32K_DisableLowPowerMode | ( | void | ) |
Disables Low Power mode for the XOSC32K oscillator.
| None. |
| void OSC32KCTRL_XOSC32K_DisableOnDemand | ( | void | ) |
Disables On-Demand mode for the XOSC32K oscillator.
| None. |
| void OSC32KCTRL_XOSC32K_Enable | ( | void | ) |
Enables the XOSC32K oscillator.
| None. |
| void OSC32KCTRL_XOSC32K_EnableLowPowerMode | ( | void | ) |
Enables Low Power mode for the XOSC32K oscillator.
| None. |
| void OSC32KCTRL_XOSC32K_EnableOnDemand | ( | void | ) |
Enables On-Demand mode for the XOSC32K oscillator.
| None. |
| uint32_t OSC32KCTRL_XOSC32K_GetStartUpTime | ( | void | ) |
Gets the current startup time setting for the XOSC32K oscillator.
| None. |
| bool OSC32KCTRL_XOSC32K_IsReady | ( | void | ) |
Checks if the XOSC32K oscillator is ready.
| None. |
| bool OSC32KCTRL_XOSC32K_LowPowerIsEnabled | ( | void | ) |
Reads the Low Power mode status of the XOSC32K oscillator.
| None. |
| bool OSC32KCTRL_XOSC32K_OnDemandIsEnabled | ( | void | ) |
Reads the On-Demand mode status of the XOSC32K oscillator.
| None. |
| void OSC32KCTRL_XOSC32K_SelectClockSource | ( | OSC32KCTRL_XTAL_SOURCE | xtal_source | ) |
Selects the external source for the XOSC32K oscillator.
| xtal_source | The external crystal or clock source selection for XOSC32K. |
| void OSC32KCTRL_XOSC32K_SetStartUpTime | ( | OSC32KCTRL_CSUT | startup_time | ) |
Sets the startup time for the XOSC32K oscillator.
| startup_time | The desired startup time (OSC32KCTRL_CSUT). |