Macros | Functions
PCM

Power Control Manager responsible for controlling the different power states of the device. More...

Macros

#define PCM_KEY   0x695A0000
 
#define PCM_AM_LDO_VCORE0   0x00
 
#define PCM_AM_LDO_VCORE1   0x01
 
#define PCM_AM_DCDC_VCORE0   0x04
 
#define PCM_AM_DCDC_VCORE1   0x05
 
#define PCM_AM_LF_VCORE0   0x08
 
#define PCM_AM_LF_VCORE1   0x09
 
#define PCM_LPM0_LDO_VCORE0   0x10
 
#define PCM_LPM0_LDO_VCORE1   0x11
 
#define PCM_LPM0_DCDC_VCORE0   0x14
 
#define PCM_LPM0_DCDC_VCORE1   0x15
 
#define PCM_LPM0_LF_VCORE0   0x18
 
#define PCM_LPM0_LF_VCORE1   0x19
 
#define PCM_LPM3   0x20
 
#define PCM_LPM4   0x21
 
#define PCM_LPM35_VCORE0   0xC0
 
#define PCM_LPM45   0xA0
 
#define PCM_VCORE0   0x00
 
#define PCM_VCORE1   0x01
 
#define PCM_VCORELPM3   0x02
 
#define PCM_LDO_MODE   0x00
 
#define PCM_DCDC_MODE   0x01
 
#define PCM_LF_MODE   0x02
 
#define PCM_SHUTDOWN_PARTIAL   PCM_LPM35_VCORE0
 
#define PCM_SHUTDOWN_COMPLETE   PCM_LPM45
 
#define PCM_DCDCERROR   PCM_IE_DCDC_ERROR_IE
 
#define PCM_AM_INVALIDTRANSITION   PCM_IE_AM_INVALID_TR_IE
 
#define PCM_SM_INVALIDCLOCK   PCM_IE_LPM_INVALID_CLK_IE
 
#define PCM_SM_INVALIDTRANSITION   PCM_IE_LPM_INVALID_TR_IE
 

Functions

bool PCM_setCoreVoltageLevel (uint_fast8_t voltageLevel)
 
uint8_t PCM_getCoreVoltageLevel (void)
 
bool PCM_setCoreVoltageLevelWithTimeout (uint_fast8_t voltageLevel, uint32_t timeOut)
 
bool PCM_setCoreVoltageLevelNonBlocking (uint_fast8_t voltageLevel)
 
bool PCM_setPowerMode (uint_fast8_t powerMode)
 
bool PCM_setPowerModeWithTimeout (uint_fast8_t powerMode, uint32_t timeOut)
 
bool PCM_setPowerModeNonBlocking (uint_fast8_t powerMode)
 
uint8_t PCM_getPowerMode (void)
 
bool PCM_setPowerState (uint_fast8_t powerState)
 
bool PCM_setPowerStateWithTimeout (uint_fast8_t powerState, uint32_t timeout)
 
uint8_t PCM_getPowerState (void)
 
bool PCM_setPowerStateNonBlocking (uint_fast8_t powerState)
 
bool PCM_shutdownDevice (uint32_t shutdownMode)
 
bool PCM_gotoLPM0 (void)
 
bool PCM_gotoLPM3 (void)
 
bool PCM_gotoLPM0InterruptSafe (void)
 
bool PCM_gotoLPM3InterruptSafe (void)
 
bool PCM_gotoLPM4 (void)
 
bool PCM_gotoLPM4InterruptSafe (void)
 
void PCM_enableRudeMode (void)
 
void PCM_disableRudeMode (void)
 
void PCM_enableInterrupt (uint32_t flags)
 
void PCM_disableInterrupt (uint32_t flags)
 
uint32_t PCM_getInterruptStatus (void)
 
uint32_t PCM_getEnabledInterruptStatus (void)
 
void PCM_clearInterruptFlag (uint32_t flags)
 
void PCM_registerInterrupt (void(*intHandler)(void))
 
void PCM_unregisterInterrupt (void)
 

