added slow lptim to BSP_POWER

This commit is contained in:
2024-02-24 21:06:27 +01:00
parent a484f2247e
commit fef8a8fb32
7 changed files with 34 additions and 4 deletions

View 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) {
}

View File

@@ -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();

View File

@@ -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)