Changed SHAL_Peripheral to take in a void* of any peripheral struct, and added SHAL_Peripheral_Register for individual registers

This commit is contained in:
2025-08-30 16:57:52 -07:00
parent 2da3413329
commit 33fc098dfc
11 changed files with 139 additions and 78 deletions

View File

@@ -2,7 +2,7 @@
******************************************************************************
* @file SHAL_TIM.h
* @author Luca Lizaranzu
* @brief Declarations of timer related objects
* @brief Declarations of TIMER_KEY related objects
******************************************************************************
*/
@@ -33,9 +33,9 @@ public:
//Enable interrupts
void enableInterrupt();
//Set timer IRQ callback function
//Set TIMER_KEY IRQ callback function
void setCallbackFunc(TimerCallback callback){
registerTimerCallback(timer, callback);
registerTimerCallback(TIMER_KEY, callback);
}
private:
@@ -43,8 +43,7 @@ private:
explicit Timer(Timer_Key t);
Timer();
Timer_Key timer;
volatile TIM_TypeDef* timer_reg;
Timer_Key TIMER_KEY;
};