Detailed Description

Power Control Manager responsible for controlling the different power states of the device.


PCM Module Operation


The Power Control Manager (PCM) module for DriverLib is meant to simplify the management of power states and provide a level of intelligence to users for switching between power states.


Switching States


One of the most useful features of the PCM module is the ability for the user to switch between power states without having to worry about the logic requirements of the state transitions. By using the PCM_setPowerState function, DriverLib will take in a parameter for the power state and automatically handle all of the state transitions. Say that the user wants to switch to use the DCDC converter with a voltage level of VCORE1 (PCM_AM_DCDC_VCORE1). Say that that same user is currently in the default mode of using the LDO with a voltage level of VCORE0 (PCM_AM_LDO_VCORE0). Normally, the user would have to take into account that there is a state transition that must happen to PCM_AM_LDO_VCORE1, however with the PCM_setPowerState API the user does not need to worry about this. The call to change the power state in this example would be:


Switching Modes/Levels


In addition to being able to switch between individual power states, the PCM DriverLib API module also gives the user the ability to switch between different power modes and levels. This gives the user a more granular approach to power management and allows for a more refined customization of the power driver.

For changing between power levels, the user will be able to switch back and forth between PCM_VCORE0 and PCM_VCORE1 using the PCM_setCoreVoltageLevel function. While using this function it is important to note that the underlying power mode will be preserved. For example, if PCM_setCoreVoltageLevel is called with the PCM_VCORE1 parameter while the devices is in PCM_AM_LDO_VCORE0 mode, the power state will be changed to PCM_AM_LDO_VCORE1. If the same API is called with the same parameter in PCM_AM_DCDC_VCORE0 mode, the power state will be changed to PCM_AM_DCDC_VCORE1 mode.

The same preservation logic also applies while switching between power modes. If the PCM_setPowerMode function is called with the PCM_DCDC_MODE parameter while the device is in PCM_AM_LDO_VCORE0 mode, the device will change to PCM_AM_DCDC_VCORE0 mode (leaving the voltage level unchanged).


Low Power Mode and State Retention


In addition to being able to manipulate individual states/modes/levels, APIs are also provided to simplify entry into the low power modes of MSP432.

Low Power Entry Functions:

When using these low power modes entry functions, it is important to note that the original state of the device before low power mode entry is retained. After the devices wakes up from low power mode, the original power mode is restored. For example, say that the device is in PCM_AM_DCDC_VCORE0 mode and then the user calls the PCM_gotoLPM3 API. Since MSP432 devices are not allowed to go into LMP3 while in a DCDC power mode, the API will have the intelligence to first change into PCM_AM_LDO_VCORE0 mode, and then go to LPM3. When the device wakes up, the API will automatically switch back to PCM_AM_DCDC_VCORE0 mode. If the user wants to go into DSL in the previous example without the state preservation, the PCM_setPowerState function should be used with the PCM_LPM3 parameter.


Enabling/Disabling Rude Mode


If the user calls a low power entry function that disables a clock source while an active peripheral is accessing the clock source, by default MSP432 will not allow the transition. This can be enabled/disabled by using the PCM_enableRudeMode and PCM_disableRudeMode functions respectively. By using these functions, the user can set the device to "force" its way into the low power mode by forcibly halting any dependent clock resource.

Programming Examples


The DriverLib package contains a variety of different code examples that demonstrate the usage of the PCM module. These code examples are accessible under the examples/ folder of the SDK release as well as through TI Resource Explorer if using Code Composer Studio. These code examples provide a comprehensive list of use cases as well as practical applications involving each module.

Below is a very brief code example showing how to change power levels with the PCM module. This is done in order to facilitate a higher frequency of 48Mhz. For a set of more detailed code examples, please refer to the code examples in the examples/ directory of the SDK release:

Macro Definition Documentation

