54 #include <adi_callback.h> 55 #include <adi_processor.h> 66 #pragma diag_suppress=Pm009,Pm011 115 #if defined(__ADUCM4x50__) 117 ADI_CLOCK_MUX_SPLL_GPIO,
235 #if defined(__ADUCM4x50__) 237 ADI_CLOCK_GATE_TMR_RGB_CLK = 1 << BITP_CLKG_CLK_CTL5_TMRRGBCLKOFF
242 #if defined(__ADUCM4x50__) 249 ADI_PWR_HFOSC_DIV_BY_1,
251 ADI_PWR_HFOSC_DIV_BY_2,
253 ADI_PWR_HFOSC_DIV_BY_4,
255 ADI_PWR_HFOSC_DIV_BY_8,
257 ADI_PWR_HFOSC_DIV_BY_16,
259 ADI_PWR_HFOSC_DIV_BY_32
334 #if defined(__ADUCM4x50__) 336 ADI_PWR_ROOT_CLOCK_MON_IEN = 1 << BITP_CLKG_OSC_CTL_ROOT_MON_EN,
345 #elif defined(__ADUCM302x__) 347 ADI_PWR_LFXTAL_CLOCK_MON_IEN = 1 << BITP_CLKG_OSC_CTL_LFXTAL_MON_EN,
349 ADI_PWR_LFXTAL_STATUS_IEN = 1 << BITP_CLKG_CLK_CTL0_LFXTALIE,
351 ADI_PWR_HFXTAL_STATUS_IEN = 1 << BITP_CLKG_CLK_CTL0_HFXTALIE,
353 ADI_PWR_PLL_STATUS_IEN = 1 << BITP_CLKG_CLK_CTL3_SPLLIE
371 #if defined(__ADUCM4x50__) 373 ADI_PWR_EVENT_BATTERY_VOLTAGE_RANGE_1,
375 ADI_PWR_EVENT_BATTERY_VOLTAGE_RANGE_2,
377 ADI_PWR_EVENT_BATTERY_VOLTAGE_RANGE_3,
380 ADI_PWR_EVENT_OSC_LFXTAL_AUTO_SWITCH,
382 ADI_PWR_EVENT_OSC_LFXTAL_MON_FAIL,
384 ADI_PWR_EVENT_OSC_ROOT_CLOCK_MON_FAIL,
386 ADI_PWR_EVENT_OSC_ROOT_CLOCK_FAIL_AUTO_SWITCH,
435 #if defined(__ADUCM4x50__) 444 ADI_PWR_HPBUCK_LD_MODE_LOW,
448 ADI_PWR_HPBUCK_LD_MODE_HIGH
450 }ADI_PWR_HPBUCK_LD_MODE;
475 const uint32_t ExtClkFreq
482 const ADI_CLOCK_MUX_ID eClockID
489 const ADI_CLOCK_MUX_ID eClockID
496 const ADI_CLOCK_MUX_ID eClockID
499 #if defined(__ADUCM4x50__) 503 ADI_PWR_RESULT adi_pwr_EnableLFXTALFailAutoSwitch(
512 ADI_PWR_RESULT adi_pwr_EnableRootClockFailAutoSwitch(
519 ADI_PWR_RESULT adi_pwr_SetHFOscDivFactor(
520 const ADI_PWR_HFOSC_DIV eDivFactor
526 ADI_PWR_RESULT adi_pwr_EnableHFOscAutoDivBy1(
538 const ADI_CLOCK_MUX_ID eClockID
552 const ADI_CLOCK_ID eClockId,
559 const ADI_CLOCK_GATE eClockGate,
567 const ADI_CLOCK_SOURCE_ID eClockSource,
574 const ADI_CLOCK_ID eClockId,
581 const ADI_CLOCK_SOURCE_ID eClockSource,
582 ADI_CLOCK_SOURCE_STATUS *peStatus
589 const uint8_t nMulFactor,
596 const ADI_PWR_CLOCK_IRQ eIrq,
613 const ADI_PWR_PMG_IRQ eIrq,
621 ADI_PWR_WAKEUP_STATUS *peStatus
628 const ADI_PWR_VOLTAGE_RANGE eRange
635 const ADI_PWR_POWER_MODE PowerMode,
636 uint32_t
volatile * pnInterruptOccurred,
637 const uint8_t PriorityMask
644 uint32_t
volatile * pnInterruptOccurred
652 #if defined(__ADUCM4x50__) 655 ADI_PWR_RESULT adi_pwr_SetGPIOClockOutput(
656 const ADI_CLOCK_OUTPUT_ID eClockOutput
661 ADI_PWR_RESULT adi_pwr_EnableHPBuckLowPowerMode(
666 ADI_PWR_RESULT adi_pwr_SetHPBuckLoadMode(
667 const ADI_PWR_HPBUCK_LD_MODE eLoadMode
675 const ADI_CALLBACK pfCallback,
ADI_PWR_RESULT adi_pwr_SetClockDivider(const ADI_CLOCK_ID eClockId, const uint16_t nDiv)
Sets the clock divide factor for an individual clock group.
ADI_PWR_RESULT adi_pwr_SetVoltageRange(const ADI_PWR_VOLTAGE_RANGE eRange)
To Monitor voltage range of battery.
ADI_PWR_RESULT adi_pwr_SetPLLClockMux(const ADI_CLOCK_MUX_ID eClockID)
Sets the input clock source for PLL multiplexer.
ADI_PWR_RESULT adi_pwr_EnablePMGInterrupt(const ADI_PWR_PMG_IRQ eIrq, const bool bEnable)
Enable/Disable the power management interrupt.
ADI_PWR_RESULT adi_pwr_UpdateCoreClock(void)
Updates the internal SystemCoreClock variable with current core Clock retrieved from cpu registers...
ADI_PWR_RESULT adi_pwr_EnableHPBuck(const bool bEnable)
Enables or disables the HP Buck.
ADI_PWR_RESULT adi_pwr_SetPll(uint8_t nDivFactor, const uint8_t nMulFactor, const bool bDiv2, const bool bMul2)
Program PLL frequency.
ADI_PWR_RESULT adi_pwr_EnableClockSource(const ADI_CLOCK_SOURCE_ID eClockSource, const bool bEnable)
To Enable/disable clock sources.
ADI_PWR_RESULT adi_pwr_EnterLowPowerMode(const ADI_PWR_POWER_MODE PowerMode, uint32_t volatile *pnInterruptOccurred, const uint8_t PriorityMask)
Puts the processor into given low power mode.
ADI_PWR_RESULT adi_pwr_ExitLowPowerMode(uint32_t volatile *pnInterruptOccurred)
ADI_PWR_RESULT adi_pwr_GetExtClkFreq(uint32_t *pExtClock)
Gets the system external clock frequency. Gets the clock frequency of the source connected to the ext...
ADI_PWR_RESULT adi_pwr_EnableClockInterrupt(const ADI_PWR_CLOCK_IRQ eIrq, const bool bEnable)
Enable/Disable the clock interrupt to monitor status of LFXTAL, HFXTAL and PLL.
ADI_PWR_RESULT adi_pwr_RegisterCallback(const ADI_CALLBACK pfCallback, void *pcbParam)
Registers or unregister the callback function.
ADI_PWR_RESULT adi_pwr_EnableClock(const ADI_CLOCK_GATE eClockGate, const bool bEnable)
Enable/disable individual peripheral clocks.
ADI_PWR_RESULT adi_pwr_EnableLFXTALBypass(const bool bEnable)
Enable/disable LFXTAL bypass mode.
ADI_PWR_RESULT adi_pwr_GetClockFrequency(const ADI_CLOCK_ID eClockId, uint32_t *pClock)
Get the frequency of the given clock. Obtain individual peripheral clock frequencies.
ADI_PWR_RESULT adi_pwr_SetExtClkFreq(const uint32_t ExtClkFreq)
Sets the system external clock frequency.
ADI_PWR_RESULT adi_pwr_SetRootClockMux(const ADI_CLOCK_MUX_ID eClockID)
Sets the source for the root clock multiplexer.
ADI_PWR_RESULT adi_pwr_SetRefClockMux(const ADI_CLOCK_MUX_ID eClockID)
Sets clock source for the Reference clock multiplexer.
ADI_PWR_RESULT adi_pwr_GetWakeUpStatus(ADI_PWR_WAKEUP_STATUS *peStatus)
Function to retrieve the wakeup from shut down mode status.
ADI_PWR_RESULT adi_pwr_GetClockStatus(const ADI_CLOCK_SOURCE_ID eClockSource, ADI_CLOCK_SOURCE_STATUS *peStatus)
Return the status of a clock source.
ADI_PWR_RESULT adi_pwr_Init(void)
ADI_PWR_RESULT adi_pwr_SetLFClockMux(const ADI_CLOCK_MUX_ID eClockID)
Sets the input clock for low frequency clock multiplexer.