WDT

WDT API Status

WDT API Reference

Header File

Functions

bk_err_t bk_wdt_driver_init(void)

Init the WDT driver.

This API init the resoure common:

  • Init WDT driver control memory

Attention

1. This API should be called before any other WDT APIs.

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_wdt_driver_deinit(void)

Deinit the WDT driver.

This API free all resource related to WDT and power down WDT.

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_wdt_start(uint32_t timeout_ms)

Start the WDT.

This API start the WDT:

  • Power up the WDT

  • Init the watch dog timer period

参数

timeout_ms – WDT period

返回

  • BK_OK: succeed

  • BK_ERR_WDT_DRIVER_NOT_INIT: WDT driver not init

  • BK_ERR_WDT_INVALID_PERIOD: WDT invalid period

  • others: other errors.

bk_err_t bk_wdt_stop(void)

Stop the WDT.

This API stop the WDT:

  • Reset all configuration of WDT to default value

  • Power down the WDT

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_wdt_feed(void)

Feed the WDT.

返回

  • BK_OK: succeed

  • others: other errors.

uint32_t bk_wdt_get_feed_time(void)

Get feed watchdog time.

返回

  • BK_OK: succeed

  • others: other errors.

void bk_wdt_set_feed_time(uint32_t dw_set_time)

set feed watchdog time

返回

  • NULL

bool bk_wdt_is_driver_inited(void)

Get wdt driver init flag.

返回

  • BK_OK: succeed

  • others: other errors.

WDT API Typedefs

Header File

Macros

BK_ERR_WDT_DRIVER_NOT_INIT

WDT driver not init

BK_ERR_WDT_NOT_INIT

WDT not init

BK_ERR_WDT_INVALID_PERIOD

WDT invalid period

BK_ERR_WDT_DEBUG_DISABLED

WDT disabled via cmdline flag

Header File

Type Definitions

typedef uint8_t wdt_unit_t

wdt uint id