#define PCM_KEY   0x695A0000
#define PCM_AM_LDO_VCORE0   0x00
#define PCM_AM_LDO_VCORE1   0x01
#define PCM_AM_DCDC_VCORE0   0x04
#define PCM_AM_DCDC_VCORE1   0x05
#define PCM_AM_LF_VCORE0   0x08
#define PCM_AM_LF_VCORE1   0x09
#define PCM_LPM0_LDO_VCORE0   0x10
#define PCM_LPM0_LDO_VCORE1   0x11
#define PCM_LPM0_DCDC_VCORE0   0x14
#define PCM_LPM0_DCDC_VCORE1   0x15
#define PCM_LPM0_LF_VCORE0   0x18
#define PCM_LPM0_LF_VCORE1   0x19
#define PCM_LPM3   0x20

Referenced by PCM_getCoreVoltageLevel().

#define PCM_LPM4   0x21
#define PCM_LPM35_VCORE0   0xC0
#define PCM_LPM45   0xA0

Referenced by PCM_shutdownDevice().

#define PCM_VCORE0   0x00

Referenced by PCM_getCoreVoltageLevel().

#define PCM_VCORE1   0x01

Referenced by PCM_getCoreVoltageLevel().

#define PCM_VCORELPM3   0x02

Referenced by PCM_getCoreVoltageLevel().

#define PCM_LDO_MODE   0x00

Referenced by PCM_getPowerMode(), and PCM_gotoLPM3().

#define PCM_DCDC_MODE   0x01

Referenced by PCM_getPowerMode(), and PCM_gotoLPM3().

#define PCM_LF_MODE   0x02

Referenced by PCM_getPowerMode().

#define PCM_SHUTDOWN_PARTIAL   PCM_LPM35_VCORE0

Referenced by PCM_shutdownDevice().

#define PCM_SHUTDOWN_COMPLETE   PCM_LPM45

Referenced by PCM_shutdownDevice().

#define PCM_DCDCERROR   PCM_IE_DCDC_ERROR_IE
#define PCM_AM_INVALIDTRANSITION   PCM_IE_AM_INVALID_TR_IE
#define PCM_SM_INVALIDCLOCK   PCM_IE_LPM_INVALID_CLK_IE
#define PCM_SM_INVALIDTRANSITION   PCM_IE_LPM_INVALID_TR_IE

Function Documentation

bool PCM_setCoreVoltageLevel ( uint_fast8_t  voltageLevel)

Sets the core voltage level (Vcore). The function will take care of all power state transitions needed to shift between core voltage levels. Because transitions between voltage levels may require changes power modes, the power mode might temporarily be change. The power mode will be returned to the original state (with the new voltage level) at the end of a successful execution of this function.

Refer to the device specific data sheet for specifics about core voltage levels.

Parameters
voltageLevelThe voltage level to be shifted to.
  • PCM_VCORE0,
  • PCM_VCORE1
Returns
true if voltage level set, false otherwise.
uint8_t PCM_getCoreVoltageLevel ( void  )

Returns the current powers state of the system see the PCM_setCoreVoltageLevel function for specific information about the modes.

Returns
The current voltage of the system

Possible return values include:

  • PCM_VCORE0
  • PCM_VCORE1
  • PCM_VCORELPM3

References ASSERT, PCM_AM_DCDC_VCORE0, PCM_AM_DCDC_VCORE1, PCM_AM_LDO_VCORE0, PCM_AM_LDO_VCORE1, PCM_AM_LF_VCORE0, PCM_AM_LF_VCORE1, PCM_getPowerState(), PCM_LPM0_DCDC_VCORE0, PCM_LPM0_DCDC_VCORE1, PCM_LPM0_LDO_VCORE0, PCM_LPM0_LDO_VCORE1, PCM_LPM0_LF_VCORE0, PCM_LPM0_LF_VCORE1, PCM_LPM3, PCM_VCORE0, PCM_VCORE1, and PCM_VCORELPM3.

bool PCM_setCoreVoltageLevelWithTimeout ( uint_fast8_t  voltageLevel,
uint32_t  timeOut 
)

