Lines Matching refs:Timx
33 void TIM_Init(TIMER0_Type* Timx, uint16_t Ms) { in TIM_Init() argument
34 assert_param(IS_TIM_ALL_PERIPH(Timx)); in TIM_Init()
36 Timx->CTRL_b.EN = FALSE; in TIM_Init()
37 Timx->LEN = tim_GetClock() / 1000 * Ms; in TIM_Init()
38 Timx->TYPE_b.SIGNLE_SHOT = TRUE; in TIM_Init()
41 void TIM_EnableInt(TIMER0_Type* Timx, BOOL Enable) { in TIM_EnableInt() argument
42 assert_param(IS_TIM_ALL_PERIPH(Timx)); in TIM_EnableInt()
45 Timx->INT_EN_b.EN_REVERSE = FALSE; in TIM_EnableInt()
47 Timx->INT_EN_b.EN_REVERSE = TRUE; in TIM_EnableInt()
51 BOOL TIM_GetIntStatus(TIMER0_Type* Timx) { in TIM_GetIntStatus() argument
52 assert_param(IS_TIM_ALL_PERIPH(Timx)); in TIM_GetIntStatus()
54 return (Timx->INT_STA_b.STA ? TRUE : FALSE); in TIM_GetIntStatus()
57 void TIM_ClearInt(TIMER0_Type* Timx) { in TIM_ClearInt() argument
58 assert_param(IS_TIM_ALL_PERIPH(Timx)); in TIM_ClearInt()
60 Timx->INT_STA_b.STA = 1; in TIM_ClearInt()
63 void TIM_Enable(TIMER0_Type* Timx, BOOL Enable) { in TIM_Enable() argument
64 assert_param(IS_TIM_ALL_PERIPH(Timx)); in TIM_Enable()
66 Timx->CTRL_b.EN = Enable; in TIM_Enable()
69 BOOL TIM_IsOverflow(TIMER0_Type* Timx) { in TIM_IsOverflow() argument
70 assert_param(IS_TIM_ALL_PERIPH(Timx)); in TIM_IsOverflow()
72 return (Timx->CNT == 0) ? TRUE : FALSE; in TIM_IsOverflow()
75 uint32_t TIM_GetCounter(TIMER0_Type* Timx) { in TIM_GetCounter() argument
76 assert_param(IS_TIM_ALL_PERIPH(Timx)); in TIM_GetCounter()
78 return Timx->CNT; in TIM_GetCounter()