Skip to content

Commit

Permalink
removed a bunch of unused functions
Browse files Browse the repository at this point in the history
not used anywhere, removing makes porting to a new MCU simpler
  • Loading branch information
tridge authored and AlkaMotors committed Nov 30, 2024
1 parent c58afda commit 9e76bd9
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 269 deletions.
8 changes: 0 additions & 8 deletions Mcu/e230/Inc/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ void TIMER16_Init(void);
void TIMER13_Init(void);
// static void MX_USART1_UART_Init(void);

void disableComTimerInt(void);
void enableComTimerInt(void);
void setAndEnableComInt(uint16_t time);
uint16_t getintervaTimerCount();
void setintervaTimerCount(uint16_t intertime);
void setAutoReloadPWM(uint16_t relval);
void setDutyCycleAll(uint16_t newdc);
void resetInputCaptureTimer();
void setPWMCompare1(uint16_t compareone);
void setPWMCompare2(uint16_t comparetwo);
Expand All @@ -62,4 +55,3 @@ void reloadWatchDogCounter(void);
void generatePwmTimerEvent(void);
void UN_TIM_Init(void);
void LED_GPIO_init(void);
void setPrescalerPWM(uint16_t presc);
33 changes: 0 additions & 33 deletions Mcu/e230/Src/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,39 +328,6 @@ void LED_GPIO_init()

#endif

void disableComTimerInt()
{
TIMER_DMAINTEN(COM_TIMER) &= (~(uint32_t)TIMER_INT_UP);
}

void enableComTimerInt()
{
TIMER_DMAINTEN(COM_TIMER) |= (uint32_t)TIMER_INT_UP;
}

void setAndEnableComInt(uint16_t time)
{
TIMER_CNT(COM_TIMER) = 0;
TIMER_CAR(COM_TIMER) = time;
TIMER_INTF(COM_TIMER) = 0x00;
TIMER_DMAINTEN(COM_TIMER) |= (uint32_t)TIMER_INT_UP;
}

uint16_t getintervaTimerCount() { return TIMER_CNT(INTERVAL_TIMER); }

void setintervaTimerCount(uint16_t intertime) { TIMER_CNT(INTERVAL_TIMER) = 0; }

void setPrescalerPWM(uint16_t presc) { TIMER_PSC(TIMER0) = presc; }

void setAutoReloadPWM(uint16_t relval) { TIMER_CAR(TIMER0) = relval; }

void setDutyCycleAll(uint16_t newdc)
{
TIMER_CH0CV(TIMER0) = newdc;
TIMER_CH1CV(TIMER0) = newdc;
TIMER_CH2CV(TIMER0) = newdc;
}

void setPWMCompare1(uint16_t compareone) { TIMER_CH0CV(TIMER0) = compareone; }
void setPWMCompare2(uint16_t comparetwo) { TIMER_CH1CV(TIMER0) = comparetwo; }
void setPWMCompare3(uint16_t comparethree)
Expand Down
8 changes: 0 additions & 8 deletions Mcu/f031/Inc/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ void MX_TIM2_Init(void);
void TEN_KHZ_Timer_Init(void);
/* USER CODE BEGIN PFP */
// static void MX_TIM16_Init2(void);
void disableComTimerInt(void);
void enableComTimerInt(void);
void setAndEnableComInt(uint16_t time);
uint16_t getintervaTimerCount();
void setintervaTimerCount(uint16_t intertime);
void setAutoReloadPWM(uint16_t relval);
void setDutyCycleAll(uint16_t newdc);
void resetInputCaptureTimer();
void setPWMCompare1(uint16_t compareone);
void setPWMCompare2(uint16_t comparetwo);
Expand All @@ -58,4 +51,3 @@ void generatePwmTimerEvent(void);
void UN_TIM_Init(void);
void UN_GPIO_Init(void);
void LED_GPIO_init(void);
void setPrescalerPWM(uint16_t presc);
30 changes: 0 additions & 30 deletions Mcu/f031/Src/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,36 +537,6 @@ void UN_GPIO_Init(void)

void reloadWatchDogCounter() { LL_IWDG_ReloadCounter(IWDG); }

void disableComTimerInt() { COM_TIMER->DIER &= ~((0x1UL << (0U))); }

