WB32L003 Standard Peripherals Firmware Library

wb32l003_basetim.h
Go to the documentation of this file.
1
10 /* Define to prevent recursive inclusion -------------------------------------*/
11 #ifndef __WB32L003_BASETIM_H
12 #define __WB32L003_BASETIM_H
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /* Includes ------------------------------------------------------------------*/
19 #include "wb32l003.h"
20
29 /* Exported types ------------------------------------------------------------*/
30
35 typedef struct
36 {
37 uint32_t BaseTim_Gate;
40 uint32_t BaseTim_GatePolarity;
43 uint32_t BaseTim_Tog;
46 uint32_t BaseTim_Function;
49 uint32_t BaseTim_AutoReload;
52 uint32_t BaseTim_CountLevel;
55 uint32_t BaseTim_CountMode;
58 uint32_t BaseTim_Prescaler;
61 uint32_t BaseTim_BGLoad;
66 } BaseTim_InitTypeDef;
67
68 /* Exported Constants --------------------------------------------------------*/
69
74 #define IS_BaseTIM_ALL_PERIPH(PERIPH) (((PERIPH) == TIM10) || \
75 ((PERIPH) == TIM11))
76
80 #define BaseTim_Gate_Enable ((uint32_t)(0x01U << 10))
81 #define BaseTim_Gate_Disable ((uint32_t)0x00)
82
90 #define BaseTim_GatePolarity_Low ((uint32_t)(0x01U << 11))
91 #define BaseTim_GatePolarity_High ((uint32_t)0x00)
92
100 #define BaseTim_Tog_Enable ((uint32_t)(0x01U << 9))
101 #define BaseTim_Tog_Disable ((uint32_t)0x00)
102
110 #define BaseTim_Function_Count ((uint32_t)(0x01U << 8))
111 #define BaseTim_Function_Timer ((uint32_t)0x00)
112
120 #define BaseTim_AutoReload_Enable ((uint32_t)(0x01U << 6))
121 #define BaseTim_AutoReload_Disable ((uint32_t)0x00)
122
130 #define BaseTim_CountLevel_32BIT ((uint32_t)(0x01U << 4))
131 #define BaseTim_CountLevel_16BIT ((uint32_t)0x00)
132
140 #define BaseTim_CountMode_OneShot ((uint32_t)(0x01U << 3))
141 #define BaseTim_CountMode_Repeat ((uint32_t)0x00)
142
149 #define BaseTim_Prescaler_DIV1 ((uint32_t)0x00)
150 #define BaseTim_Prescaler_DIV2 ((uint32_t)0x01)
151 #define BaseTim_Prescaler_DIV4 ((uint32_t)0x02)
152 #define BaseTim_Prescaler_DIV8 ((uint32_t)0x03)
153 #define BaseTim_Prescaler_DIV16 ((uint32_t)0x04)
154 #define BaseTim_Prescaler_DIV32 ((uint32_t)0x05)
155 #define BaseTim_Prescaler_DIV64 ((uint32_t)0x06)
156 #define BaseTim_Prescaler_DIV128 ((uint32_t)0x07)
157
165 /* Exported macro ------------------------------------------------------------*/
166 /* Exported functions --------------------------------------------------------*/
167 void BaseTim_DeInit(BASETIM_TypeDef* TIMx);
168 void BaseTim_Init(BASETIM_TypeDef* TIMx, BaseTim_InitTypeDef* BaseTim_InitStruct);
169 void BaseTim_Cmd(BASETIM_TypeDef* TIMx, FunctionalState NewState);
170 void BaseTim_ITConfig(BASETIM_TypeDef* TIMx, FunctionalState NewState);
171 uint32_t BaseTim_GetCounter(BASETIM_TypeDef* TIMx);
172 void BaseTim_SetLoad(BASETIM_TypeDef* TIMx, uint16_t load);
173 void BaseTim_SetBkLoad(BASETIM_TypeDef* TIMx, uint16_t bgLoad);
174 FlagStatus BaseTim_GetFlagStatus(BASETIM_TypeDef* TIMx);
175 void BaseTim_ClearFlag(BASETIM_TypeDef* TIMx);
176
177
186 #ifdef __cplusplus
187 }
188 #endif
189
190 #endif /*__WB32L003_BASETIM_H */
BaseTim_InitTypeDef::BaseTim_BGLoad
uint32_t BaseTim_BGLoad
Definition: wb32l003_basetim.h:61
BaseTim_InitTypeDef::BaseTim_AutoReload
uint32_t BaseTim_AutoReload
Definition: wb32l003_basetim.h:49
BaseTim_InitTypeDef
BaseTim Init structure definition.
Definition: wb32l003_basetim.h:35
BaseTim_InitTypeDef::BaseTim_Gate
uint32_t BaseTim_Gate
Definition: wb32l003_basetim.h:37
BaseTim_InitTypeDef::BaseTim_CountMode
uint32_t BaseTim_CountMode
Definition: wb32l003_basetim.h:55
BaseTim_InitTypeDef::BaseTim_Function
uint32_t BaseTim_Function
Definition: wb32l003_basetim.h:46
BaseTim_InitTypeDef::BaseTim_CountLevel
uint32_t BaseTim_CountLevel
Definition: wb32l003_basetim.h:52
BaseTim_InitTypeDef::BaseTim_Tog
uint32_t BaseTim_Tog
Definition: wb32l003_basetim.h:43
BaseTim_InitTypeDef::BaseTim_GatePolarity
uint32_t BaseTim_GatePolarity
Definition: wb32l003_basetim.h:40
BaseTim_DeInit
void BaseTim_DeInit(BASETIM_TypeDef *TIMx)
Deinitializes the TIMx peripheral registers to their default reset values.
Definition: wb32l003_basetim.c:46
BASETIM_TypeDef
Definition: wb32l003.h:430
BaseTim_InitTypeDef::BaseTim_Prescaler
uint32_t BaseTim_Prescaler
Definition: wb32l003_basetim.h:58
BaseTim_Init
void BaseTim_Init(BASETIM_TypeDef *TIMx, BaseTim_InitTypeDef *BaseTim_InitStruct)
Initializes the BaseTIMx Unit peripheral according to the specified parameters in the TIM_TimeBaseIni...
Definition: wb32l003_basetim.c:64