Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Function

This section provides high level APIs to upper layer. More...

Overview

This section provides high level APIs to upper layer.

Functions

void mtk_os_hal_wdt_enable (void)
 This function is used to enable WDT. More...
 
void mtk_os_hal_wdt_disable (void)
 This function is used to disable WDT. More...
 
int mtk_os_hal_wdt_set_timeout (unsigned int sec)
 This function is used to set WDT timeout value. More...
 
void mtk_os_hal_wdt_restart (void)
 This function is used to restart WDT counter. More...
 
void mtk_os_hal_wdt_sw_reset (void)
 This function is used to reset the M4 core immediately by WDT software reset. More...
 
void mtk_os_hal_wdt_hw_reset (void)
 This function is used to reset the M4 core immediately by WDT counter timeout. More...
 
enum os_wdt_rst_sta mtk_os_hal_wdt_get_reset_status (void)
 This function is used to get core last reset status value. More...
 
void mtk_os_hal_wdt_config (enum os_wdt_mode mode)
 This function is used to config WDT irq mode. More...
 
void mtk_os_hal_wdt_register_irq (struct os_wdt_int *wdt_int)
 This function is used to register user interrupt handle for WDT. More...
 
void mtk_os_hal_wdt_init (void)
 This function is used to initialize WDT device(with disable WDT) and to make WDT driver effective. More...
 

Function Documentation

void mtk_os_hal_wdt_enable ( void  )

This function is used to enable WDT.

Parameters
None
Returns
None
void mtk_os_hal_wdt_disable ( void  )

This function is used to disable WDT.

Parameters
None
Returns
None
int mtk_os_hal_wdt_set_timeout ( unsigned int  sec)

This function is used to set WDT timeout value.

Parameters
[in]sec: WDT timeout value(unit: second). It should be less then 64 second.
Returns
None
void mtk_os_hal_wdt_restart ( void  )

This function is used to restart WDT counter.

Parameters
None
Returns
None
void mtk_os_hal_wdt_sw_reset ( void  )

This function is used to reset the M4 core immediately by WDT software reset.

Once this API been invoked, the M4 core will reboot immediately. mtk_os_hal_wdt_init() and mtk_os_hal_wdt_get_reset_status() could be invoked later to get the reboot reason. This API is usually used when M4 APP trigger reboot.

Parameters
None
Returns
None
void mtk_os_hal_wdt_hw_reset ( void  )

This function is used to reset the M4 core immediately by WDT counter timeout.

Once this API been invoked, the M4 core will reboot immediately. mtk_os_hal_wdt_init() and mtk_os_hal_wdt_get_reset_status() could be invoked later to get the reboot reason. This API is usually been invoked in WDT irq handler.

Parameters
None
Returns
None
enum os_wdt_rst_sta mtk_os_hal_wdt_get_reset_status ( void  )

This function is used to get core last reset status value.

The status is only valid if mtk_os_hal_wdt_init() has been called.

Parameters
None
Returns
OS_WDT_NONE_RST: system boots normally in this time.
OS_WDT_SW_RST: system reboots by WDT swrst.
OS_WDT_HW_RST: system reboots by WDT counter timeout.
void mtk_os_hal_wdt_config ( enum os_wdt_mode  mode)

This function is used to config WDT irq mode.

OS_WDT_TRIGGER_IRQ means IRQ will be triggered when WDT timeout, while OS_WDT_TRIGGER_RESET means the M4 core will be reset immediately when WDT timeout.

Parameters
[in]irq: config WDT to trigger irq(input OS_WDT_TRIGGER_IRQ), or trigger reset(input OS_WDT_TRIGGER_RESET)
Returns
None
void mtk_os_hal_wdt_register_irq ( struct os_wdt_int wdt_int)

This function is used to register user interrupt handle for WDT.

Parameters
[in]wdt_int: a pointer of struct os_wdt_int to register user interrupt handle(wdt_cb_hdl) and callback data(wdt_cb_data). When WDT interrupt is triggered, wdt_cb_hdl(wdt_cb_data) will be called without any other process. If wdt_int is NULL, a default interrupt handle will be registered which will cause system reset after WDT interruption.
Returns
None
void mtk_os_hal_wdt_init ( void  )

This function is used to initialize WDT device(with disable WDT) and to make WDT driver effective.

Internal assurance that it will only be executed only one time effectively.

Parameters
None
Returns
None