void enableComTimerInt() { COM_TIMER->DIER |= (0x1UL << (0U)); }

void setAndEnableComInt(uint16_t time)
{
COM_TIMER->CNT = 0;
COM_TIMER->ARR = time;
COM_TIMER->SR = 0x00;
COM_TIMER->DIER |= (0x1UL << (0U));
}

uint16_t getintervaTimerCount() { return INTERVAL_TIMER->CNT; }

void setintervaTimerCount(uint16_t intertime)
{
INTERVAL_TIMER->CNT = intertime;
}

void setPrescalerPWM(uint16_t presc) { TIM1->PSC = presc; }

void setAutoReloadPWM(uint16_t relval) { TIM1->ARR = relval; }

void setDutyCycleAll(uint16_t newdc)
{
TIM1->CCR1 = newdc;
TIM1->CCR2 = newdc;
TIM1->CCR3 = newdc;
}

void setPWMCompare1(uint16_t compareone) { TIM1->CCR1 = compareone; }
void setPWMCompare2(uint16_t comparetwo) { TIM1->CCR2 = comparetwo; }
void setPWMCompare3(uint16_t comparethree) { TIM1->CCR3 = comparethree; }
Expand Down
9 changes: 1 addition & 8 deletions Mcu/f051/Inc/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ void MX_TIM14_Init(void);
void MX_TIM6_Init(void);
void MX_TIM17_Init(void);
// static void MX_USART1_UART_Init(void);
void disableComTimerInt(void);
void enableComTimerInt(void);
void setAndEnableComInt(uint16_t time);
uint16_t getintervaTimerCount();
void setintervaTimerCount(uint16_t intertime);
void setAutoReloadPWM(uint16_t relval);
void setDutyCycleAll(uint16_t newdc);
void resetInputCaptureTimer();
void setPWMCompare1(uint16_t compareone);
void setPWMCompare2(uint16_t comparetwo);
Expand All @@ -56,4 +49,4 @@ void reloadWatchDogCounter(void);
void generatePwmTimerEvent(void);
void UN_TIM_Init(void);
void LED_GPIO_init(void);
void setPrescalerPWM(uint16_t presc);

27 changes: 0 additions & 27 deletions Mcu/f051/Src/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,33 +525,6 @@ void reloadWatchDogCounter()
LL_IWDG_ReloadCounter(IWDG);
}

void disableComTimerInt() { COM_TIMER->DIER &= ~((0x1UL << (0U))); }

void enableComTimerInt() { COM_TIMER->DIER |= (0x1UL << (0U)); }

void setAndEnableComInt(uint16_t time)
{
COM_TIMER->CNT = 0;
COM_TIMER->ARR = time;
COM_TIMER->SR = 0x00;
COM_TIMER->DIER |= (0x1UL << (0U));
}

uint16_t getintervaTimerCount() { return INTERVAL_TIMER->CNT; }

void setintervaTimerCount(uint16_t intertime) { INTERVAL_TIMER->CNT = 0; }

void setPrescalerPWM(uint16_t presc) { TIM1->PSC = presc; }

void setAutoReloadPWM(uint16_t relval) { TIM1->ARR = relval; }

void setDutyCycleAll(uint16_t newdc)
{
TIM1->CCR1 = newdc;
TIM1->CCR2 = newdc;
TIM1->CCR3 = newdc;
}

inline void setPWMCompare1(uint16_t compareone) { TIM1->CCR1 = compareone; }
inline void setPWMCompare2(uint16_t comparetwo) { TIM1->CCR2 = comparetwo; }
inline void setPWMCompare3(uint16_t comparethree) { TIM1->CCR3 = comparethree; }
Expand Down
8 changes: 0 additions & 8 deletions Mcu/f415/Inc/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ void MX_IWDG_Init(void);
void TIM11_Init(void);
void TIM9_Init(void);
void TIM10_Init(void);
void disableComTimerInt(void);
void enableComTimerInt(void);
void setAndEnableComInt(uint16_t time);
uint16_t getintervaTimerCount();
void setintervaTimerCount(uint16_t intertime);
void setAutoReloadPWM(uint16_t relval);
void setDutyCycleAll(uint16_t newdc);
void resetInputCaptureTimer();
void setPWMCompare1(uint16_t compareone);
void setPWMCompare2(uint16_t comparetwo);
Expand All @@ -54,5 +47,4 @@ void enableCorePeripherals(void);
void reloadWatchDogCounter(void);
void generatePwmTimerEvent(void);
void UN_TIM_Init(void);
void setPrescalerPWM(uint16_t presc);
void LED_GPIO_init(void);
30 changes: 0 additions & 30 deletions Mcu/f415/Src/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,36 +337,6 @@ void reloadWatchDogCounter()
WDT->cmd = WDT_CMD_RELOAD;
}

