This is the documentation for the latest (main) development branch. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

WDT API Reference

WDT

wm_device_t *wm_drv_wdt_init(char *dev_name)

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

Parameters:

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

Returns:

  • device handle: device handle, used @wm_device_t

  • NULL: failed

int wm_drv_wdt_deinit(wm_device_t *dev)

Deinit wdt.

Parameters:

dev[in] use

Returns:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_start(wm_device_t *dev)

Start wdt.

Parameters:

dev[in] use

Returns:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_stop(wm_device_t *dev)

Stop wdt.

Parameters:

dev[in] use

Returns:

  • 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.

Parameters:
  • dev[in] use

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

Returns:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_get_counter_value(wm_device_t *dev, uint32_t *counter_value)

Set wdt counter value.

Parameters:
  • dev[in] use

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

Returns:

  • 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.

Parameters:
  • dev[in] use

  • remaining_time[out] wdt remaining value

Returns:

  • WM_ERR_SUCCESS: succeed

  • others: failed

int wm_drv_wdt_feed(wm_device_t *dev)

Wdt feed.

Parameters:

dev[in] use

Returns:

  • WM_ERR_SUCCESS: succeed

  • others: failed