Sets the core voltage level (Vcore). This function will take care of all power state transitions needed to shift between core voltage levels. Because transitions between voltage levels may require changes power modes, the power mode might temporarily be change. The power mode will be returned to the original state (with the new voltage level) at the end of a successful execution of this function.

This function is similar to PCMSetCoreVoltageLevel, however a timeout mechanism is used.

Refer to the device specific data sheet for specifics about core voltage levels.

Parameters
voltageLevelThe voltage level to be shifted to.
  • PCM_VCORE0,
  • PCM_VCORE1
timeOutNumber of loop iterations to timeout when checking for power state transitions. This should be used for debugging initial power/hardware configurations. After a stable hardware base is established, the PCMSetCoreVoltageLevel function should be used
Returns
true if voltage level set, false otherwise.
bool PCM_setCoreVoltageLevelNonBlocking ( uint_fast8_t  voltageLevel)

Sets the core voltage level (Vcore). This function is similar to PCM_setCoreVoltageLevel, however there are no polling flags to ensure a state has changed. Execution is returned back to the calling program correctly. For MSP432, changing into different power modes/states require very specific logic. This function will initiate only one state transition and then return. It is up to the user to keep calling this function until the correct power state has been achieved.

Refer to the device specific data sheet for specifics about core voltage levels.

Parameters
voltageLevelThe voltage level to be shifted to.
  • PCM_VCORE0,
  • PCM_VCORE1
Returns
true if voltage level set, false otherwise.
bool PCM_setPowerMode ( uint_fast8_t  powerMode)

Switches between power modes. This function will take care of all power state transitions needed to shift between power modes. Note for changing to DCDC mode, specific hardware considerations are required.

Refer to the device specific data sheet for specifics about power modes.

Parameters
powerModeThe voltage modes to be shifted to. Valid values are:
  • PCM_LDO_MODE,
  • PCM_DCDC_MODE,
  • PCM_LF_MODE
Returns
true if power mode is set, false otherwise.

Referenced by PCM_gotoLPM3().

bool PCM_setPowerModeWithTimeout ( uint_fast8_t  powerMode,
uint32_t  timeOut 
)

Switches between power modes. This function will take care of all power state transitions needed to shift between power modes. Note for changing to DCDC mode, specific hardware considerations are required.

This function is similar to PCMSetPowerMode, however a timeout mechanism is used.

Refer to the device specific data sheet for specifics about power modes.

Parameters
powerModeThe voltage modes to be shifted to. Valid values are:
  • PCM_LDO_MODE,
  • PCM_DCDC_MODE,
  • PCM_LF_MODE
timeOutNumber of loop iterations to timeout when checking for power state transitions. This should be used for debugging initial power/hardware configurations. After a stable hardware base is established, the PCMSetPowerMode function should be used
Returns
true if power mode is set, false otherwise.
bool PCM_setPowerModeNonBlocking ( uint_fast8_t  powerMode)

Sets the core voltage level (Vcore). This function is similar to PCM_setPowerMode, however there are no polling flags to ensure a state has changed. Execution is returned back to the calling program correctly. For MSP432, changing into different power modes/states require very specific logic. This function will initiate only one state transition and then return. It is up to the user to keep calling this function until the correct power state has been achieved.

Refer to the device specific data sheet for specifics about core voltage levels.

Parameters
powerModeThe voltage modes to be shifted to. Valid values are:
  • PCM_LDO_MODE,
  • PCM_DCDC_MODE,
  • PCM_LF_MODE
Returns
true if power mode change was initiated, false otherwise
uint8_t PCM_getPowerMode ( void  )

Returns the current powers state of the system see the PCM_setPowerState function for specific information about the modes.

Returns
The current power mode of the system