void disableComTimerInt() { COM_TIMER->iden &= ~TMR_OVF_INT; }

void enableComTimerInt() { COM_TIMER->iden |= TMR_OVF_INT; }

void setAndEnableComInt(uint16_t time)
{
COM_TIMER->cval = 0;
COM_TIMER->pr = time;
COM_TIMER->ists = 0x00;
COM_TIMER->iden |= TMR_OVF_INT;
}

uint16_t getintervaTimerCount() { return INTERVAL_TIMER->cval; }

void setintervaTimerCount(uint16_t intertime)
{
INTERVAL_TIMER->cval = intertime;
}

void setPrescalerPWM(uint16_t presc) { TMR1->div = presc; }

void setAutoReloadPWM(uint16_t relval) { TMR1->pr = relval; }

void setDutyCycleAll(uint16_t newdc)
{
TMR1->c1dt = newdc;
TMR1->c2dt = newdc;
TMR1->c3dt = newdc;
}

void setPWMCompare1(uint16_t compareone) { TMR1->c1dt = compareone; }
void setPWMCompare2(uint16_t comparetwo) { TMR1->c2dt = comparetwo; }
void setPWMCompare3(uint16_t comparethree) { TMR1->c3dt = comparethree; }
Expand Down
8 changes: 0 additions & 8 deletions Mcu/f421/Inc/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ void TIM17_Init(void);
void TIM14_Init(void);
void TIM16_Init(void);
// static void MX_USART1_UART_Init(void);
void disableComTimerInt(void);
void enableComTimerInt(void);
void setAndEnableComInt(uint16_t time);
uint16_t getintervaTimerCount();
void setintervaTimerCount(uint16_t intertime);
void setAutoReloadPWM(uint16_t relval);
void setDutyCycleAll(uint16_t newdc);
void resetInputCaptureTimer();
void setPWMCompare1(uint16_t compareone);
void setPWMCompare2(uint16_t comparetwo);
Expand All @@ -54,5 +47,4 @@ void enableCorePeripherals(void);
void reloadWatchDogCounter(void);
void generatePwmTimerEvent(void);
void UN_TIM_Init(void);
void setPrescalerPWM(uint16_t presc);
void LED_GPIO_init(void);
30 changes: 0 additions & 30 deletions Mcu/f421/Src/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,36 +269,6 @@ void reloadWatchDogCounter()
WDT->cmd = WDT_CMD_RELOAD;
}

void disableComTimerInt() { COM_TIMER->iden &= ~TMR_OVF_INT; }

void enableComTimerInt() { COM_TIMER->iden |= TMR_OVF_INT; }

void setAndEnableComInt(uint16_t time)
{
COM_TIMER->cval = 0;
COM_TIMER->pr = time;
COM_TIMER->ists = 0x00;
COM_TIMER->iden |= TMR_OVF_INT;
}

uint16_t getintervaTimerCount() { return INTERVAL_TIMER->cval; }

void setintervaTimerCount(uint16_t intertime)
{
INTERVAL_TIMER->cval = intertime;
}

void setPrescalerPWM(uint16_t presc) { TMR1->div = presc; }

void setAutoReloadPWM(uint16_t relval) { TMR1->pr = relval; }

void setDutyCycleAll(uint16_t newdc)
{
TMR1->c1dt = newdc;
TMR1->c2dt = newdc;
TMR1->c3dt = newdc;
}

void setPWMCompare1(uint16_t compareone) { TMR1->c1dt = compareone; }
void setPWMCompare2(uint16_t comparetwo) { TMR1->c2dt = comparetwo; }
void setPWMCompare3(uint16_t comparethree) { TMR1->c3dt = comparethree; }
Expand Down
8 changes: 0 additions & 8 deletions Mcu/g071/Inc/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,10 @@ void MX_TIM16_Init(void);
void MX_IWDG_Init(void);
void MX_TIM6_Init(void);

