CMSIS-Driver_PIC32CM-PL  
Peripheral Library (PLIB) Documentation
 
Loading...
Searching...
No Matches
PM Interface

Driver API for PM (plib_pm.h) More...

Functions

void PM_EnterIdleSleepMode (void)
 Configures the Power Manager to enter Idle sleep mode and executes the WFI instruction.
 
void PM_EnterStandbySleepMode (void)
 Configures the Power Manager to enter Standby sleep mode and executes the WFI instruction.
 
void PM_EnableWriteProtection (void)
 Enable Write Protection for Power Manager registers. Sets the write protection enable bit in the Power Manager Write Protection Control register. Write protection is enabled on PM registers with the Local Write-Protection property.
 
void PM_DisableWriteProtection (void)
 Disable Write Protection for Power Manager registers. Clears the write protection enable bit in the Power Manager Write Protection Control register. This allows modification of protected PM registers.
 
void PM_EnableWriteProtectionLock (void)
 Sets the WPCTRL register to write protected. Lock bit can only be cleared by a reset.
 

Description

Driver API for PM (plib_pm.h)

Usage Example

The following example demonstrates typical usage of the PM peripheral:

/*******************************************************************************
* @file configure_pm.c
*
* @brief Example usage of the PM (Power Manager) PLIB interface.
*
* @details
* The Power Manager (PM) controls device sleep modes to reduce power
* consumption. The system can enter low-power modes such as Idle or
* Standby and resume execution when a wake-up interrupt occurs.
*
* Typical usage:
* 1. Initialize clocks, GPIOs, and interrupts.
* 2. Configure a wake-up source (for example, an external interrupt).
* 3. Enter the required sleep mode.
* 4. Optionally enable and lock write protection on PM registers.
*******************************************************************************/
#include "plib_pm.h"
#include <stdint.h>
int32_t configure_pm(void)
{
/* Enter Idle sleep mode (CPU halted, peripherals still running) */
/* Enter Standby sleep mode (deep sleep, lowest power consumption) */
/* Enable write protection on PM registers */
/* Lock write protection (can only be cleared by a reset) */
return 0;
}
void PM_EnterIdleSleepMode(void)
Configures the Power Manager to enter Idle sleep mode and executes the WFI instruction.
void PM_EnableWriteProtection(void)
Enable Write Protection for Power Manager registers. Sets the write protection enable bit in the Powe...
void PM_EnableWriteProtectionLock(void)
Sets the WPCTRL register to write protected. Lock bit can only be cleared by a reset.
void PM_EnterStandbySleepMode(void)
Configures the Power Manager to enter Standby sleep mode and executes the WFI instruction.

Function Documentation

◆ PM_DisableWriteProtection()

void PM_DisableWriteProtection ( void )

Disable Write Protection for Power Manager registers. Clears the write protection enable bit in the Power Manager Write Protection Control register. This allows modification of protected PM registers.

◆ PM_EnableWriteProtection()

void PM_EnableWriteProtection ( void )

Enable Write Protection for Power Manager registers. Sets the write protection enable bit in the Power Manager Write Protection Control register. Write protection is enabled on PM registers with the Local Write-Protection property.

◆ PM_EnableWriteProtectionLock()

void PM_EnableWriteProtectionLock ( void )

Sets the WPCTRL register to write protected. Lock bit can only be cleared by a reset.

◆ PM_EnterIdleSleepMode()

void PM_EnterIdleSleepMode ( void )

Configures the Power Manager to enter Idle sleep mode and executes the WFI instruction.

◆ PM_EnterStandbySleepMode()

void PM_EnterStandbySleepMode ( void )

Configures the Power Manager to enter Standby sleep mode and executes the WFI instruction.