References ASSERT, PCM_AM_DCDC_VCORE0, PCM_AM_DCDC_VCORE1, PCM_AM_LDO_VCORE0, PCM_AM_LDO_VCORE1, PCM_AM_LF_VCORE0, PCM_AM_LF_VCORE1, PCM_DCDC_MODE, PCM_getPowerState(), PCM_LDO_MODE, PCM_LF_MODE, PCM_LPM0_DCDC_VCORE0, PCM_LPM0_DCDC_VCORE1, PCM_LPM0_LDO_VCORE0, PCM_LPM0_LDO_VCORE1, PCM_LPM0_LF_VCORE0, and PCM_LPM0_LF_VCORE1.

Referenced by PCM_gotoLPM3().

bool PCM_setPowerState ( uint_fast8_t  powerState)

Switches between power states. This is a convenience function that combines the functionality of PCM_setPowerMode and PCM_setCoreVoltageLevel as well as the LPM0/LPM3 functions.

Refer to the device specific data sheet for specifics about power states.

Parameters
powerStateThe voltage modes to be shifted to. Valid values are:
  • PCM_AM_LDO_VCORE0, [Active Mode, LDO, VCORE0]
  • PCM_AM_LDO_VCORE1, [Active Mode, LDO, VCORE1]
  • PCM_AM_DCDC_VCORE0, [Active Mode, DCDC, VCORE0]
  • PCM_AM_DCDC_VCORE1, [Active Mode, DCDC, VCORE1]
  • PCM_AM_LF_VCORE0, [Active Mode, Low Frequency, VCORE0]
  • PCM_AM_LF_VCORE1, [Active Mode, Low Frequency, VCORE1]
  • PCM_LPM0_LDO_VCORE0, [LMP0, LDO, VCORE0]
  • PCM_LPM0_LDO_VCORE1, [LMP0, LDO, VCORE1]
  • PCM_LPM0_DCDC_VCORE0, [LMP0, DCDC, VCORE0]
  • PCM_LPM0_DCDC_VCORE1, [LMP0, DCDC, VCORE1]
  • PCM_LPM0_LF_VCORE0, [LMP0, Low Frequency, VCORE0]
  • PCM_LPM0_LF_VCORE1, [LMP0, Low Frequency, VCORE1]
  • PCM_LPM3, [LPM3]
  • PCM_LPM35_VCORE0, [LPM3.5 VCORE 0]
  • PCM_LPM4, [LPM4]
  • PCM_LPM45, [LPM4.5]
Returns
true if power state is set, false otherwise.

Referenced by PCM_gotoLPM3().

bool PCM_setPowerStateWithTimeout ( uint_fast8_t  powerState,
uint32_t  timeout 
)

Switches between power states. This is a convenience function that combines the functionality of PCM_setPowerMode and PCM_setCoreVoltageLevel as well as the LPM modes.

This function is similar to PCM_setPowerState, however a timeout mechanism is used.

Refer to the device specific data sheet for specifics about power states.

Parameters
powerStateThe voltage modes to be shifted to. Valid values are:
  • PCM_AM_LDO_VCORE0, [Active Mode, LDO, VCORE0]
  • PCM_AM_LDO_VCORE1, [Active Mode, LDO, VCORE1]
  • PCM_AM_DCDC_VCORE0, [Active Mode, DCDC, VCORE0]
  • PCM_AM_DCDC_VCORE1, [Active Mode, DCDC, VCORE1]
  • PCM_AM_LF_VCORE0, [Active Mode, Low Frequency, VCORE0]
  • PCM_AM_LF_VCORE1, [Active Mode, Low Frequency, VCORE1]
  • PCM_LPM0_LDO_VCORE0, [LMP0, LDO, VCORE0]
  • PCM_LPM0_LDO_VCORE1, [LMP0, LDO, VCORE1]
  • PCM_LPM0_DCDC_VCORE0, [LMP0, DCDC, VCORE0]
  • PCM_LPM0_DCDC_VCORE1, [LMP0, DCDC, VCORE1]
  • PCM_LPM0_LF_VCORE0, [LMP0, Low Frequency, VCORE0]
  • PCM_LPM0_LF_VCORE1, [LMP0, Low Frequency, VCORE1]
  • PCM_LPM3, [LPM3]
  • PCM_LPM35_VCORE0, [LPM3.5 VCORE 0]
  • PCM_LPM4, [LPM4]
  • PCM_LPM45, [LPM4.5]