void disableComTimerInt(void);
void enableComTimerInt(void);
void setAndEnableComInt(uint16_t time);
uint16_t getintervaTimerCount();
void setintervaTimerCount(uint16_t intertime);
void setAutoReloadPWM(uint16_t relval);
void setDutyCycleAll(uint16_t newdc);
void resetInputCaptureTimer();
void setPWMCompare1(uint16_t compareone);
void setPWMCompare2(uint16_t comparetwo);
void setPWMCompare3(uint16_t comparethree);
void enableCorePeripherals(void);
void reloadWatchDogCounter(void);
void generatePwmTimerEvent(void);
void setPrescalerPWM(uint16_t presc);
30 changes: 0 additions & 30 deletions Mcu/g071/Src/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,36 +704,6 @@ void MX_GPIO_Init(void)

void reloadWatchDogCounter() { LL_IWDG_ReloadCounter(IWDG); }

void disableComTimerInt() { COM_TIMER->DIER &= ~((0x1UL << (0U))); }

void enableComTimerInt() { COM_TIMER->DIER |= (0x1UL << (0U)); }

void setAndEnableComInt(uint16_t time)
{
COM_TIMER->CNT = 0;
COM_TIMER->ARR = time;
COM_TIMER->SR = 0x00;
COM_TIMER->DIER |= (0x1UL << (0U));
}

uint16_t getintervaTimerCount() { return INTERVAL_TIMER->CNT; }

void setintervaTimerCount(uint16_t intertime)
{
INTERVAL_TIMER->CNT = intertime;
}

void setPrescalerPWM(uint16_t presc) { TIM1->PSC = presc; }

void setAutoReloadPWM(uint16_t relval) { TIM1->ARR = relval; }

void setDutyCycleAll(uint16_t newdc)
{
TIM1->CCR1 = newdc;
TIM1->CCR2 = newdc;
TIM1->CCR3 = newdc;
}

void setPWMCompare1(uint16_t compareone) { TIM1->CCR1 = compareone; }
void setPWMCompare2(uint16_t comparetwo) { TIM1->CCR2 = comparetwo; }
void setPWMCompare3(uint16_t comparethree) { TIM1->CCR3 = comparethree; }
Expand Down
8 changes: 0 additions & 8 deletions Mcu/g431/Inc/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,10 @@ void MX_TIM16_Init(void);
void MX_IWDG_Init(void);
void MX_TIM6_Init(void);
void MX_TIM15_Init(void);
void disableComTimerInt(void);
void enableComTimerInt(void);
void setAndEnableComInt(uint16_t time);
uint16_t getintervaTimerCount();
void setintervaTimerCount(uint16_t intertime);
void setAutoReloadPWM(uint16_t relval);
void setDutyCycleAll(uint16_t newdc);
void resetInputCaptureTimer();
void setPWMCompare1(uint16_t compareone);
void setPWMCompare2(uint16_t comparetwo);
void setPWMCompare3(uint16_t comparethree);
void enableCorePeripherals(void);
void reloadWatchDogCounter(void);
void generatePwmTimerEvent(void);
void setPrescalerPWM(uint16_t presc);
8 changes: 0 additions & 8 deletions Mcu/l431/Inc/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ void MX_TIM6_Init(void);
void MX_TIM7_Init(void);
void init_OPAMP(void);
// static void MX_USART1_UART_Init(void);
void disableComTimerInt(void);
void enableComTimerInt(void);
void setAndEnableComInt(uint16_t time);
uint16_t getintervaTimerCount();
void setintervaTimerCount(uint16_t intertime);
void setAutoReloadPWM(uint16_t relval);
void setDutyCycleAll(uint16_t newdc);
void resetInputCaptureTimer();
void setPWMCompare1(uint16_t compareone);
void setPWMCompare2(uint16_t comparetwo);
Expand All @@ -58,4 +51,3 @@ void reloadWatchDogCounter(void);
void generatePwmTimerEvent(void);
void UN_TIM_Init(void);
void LED_GPIO_init(void);
void setPrescalerPWM(uint16_t presc);
Loading

0 comments on commit 9e76bd9

Please sign in to comment.