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

Modules

 Watch-dog reset/interrupt mode definition
 

Data Structures

struct  bflb_wdg_config_s
 WDG configuration structure. More...
 

Macros

#define WDG_CLKSRC_BCLK   0
 
#define WDG_CLKSRC_32K   1
 
#define WDG_CLKSRC_1K   2
 
#define WDG_CLKSRC_XTAL   3
 
#define WDG_CLKSRC_GPIO   4
 
#define WDG_CLKSRC_NO   5
 

Functions

void bflb_wdg_init (struct bflb_device_s *dev, const struct bflb_wdg_config_s *config)
 Initialize watchdog. More...
 
void bflb_wdg_start (struct bflb_device_s *dev)
 Start watchdog. More...
 
void bflb_wdg_stop (struct bflb_device_s *dev)
 Stop watchdog. More...
 
uint16_t bflb_wdg_get_countervalue (struct bflb_device_s *dev)
 Get watchdog counter value. More...
 
void bflb_wdg_set_countervalue (struct bflb_device_s *dev, uint16_t value)
 Set watchdog counter value. More...
 
void bflb_wdg_reset_countervalue (struct bflb_device_s *dev)
 Reset watchdog counter value. More...
 
void bflb_wdg_compint_clear (struct bflb_device_s *dev)
 Clear watchdog compare interrupt status. More...
 

Detailed Description

Macro Definition Documentation

◆ WDG_CLKSRC_1K

#define WDG_CLKSRC_1K   2

Definition at line 18 of file bflb_wdg.h.

◆ WDG_CLKSRC_32K

#define WDG_CLKSRC_32K   1

Definition at line 17 of file bflb_wdg.h.

◆ WDG_CLKSRC_BCLK

#define WDG_CLKSRC_BCLK   0

Definition at line 15 of file bflb_wdg.h.

◆ WDG_CLKSRC_GPIO

#define WDG_CLKSRC_GPIO   4

Definition at line 21 of file bflb_wdg.h.

◆ WDG_CLKSRC_NO

#define WDG_CLKSRC_NO   5

Definition at line 23 of file bflb_wdg.h.

◆ WDG_CLKSRC_XTAL

#define WDG_CLKSRC_XTAL   3

Definition at line 19 of file bflb_wdg.h.

Function Documentation

◆ bflb_wdg_compint_clear()

void bflb_wdg_compint_clear ( struct bflb_device_s dev)

Clear watchdog compare interrupt status.

Parameters
[in]devdevice handle

◆ bflb_wdg_get_countervalue()

uint16_t bflb_wdg_get_countervalue ( struct bflb_device_s dev)

Get watchdog counter value.

Parameters
[in]devdevice handle
Returns
counter value

◆ bflb_wdg_init()

void bflb_wdg_init ( struct bflb_device_s dev,
const struct bflb_wdg_config_s config 
)

Initialize watchdog.

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

◆ bflb_wdg_reset_countervalue()

void bflb_wdg_reset_countervalue ( struct bflb_device_s dev)

Reset watchdog counter value.

Parameters
[in]devdevice handle

◆ bflb_wdg_set_countervalue()

void bflb_wdg_set_countervalue ( struct bflb_device_s dev,
uint16_t  value 
)

Set watchdog counter value.

Parameters
[in]devdevice handle
[in]countervalue

◆ bflb_wdg_start()

void bflb_wdg_start ( struct bflb_device_s dev)

Start watchdog.

Parameters
[in]devdevice handle

◆ bflb_wdg_stop()

void bflb_wdg_stop ( struct bflb_device_s dev)

Stop watchdog.

Parameters
[in]devdevice handle