![]() |
NHS31xx SW API
|
The Power Management Unit driver (PMU) provides the API to control all the functionalities handled by the PMU HW block. The PMU driver allows controlling the:
true
as argument, andData Structures | |
struct | NSS_PMU_T |
Enumerations | |
enum | PMU_DPD_WAKEUPREASON_T { PMU_DPD_WAKEUPREASON_RTC = 1, PMU_DPD_WAKEUPREASON_NFCPOWER = 2, PMU_DPD_WAKEUPREASON_WAKEUPPIN = 3, PMU_DPD_WAKEUPREASON_NONE = 0xFF } |
enum | PMU_RTC_CLOCKSOURCE_T { PMU_RTC_CLOCKSOURCE_NONE = 0, PMU_RTC_CLOCKSOURCE_TFRO = 1 } |
enum | PMU_INT_T { PMU_INT_BROWNOUT = (1 << 0), PMU_INT_NFCPOWER = (1 << 1), PMU_INT_NONE = 0, PMU_INT_ALL = 0x3 } |
enum | PMU_STATUS_T { PMU_STATUS_BROWNOUT = (1 << 5), PMU_STATUS_VDD_NFC = (1 << 7) } |
struct NSS_PMU_T |
NSS Power Management Unit register block structure
Data Fields | ||
---|---|---|
__IO uint32_t | PCON |
Power control Register |
__IO uint32_t | GPREG[5] |
General purpose Registers 0..4 |
__I uint32_t | PSTAT |
Power Management Unit status register |
__I uint32_t | RESERVED1 | |
__I uint32_t | ACCSTAT |
Access status register |
__IO uint32_t | LDO1V6 |
Analog 1.6V LDO trimming |
__I uint32_t | RESERVED2 | |
__IO uint32_t | TMRCLKCTRL |
Timer clock control register |
__IO uint32_t | IMSC |
Interrupt mask set and clear register |
__I uint32_t | RIS |
Raw interrupt status register |
__I uint32_t | MIS |
Masked interrupt status register |
__O uint32_t | ICR |
Interrupt clear register |
Possible reasons for waking up from Deep power down
enum PMU_INT_T |
enum PMU_STATUS_T |
void Chip_PMU_PowerMode_EnterSleep | ( | void | ) |
Sets the chip into Sleep power mode.
void Chip_PMU_PowerMode_EnterDeepSleep | ( | void | ) |
Sets the chip into Deep Sleep power mode.
void Chip_PMU_PowerMode_EnterDeepPowerDown | ( | bool | enableSwitching | ) |
Attempts to put the chip into Deep power down power mode.
enableSwitching | : Enables/Disables the automatic switching mechanism before entering Deep power down. |
enableSwitching
to 'true' has impact on power consumption during Deep power down. See Power Source switches chapter. PMU_DPD_WAKEUPREASON_T Chip_PMU_PowerMode_GetDPDWakeupReason | ( | void | ) |
Retrieves the reason for the last wakeup from Deep power down.
bool Chip_PMU_Switch_GetVDDBat | ( | void | ) |
Gets the status of the VDDBAT pin power source switch
bool Chip_PMU_Switch_GetVNFC | ( | void | ) |
Gets the status of the VNFC power source switch
void Chip_PMU_Switch_OpenVDDBat | ( | void | ) |
Forces the VDDBAT switch to its initial open state
void Chip_PMU_SetBODEnabled | ( | bool | enabled | ) |
Enables/Disables the Brown-Out detection
enabled | : If set to true enables the BOD, otherwise it disables it |
bool Chip_PMU_GetBODEnabled | ( | void | ) |
Gets the Brown-Out detection enabled status
void Chip_PMU_SetWakeupPinEnabled | ( | bool | enabled | ) |
Enables/Disables the wakeup pin functionality
enabled | : If set to true enables the wakeup pin functionality, otherwise it disables it |
bool Chip_PMU_GetWakeupPinEnabled | ( | void | ) |
Gets the wakeup pin functionality enabled status
void Chip_PMU_SetRTCClockSource | ( | PMU_RTC_CLOCKSOURCE_T | source | ) |
Sets the RTC block clock source. As there is only one possible source, this function effectively allows you to disable all RTC functionality. Gating the clock by providing PMU_RTC_CLOCKSOURCE_NONE as value for source
will disable both the up and the down counter in the RTC, i.e. will disable the calendaring functionality (it becomes impossible to keep track of absolute time) and the wake-up possibility from Deep Power Down mode after a configured number of seconds. Gating the clock for the RTC will save a modest amount of power (in the order of 20 nA).
source | : see PMU_DPD_WAKEUPREASON_T |
PMU_RTC_CLOCKSOURCE_T Chip_PMU_GetRTCClockSource | ( | void | ) |
Gets the RTC block clock source.
void Chip_PMU_SetRetainedData | ( | uint32_t * | pData, |
int | offset, | ||
int | size | ||
) |
Sets the required data words into the retained data section of the PMU
pData | : A pointer to the data words to be set |
offset | : The offset, in number of words, to where to set the first word |
size | : The size, in words, of the data to set |
void Chip_PMU_GetRetainedData | ( | uint32_t * | pData, |
int | offset, | ||
int | size | ||
) |
Gets the required data words stored in the retained data section of the PMU
pData | : A pointer to where to place the retrieved data words |
offset | : The offset, in number of words, to where to get the first word from |
size | : The size, in words, of the data to get |
PMU_STATUS_T Chip_PMU_GetStatus | ( | void | ) |
Returns the status information from the PMU block
void Chip_PMU_Int_SetEnabledMask | ( | PMU_INT_T | mask | ) |
Enables/Disables the PMU interrupts
mask | : interrupt enabled mask to set |
PMU_INT_T Chip_PMU_Int_GetEnabledMask | ( | void | ) |
Retrieves the PMU interrupt enabled mask
PMU_INT_T Chip_PMU_Int_GetRawStatus | ( | void | ) |
Retrieves a bitVector with the RAW PMU interrupt flags
void Chip_PMU_Int_ClearRawStatus | ( | PMU_INT_T | flags | ) |
Clears the required PMU interrupt flags
flags | : Bitvector indicating which interrupt flags to clear |
void Chip_PMU_SetAutoPowerEnabled | ( | bool | enabled | ) |
Enables/Disables automatic power supply switching between Vbat and NFC power
enabled | : If set to true enables the automatic switch-over, if false power is taken from VBAT exclusively. |
bool Chip_PMU_GetAutoPowerEnabled | ( | void | ) |
Gets the automatic power supply switching enabled status
true
the automatic switch-over is enabled, otherwise it is fixed to VBAT power.