timeoutNumber of loop iterations to timeout when checking for power state transitions. This should be used for debugging initial power/hardware configurations. After a stable hardware base is established, the PCMSetPowerMode function should be used
Returns
true if power state is set, false otherwise. It is important to note that if a timeout occurs, false will be returned, however the power state at this point is not guaranteed to be the same as the state prior to the function call
uint8_t PCM_getPowerState ( void  )

Returns the current powers state of the system see the PCMChangePowerState function for specific information about the states.

Refer to PCM_setPowerState for possible return values.

Returns
The current power state of the system

Referenced by PCM_getCoreVoltageLevel(), PCM_getPowerMode(), and PCM_gotoLPM3().

bool PCM_setPowerStateNonBlocking ( uint_fast8_t  powerState)

Sets the power state of the part. This function is similar to PCM_getPowerState, however there are no polling flags to ensure a state has changed. Execution is returned back to the calling program correctly. For MSP432, changing into different power modes/states require very specific logic. This function will initiate only one state transition and then return. It is up to the user to keep calling this function until the correct power state has been achieved.

Refer to the device specific data sheet for specifics about core voltage levels.

Parameters
powerStateThe voltage modes to be shifted to. Valid values are:
  • PCM_AM_LDO_VCORE0, [Active Mode, LDO, VCORE0]
  • PCM_AM_LDO_VCORE1, [Active Mode, LDO, VCORE1]
  • PCM_AM_DCDC_VCORE0, [Active Mode, DCDC, VCORE0]
  • PCM_AM_DCDC_VCORE1, [Active Mode, DCDC, VCORE1]
  • PCM_AM_LF_VCORE0, [Active Mode, Low Frequency, VCORE0]
  • PCM_AM_LF_VCORE1, [Active Mode, Low Frequency, VCORE1]
  • PCM_LPM0_LDO_VCORE0, [LMP0, LDO, VCORE0]
  • PCM_LPM0_LDO_VCORE1, [LMP0, LDO, VCORE1]
  • PCM_LPM0_DCDC_VCORE0, [LMP0, DCDC, VCORE0]
  • PCM_LPM0_DCDC_VCORE1, [LMP0, DCDC, VCORE1]
  • PCM_LPM0_LF_VCORE0, [LMP0, Low Frequency, VCORE0]
  • PCM_LPM0_LF_VCORE1, [LMP0, Low Frequency, VCORE1]
  • PCM_LPM3, [LPM3]
  • PCM_LPM35_VCORE0, [LPM3.5 VCORE 0]
  • PCM_LPM45, [LPM4.5]
Returns
true if power state change was initiated, false otherwise
bool PCM_shutdownDevice ( uint32_t  shutdownMode)

Transitions the device into LPM3.5/LPM4.5 mode.

Refer to the device specific data sheet for specifics about shutdown modes.

The following events will cause a wake up from LPM3.5 mode:

  • Device reset
  • External reset RST
  • Enabled RTC, WDT, and wake-up I/O only interrupt events

The following events will cause a wake up from the LPM4.5 mode:

  • Device reset
  • External reset RST
  • Wake-up I/O only interrupt events
Parameters
shutdownModeSpecific mode to go to. Valid values are:
  • PCM_LPM35_VCORE0
  • PCM_LPM45
Returns
false if LPM state cannot be entered, true otherwise.

References ASSERT, CPU_wfi(), PCM_KEY, PCM_LPM45, PCM_SHUTDOWN_COMPLETE, and PCM_SHUTDOWN_PARTIAL.

bool PCM_gotoLPM0 ( void  )

Transitions the device into LPM0.

Refer to the device specific data sheet for specifics about low power modes.

Returns
false if LPM0 state cannot be entered, true otherwise.

References CPU_wfi().

Referenced by PCM_gotoLPM0InterruptSafe().

bool PCM_gotoLPM3 ( void  )

