#include "power.h"
#include <LPC17xx.h>
Go to the source code of this file.
◆ POWER_DeepPowerDownOnWFI()
void POWER_DeepPowerDownOnWFI |
( |
void |
| ) |
|
WFI/WFE puts device to deep power down mode provided that the SLEEPDEEP bit is set.
Definition at line 20 of file power.c.
21{
22 LPC_SC->PCON |= 0x3;
23}
◆ POWER_Init()
void POWER_Init |
( |
u8 |
config | ) |
|
Configures sleep/power down mode for the device.
- Parameters
-
config | Settings for the power module (Use DEEP mode, and SLEEPONEXIT) |
sleep_on_exit | Whether to enter sleep mode on exit from an ISR |
Definition at line 4 of file power.c.
◆ POWER_PowerDownOnWFI()
void POWER_PowerDownOnWFI |
( |
void |
| ) |
|
WFI/WFE puts device to power down power down mode.
Definition at line 15 of file power.c.
16{
18}
#define SET_BIT(reg, bit)
◆ POWER_SleepOnWFI()
void POWER_SleepOnWFI |
( |
void |
| ) |
|
WFI/WFE puts device to sleep or deep sleep mode depending on the configuration specified in the POWER_Init function.
Definition at line 10 of file power.c.
11{
12 LPC_SC->PCON &= ~0x3;
13}
◆ POWER_TurnOffPeripheral()
void POWER_TurnOffPeripheral |
( |
u8 |
bit | ) |
|
Turns off a peripheral.
- Parameters
-
peripheral | The bit # of the peripheral to turn off, defined in the POWER_Peripheral enum. If not present, the bit can be found in the user manual @ Table 46. |
Definition at line 30 of file power.c.
31{
33}
#define CLR_BIT(reg, bit)
◆ POWER_TurnOnPeripheral()
void POWER_TurnOnPeripheral |
( |
u8 |
bit | ) |
|
Turns on a peripheral.
- Parameters
-
peripheral | The bit # of the peripheral to turn on, defined in the POWER_Peripheral enum. If not present, the bit can be found in the user manual @ Table 46. |
Definition at line 25 of file power.c.
◆ POWER_WaitForInterrupts()
void POWER_WaitForInterrupts |
( |
void |
| ) |
|
Definition at line 35 of file power.c.
36{
37 __asm volatile("wfi");
38}