这是最新(主)开发分支的文档。如果您正在查找以前版本的文档,使用左侧的下拉菜单选择所需的版本。

WDT API 参考

WDT

wm_device_t *wm_drv_wdt_init(char *dev_name)

Initialize WDT dev, and configure wdt based on the device tree.

参数:

dev_name[in] like “wdt”, if device tree set

返回:

  • device handle: device handle, used wm_device_t*

  • NULL: failed

int wm_drv_wdt_deinit(wm_device_t *dev)

Deinit wdt.

参数:

dev[in] use

  • wm_device_t

返回:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_start(wm_device_t *dev)

Start wdt.

参数:

dev[in] use

  • wm_device_t

返回:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_stop(wm_device_t *dev)

Stop wdt.

参数:

dev[in] use

  • wm_device_t

返回:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_set_counter_value(wm_device_t *dev, uint32_t counter_value)

Set wdt counter value.

参数:
  • dev[in] use

    • wm_device_t

  • counter_value[in] wdt counter value, unit:microseconds

返回:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_get_counter_value(wm_device_t *dev, uint32_t *counter_value)

Get wdt counter value.

参数:
  • dev[in] use

    • wm_device_t

  • counter_value[out] wdt counter value. the unit is microseconds, which needs to be divided by apb clock

返回:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_get_remaining_time(wm_device_t *dev, uint32_t *remaining_time)

Get wdt remaining time.

参数:
  • dev[in] use

    • wm_device_t

  • remaining_time[out] wdt remaining value

返回:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_feed(wm_device_t *dev)

Wdt feed.

参数:

dev[in] use

  • wm_device_t

返回:

  • WM_ERR_SUCCESS: succeed

  • others: failed