added slow lptim to BSP_POWER
This commit is contained in:
19
Application/BSP/BSP_POWER.c
Normal file
19
Application/BSP/BSP_POWER.c
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
#include "BSP_POWER.h"
|
||||
#include "lptim.h"
|
||||
#include "ulog.h"
|
||||
|
||||
#define LPTIM_CLK 500 // Hz
|
||||
#define SLEEP_TIME 10 // seconds to wait
|
||||
|
||||
void BSP_POWER_Init() {
|
||||
uint16_t counter = LPTIM_CLK * SLEEP_TIME;
|
||||
HAL_LPTIM_Counter_Start_IT(&hlptim4, counter);
|
||||
}
|
||||
|
||||
|
||||
void HAL_LPTIM_AutoReloadMatchCallback(LPTIM_HandleTypeDef *hlptim) {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
#pragma once
|
||||
// Driver for standby and sleep managment
|
||||
// Timer for automatic standby
|
||||
// Wakeup Pin Setting
|
||||
// also shutdown procedure
|
||||
// also shutdown procedure
|
||||
|
||||
void BSP_POWER_Init();
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
add_library(BSP STATIC
|
||||
BSP_EE24.c
|
||||
BSP_INA.c
|
||||
BSP_POWER.c
|
||||
)
|
||||
|
||||
target_include_directories(BSP PUBLIC ./)
|
||||
target_link_libraries(BSP PRIVATE EE24 INA219)
|
||||
target_link_libraries(BSP PRIVATE EE24 INA219 ulog)
|
||||
|
||||
Reference in New Issue
Block a user