Added functions for deep sleep to mbxxx platform.
This commit is contained in:
parent
4b5d380c74
commit
5eabf33211
7 changed files with 151 additions and 10 deletions
25
cpu/stm32w108/board-sensors.h
Normal file
25
cpu/stm32w108/board-sensors.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* \file
|
||||
* Declarations for sensor-related functions that are
|
||||
* common to all stm32w platforms.
|
||||
*
|
||||
*
|
||||
* \author Salvatore Pitrulli <salvopitru@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Remember state of sensors (if active or not), in order to
|
||||
* resume their original state after calling powerUpSensors().
|
||||
* Useful when entering in sleep mode, since all system
|
||||
* peripherals have to be reinitialized.
|
||||
*/
|
||||
void sensorsPowerDown();
|
||||
|
||||
/**
|
||||
* Resume the state of all on-board sensors on to the state
|
||||
* that they had when sensorsPowerDown() was called.
|
||||
* Useful when sensors have to be used after the micro was put
|
||||
* in deep sleep mode.
|
||||
*/
|
||||
void sensorsPowerUp();
|
|
@ -314,7 +314,7 @@ void halBoardPowerDown(void)
|
|||
(GPIOCFG_IN <<PC7_CFG_BIT); /* OSC32K */
|
||||
#endif
|
||||
|
||||
#ifdef EMBERZNET_HAL
|
||||
|
||||
/* Configure GPIO for BUTTONSs */
|
||||
{
|
||||
ButtonResourceType *buttons = (ButtonResourceType *) boardDescription->io->buttons;
|
||||
|
@ -324,9 +324,23 @@ void halBoardPowerDown(void)
|
|||
halGpioSet(PORTx_PIN(buttons[i].gpioPort, buttons[i].gpioPin), GPIOOUT_PULLUP);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Configure GPIO for LEDs */
|
||||
{
|
||||
LedResourceType *leds = (LedResourceType *) boardDescription->io->leds;
|
||||
int8u i;
|
||||
for (i = 0; i < boardDescription->leds; i++) {
|
||||
/* LED default off */
|
||||
halGpioConfig(PORTx_PIN(leds[i].gpioPort, leds[i].gpioPin), GPIOCFG_OUT);
|
||||
halGpioSet(PORTx_PIN(leds[i].gpioPort, leds[i].gpioPin), 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Configure GPIO for power amplifier */
|
||||
if (boardDescription->flags & BOARD_HAS_PA) {
|
||||
/* SiGe Ant Sel to output */
|
||||
halGpioConfig(PORTB_PIN(5), GPIOCFG_OUT);
|
||||
halGpioSet(PORTB_PIN(5), 1);
|
||||
/* SiGe Standby */
|
||||
halGpioConfig(PORTB_PIN(6), GPIOCFG_OUT);
|
||||
halGpioSet(PORTB_PIN(6), 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue