Added the folder for a new module which work is still in progress : the power management block

This commit is contained in:
anschrammh 2023-10-19 07:57:48 +02:00
parent 57fe2a423e
commit 8f53359cb8
4 changed files with 82 additions and 1 deletions

View File

@ -6,7 +6,8 @@ GEN_LIBS = libappdrivers$(LIB_EXT)
COMPONENTS_libappdrivers = lcd/libappdriverslcd$(LIB_EXT) \
mmc_sdio/libappdriversmmc_sdio$(LIB_EXT) \
i2c/libappdriversi2c$(LIB_EXT) \
watch_peripherals/libappdriverswatch_peripherals$(LIB_EXT)
watch_peripherals/libappdriverswatch_peripherals$(LIB_EXT) \
watch_power_management/libappdriverswatch_power_management$(LIB_EXT)
endif
#DEFINES +=

View File

@ -0,0 +1,15 @@
TOP_DIR = ../../..
sinclude $(TOP_DIR)/tools/w800/conf.mk
ifndef PDIR
GEN_LIBS = libappdriverswatch_power_management$(LIB_EXT)
endif
#DEFINES +=
sinclude $(TOP_DIR)/tools/w800/rules.mk
INCLUDES := $(INCLUDES) -I $(PDIR)include
PDIR := ../$(PDIR)
sinclude $(PDIR)Makefile

View File

@ -0,0 +1,10 @@
/**
* @file watch_power_management.h
* @author Anatole SCHRAMM-HENRY
* @brief Watch power management functions API header file
* @version 0.1
* @date 2023-10-12
*
* @copyright MIT
*
*/

View File

@ -0,0 +1,55 @@
/**
* @file watch_power_management.h
* @author Anatole SCHRAMM-HENRY
* @brief Watch power management functions API header file
* @version 0.1
* @date 2023-10-12
*
* @copyright MIT
*
*/
#ifndef WATCH_POWER_MANAGEMENT_H
#define WATCH_POWER_MANAGEMENT_H
typedef enum watch_power_state
{
/**
* @brief WATCH_POWER_STATE_IDLE : the watch has the display on and the screen is showing something,
* to save power, the MCU is running at a low clock speed (40 MHz), animations, transitions and other graphical effects might not be smooth.
*/
WATCH_POWER_STATE_IDLE,
/**
* @brief WATCH_POWER_STATE_FULL_SPEED : the watch has the display on and the screen is showing something,
* to have the best graphical user experience, the MCU is running at a higher clock speed giving better animations,
* transitions and other graphical effects at the expense of a higher power consumption.
*/
WATCH_POWER_STATE_FULL_SPEED,
/**
* @brief WATCH_POWER_STATE_SLEEP : the watch is put in sleep state this means that the MCU stops, data in RAM is kept,
* the display is completely switched off and the wake up is fast.
* The watch will wakeup after user interaction is detected : tilt of the wrist, screen touched.
* The watch will continue executing the firmware where it last was.
* This mode allows for a low power consumption of around 4 mA.
*/
WATCH_POWER_STATE_SLEEP,
/**
* @brief WATCH_POWER_STATE_BLE_SLEEP : the watch will enter this mode instead of the WATCH_POWER_STATE_SLEEP state
* if the BLE modem is running. This is because the MCU can not be put to sleep to keep the Bluetooth Low Energy stack running.
* The min clock speed should be set to 40MHz and NOT lower.
*/
WATCH_POWER_STATE_BLE_SLEEP,
/**
* @brief WACTH_POWER_STATE_STANDBY : in this state, the watch should achieve it's the lowest power consumption,
* data in RAM is lost and on user events (tilt of the wrist, screen touched), the watch reboots.
* This mode allows for a low power consumption of around 2 mA.
*/
WACTH_POWER_STATE_STANDBY,
} watch_power_state_e;
typedef struct watch_power_management
{
watch_power_state_e current_power_state;
} watch_power_management_t;
#endif //WATCH_POWER_MANAGEMENT_H