18 #define TIMER_CLKSRC_BCLK 0 20 #define TIMER_CLKSRC_32K 1 21 #define TIMER_CLKSRC_1K 2 22 #define TIMER_CLKSRC_XTAL 3 23 #if !defined(BL702) && !defined(BL602) 24 #define TIMER_CLKSRC_GPIO 4 26 #define TIMER_CLKSRC_NO 5 34 #define TIMER_COUNTER_MODE_PROLOAD 0 35 #define TIMER_COUNTER_MODE_UP 1 43 #define TIMER_COMP_ID_0 0 44 #define TIMER_COMP_ID_1 1 45 #define TIMER_COMP_ID_2 2 46 #define TIMER_COMP_NONE 3 54 #define TIMER_CAPTURE_POLARITY_POSITIVE 0 55 #define TIMER_CAPTURE_POLARITY_NEGATIVE 1 187 #if !defined(BL702) || !defined(BL602) TIMER capture configuration structure.
void bflb_timer_init(struct bflb_device_s *dev, const struct bflb_timer_config_s *config)
Initialize timer.
uint32_t bflb_timer_capture_get_pulsewidth(struct bflb_device_s *dev)
TIMER configuration structure.
void bflb_timer_compint_mask(struct bflb_device_s *dev, uint8_t cmp_no, bool mask)
Enable or disable timer interrupt of corresponding compare id.
void bflb_timer_start(struct bflb_device_s *dev)
Start timer.
uint32_t bflb_timer_get_compvalue(struct bflb_device_s *dev, uint8_t cmp_no)
Get compare value of corresponding compare id.
void bflb_timer_compint_clear(struct bflb_device_s *dev, uint8_t cmp_no)
Clear timer interrupt status of corresponding compare id.
uint32_t bflb_timer_get_countervalue(struct bflb_device_s *dev)
Get timer counter value.
bool bflb_timer_get_compint_status(struct bflb_device_s *dev, uint8_t cmp_no)
Get timer interrupt status of corresponding compare id.
void bflb_timer_set_compvalue(struct bflb_device_s *dev, uint8_t cmp_no, uint32_t val)
Set compare value of corresponding compare id.
void bflb_timer_set_preloadvalue(struct bflb_device_s *dev, uint32_t val)
Set timer preload value.
void bflb_timer_capture_init(struct bflb_device_s *dev, const struct bflb_timer_capture_config_s *config)
void bflb_timer_stop(struct bflb_device_s *dev)
Stop timer.
void bflb_timer_deinit(struct bflb_device_s *dev)
Deinitialize timer.