Transitions the device into LPM3

Refer to the device specific data sheet for specifics about low power modes. Note that since LPM3 cannot be entered from a DCDC power modes, the power mode is first switched to LDO operation (if in DCDC mode), LPM3 is entered, and the DCDC mode is restored on wake up.

Returns
false if LPM3 state cannot be entered, true otherwise.

References CPU_wfi(), PCM_DCDC_MODE, PCM_getPowerMode(), PCM_getPowerState(), PCM_KEY, PCM_LDO_MODE, PCM_setPowerMode(), and PCM_setPowerState().

Referenced by PCM_gotoLPM3InterruptSafe(), and PCM_gotoLPM4().

bool PCM_gotoLPM0InterruptSafe ( void  )

Transitions the device into LPM0 while maintaining a safe interrupt handling mentality. This function is meant to be used in situations where the user wants to go to LPM0, however does not want to go to "miss" any interrupts due to the fact that going to LPM0 is not an atomic operation. This function will modify the PRIMASK and on exit of the program the master interrupts will be disabled.

Refer to the device specific data sheet for specifics about low power modes.

Returns
false if LPM0 state cannot be entered, true otherwise.

References Interrupt_disableMaster(), Interrupt_enableMaster(), and PCM_gotoLPM0().

bool PCM_gotoLPM3InterruptSafe ( void  )

Transitions the device into LPM3 while maintaining a safe interrupt handling mentality. This function is meant to be used in situations where the user wants to go to LPM3, however does not want to go to "miss" any interrupts due to the fact that going to LPM3 is not an atomic operation. This function will modify the PRIMASK and on exit of the program the master interrupts will be disabled.

Refer to the device specific data sheet for specifics about low power modes. Note that since LPM3 cannot be entered from a DCDC power modes, the power mode is first switched to LDO operation (if in DCDC mode), the LPM3 is entered, and the DCDC mode is restored on wake up.

Returns
false if LPM3 cannot be entered, true otherwise.

References Interrupt_disableMaster(), Interrupt_enableMaster(), and PCM_gotoLPM3().

bool PCM_gotoLPM4 ( void  )

Transitions the device into LPM4. LPM4 is the exact same with LPM3, just with RTC_C and WDT_A disabled. When waking up, RTC_C and WDT_A will remain disabled until reconfigured by the user.

Returns
false if LPM4 state cannot be entered, true otherwise.

References PCM_gotoLPM3(), RTC_C_holdClock(), and WDT_A_holdTimer().

Referenced by PCM_gotoLPM4InterruptSafe().

bool PCM_gotoLPM4InterruptSafe ( void  )

Transitions the device into LPM4 while maintaining a safe interrupt handling mentality. This function is meant to be used in situations where the user wants to go to LPM4, however does not want to go to "miss" any interrupts due to the fact that going to LPM4 is not an atomic operation. This function will modify the PRIMASK and on exit of the program the master interrupts will be disabled.

Refer to the device specific data sheet for specifics about low power modes. Note that since LPM3 cannot be entered from a DCDC power modes, the power mode is first switched to LDO operation (if in DCDC mode), LPM4 is entered, and the DCDC mode is restored on wake up.

Returns
false if LPM4 state cannot be entered, true otherwise.

References Interrupt_disableMaster(), Interrupt_enableMaster(), and PCM_gotoLPM4().

void PCM_enableRudeMode ( void  )

Enables "rude mode" entry into LPM3 and shutdown modes. With this mode enabled, an entry into shutdown or LPM3 will occur even if there are clock systems active. The system will forcibly turn off all clock/systems when going into these modes.

Returns
None

References PCM_KEY.

void PCM_disableRudeMode ( void  )

Disables "rude mode" entry into LPM3 and shutdown modes. With this mode disabled, an entry into shutdown or LPM3 will wait for any active clock requests to free up before going into LPM3 or shutdown.

Returns
None

References PCM_KEY.

void PCM_enableInterrupt ( uint32_t  flags)

Enables individual power control interrupt sources.

