-
Notifications
You must be signed in to change notification settings - Fork 7
lowPower_Halt
gicking edited this page Feb 9, 2018
·
6 revisions
back to Command Reference / Power-Saving
Enter the STM8 HALT
low-power mode. In this mode all clocks and peripherals are stopped, main regulator
is disabled and flash is put to sleep mode. As a consequence:
- only external pin interrupts can wake the device
- current consumption is in the (low) uA range
- defined in
low-power.h
-
not loaded by
main_general.h
- no
#define
required
lowPower_Halt()
-
input:
- none
-
output:
- none
- Nothing
The below function counts number of falling edges on pin PE5 in low-power mode.
#include "main_general.h"
#include "low-power.h"
uint16_t count=0;
ISR_HANDLER(PORTE_ISR, __PORTE_VECTOR__) {
count++;
}
void setup() {
noInterrupts();
pinMode(&PORT_E, 5, INPUT_PULLUP_INTERRUPT);
configExintEdge(&PORT_E, FALLING);
interrupts();
pinMode(&PORT_D, 0, OUTPUT);
}
void loop() {
lowPower_Halt();
pinToggle(&PORT_D, 0);
}
- to decrease power consumption in active mode, disable unused peripherals and clock down the core (not yet supported)
-
Getting Started
-
- General Commands
- Libraries
- LCD BTHQ21605V
- poti AD5280
- poti AD5282
- freemodbus
- PetitFS SD-card (min)
- FatFS: SD card (full)
- Board Specific
-
- Universal
- Board Specific