Bouffalo SDK  1.0
Bouffalolab Software Development Kit
TIMER
Collaboration diagram for TIMER:

Modules

 timer clock source definition
 
 timer counter mode definition
 
 timer compare id definition
 
 timer capture polarity definition
 

Data Structures

struct  bflb_timer_config_s
 TIMER configuration structure. More...
 
struct  bflb_timer_capture_config_s
 TIMER capture configuration structure. More...
 

Functions

void bflb_timer_init (struct bflb_device_s *dev, const struct bflb_timer_config_s *config)
 Initialize timer. More...
 
void bflb_timer_deinit (struct bflb_device_s *dev)
 Deinitialize timer. More...
 
void bflb_timer_start (struct bflb_device_s *dev)
 Start timer. More...
 
void bflb_timer_stop (struct bflb_device_s *dev)
 Stop timer. More...
 
void bflb_timer_set_preloadvalue (struct bflb_device_s *dev, uint32_t val)
 Set timer preload value. More...
 
void bflb_timer_set_compvalue (struct bflb_device_s *dev, uint8_t cmp_no, uint32_t val)
 Set compare value of corresponding compare id. More...
 
uint32_t bflb_timer_get_compvalue (struct bflb_device_s *dev, uint8_t cmp_no)
 Get compare value of corresponding compare id. More...
 
uint32_t bflb_timer_get_countervalue (struct bflb_device_s *dev)
 Get timer counter value. More...
 
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. More...
 
bool bflb_timer_get_compint_status (struct bflb_device_s *dev, uint8_t cmp_no)
 Get timer interrupt status of corresponding compare id. More...
 
void bflb_timer_compint_clear (struct bflb_device_s *dev, uint8_t cmp_no)
 Clear timer interrupt status of corresponding compare id. More...
 
void bflb_timer_capture_init (struct bflb_device_s *dev, const struct bflb_timer_capture_config_s *config)
 
uint32_t bflb_timer_capture_get_pulsewidth (struct bflb_device_s *dev)
 

Detailed Description

Function Documentation

◆ bflb_timer_capture_get_pulsewidth()

uint32_t bflb_timer_capture_get_pulsewidth ( struct bflb_device_s dev)

◆ bflb_timer_capture_init()

void bflb_timer_capture_init ( struct bflb_device_s dev,
const struct bflb_timer_capture_config_s config 
)

◆ bflb_timer_compint_clear()

void bflb_timer_compint_clear ( struct bflb_device_s dev,
uint8_t  cmp_no 
)

Clear timer interrupt status of corresponding compare id.

Parameters
[in]devdevice handle
[in]cmp_nocompare id, use timer compare id definition

◆ bflb_timer_compint_mask()

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.

Parameters
[in]devdevice handle
[in]cmp_nocompare id, use timer compare id definition
[in]masktrue means disable, false means enable

◆ bflb_timer_deinit()

void bflb_timer_deinit ( struct bflb_device_s dev)

Deinitialize timer.

Parameters
[in]devdevice handle

◆ bflb_timer_get_compint_status()

bool bflb_timer_get_compint_status ( struct bflb_device_s dev,
uint8_t  cmp_no 
)

Get timer interrupt status of corresponding compare id.

Parameters
[in]devdevice handle
[in]cmp_nocompare id, use timer compare id definition
Returns
true mean yes, otherwise no.

◆ bflb_timer_get_compvalue()

uint32_t bflb_timer_get_compvalue ( struct bflb_device_s dev,
uint8_t  cmp_no 
)

Get compare value of corresponding compare id.

Parameters
[in]devdevice handle
[in]cmp_nocompare id, use timer compare id definition
Returns
uint32_t

◆ bflb_timer_get_countervalue()

uint32_t bflb_timer_get_countervalue ( struct bflb_device_s dev)

Get timer counter value.

Parameters
[in]devdevice handle
Returns
counter value

◆ bflb_timer_init()

void bflb_timer_init ( struct bflb_device_s dev,
const struct bflb_timer_config_s config 
)

Initialize timer.

Parameters
[in]devdevice handle
[in]configpointer to save timer config

◆ bflb_timer_set_compvalue()

void bflb_timer_set_compvalue ( struct bflb_device_s dev,
uint8_t  cmp_no,
uint32_t  val 
)

Set compare value of corresponding compare id.

Parameters
[in]devdevice handle
[in]cmp_nocompare id, use timer compare id definition
[in]valcompare value

◆ bflb_timer_set_preloadvalue()

void bflb_timer_set_preloadvalue ( struct bflb_device_s dev,
uint32_t  val 
)

Set timer preload value.

Parameters
[in]devdevice handle
[in]valpreload value

◆ bflb_timer_start()

void bflb_timer_start ( struct bflb_device_s dev)

Start timer.

Parameters
[in]devdevice handle

◆ bflb_timer_stop()

void bflb_timer_stop ( struct bflb_device_s dev)

Stop timer.

Parameters
[in]devdevice handle