Parameters
flagsis a bit mask of the interrupt sources to be enabled. Must be a logical OR of:
  • PCM_DCDCERROR,
  • PCM_AM_INVALIDTRANSITION,
  • PCM_SM_INVALIDCLOCK,
  • PCM_SM_INVALIDTRANSITION

This function enables the indicated power control interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

Note
The interrupt sources vary based on the part in use. Please consult the data sheet for the part you are using to determine which interrupt sources are available.
Returns
None.
void PCM_disableInterrupt ( uint32_t  flags)

Disables individual power control interrupt sources.

Parameters
flagsis a bit mask of the interrupt sources to be enabled. Must be a logical OR of:
  • PCM_DCDCERROR,
  • PCM_AM_INVALIDTRANSITION,
  • PCM_SM_INVALIDCLOCK,
  • PCM_SM_INVALIDTRANSITION

This function disables the indicated power control interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

Note
The interrupt sources vary based on the part in use. Please consult the data sheet for the part you are using to determine which interrupt sources are available.
Returns
None.
uint32_t PCM_getInterruptStatus ( void  )

Gets the current interrupt status.

Returns
The current interrupt status, enumerated as a bit field of:
  • PCM_DCDCERROR,
  • PCM_AM_INVALIDTRANSITION,
  • PCM_SM_INVALIDCLOCK,
  • PCM_SM_INVALIDTRANSITION
Note
The interrupt sources vary based on the part in use. Please consult the data sheet for the part you are using to determine which interrupt sources are available.

Referenced by PCM_getEnabledInterruptStatus().

uint32_t PCM_getEnabledInterruptStatus ( void  )

Gets the current interrupt status masked with the enabled interrupts. This function is useful to call in ISRs to get a list of pending interrupts that are actually enabled and could have caused the ISR.

Returns
The current interrupt status, enumerated as a bit field of:
  • PCM_DCDCERROR,
  • PCM_AM_INVALIDTRANSITION,
  • PCM_SM_INVALIDCLOCK,
  • PCM_SM_INVALIDTRANSITION
Note
The interrupt sources vary based on the part in use. Please consult the data sheet for the part you are using to determine which interrupt sources are available.

References PCM_getInterruptStatus().

void PCM_clearInterruptFlag ( uint32_t  flags)

Clears power system interrupt sources.

The specified power system interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep it from being called again immediately upon exit.

Note
Because there is a write buffer in the Cortex-M processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (because the interrupt controller still sees the interrupt source asserted).
Parameters
flagsis a bit mask of the interrupt sources to be cleared. Must be a logical OR of
  • PCM_DCDCERROR,
  • PCM_AM_INVALIDTRANSITION,
  • PCM_SM_INVALIDCLOCK,
  • PCM_SM_INVALIDTRANSITION
Note
The interrupt sources vary based on the part in use. Please consult the data sheet for the part you are using to determine which interrupt sources are available.
Returns
None.
void PCM_registerInterrupt ( void(*)(void)  intHandler)

Registers an interrupt handler for the power system interrupt.

Parameters
intHandleris a pointer to the function to be called when the power system interrupt occurs.

This function registers the handler to be called when a clock system interrupt occurs. This function enables the global interrupt in the interrupt controller; specific PCM interrupts must be enabled via PCM_enableInterrupt(). It is the interrupt handler's responsibility to clear the interrupt source via PCM_clearInterruptFlag .

See Also
Interrupt_registerInterrupt() for important information about registering interrupt handlers.
Returns
None.

References INT_PCM, Interrupt_enableInterrupt(), and Interrupt_registerInterrupt().

void PCM_unregisterInterrupt ( void  )

Unregisters the interrupt handler for the power system.

This function unregisters the handler to be called when a power system interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.

See Also
Interrupt_registerInterrupt() for important information about registering interrupt handlers.
Returns
None.

References INT_PCM, Interrupt_disableInterrupt(), and Interrupt_unregisterInterrupt().


Copyright 2018, Texas Instruments Incorporated