nRF51 SDK - S110 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

WDT driver. More...

Data Structures

struct  nrf_drv_wdt_config_t
 Struct for WDT initialization. More...
 

Macros

#define NRF_DRV_WDT_DEAFULT_CONFIG
 

Typedefs

typedef void(* nrf_wdt_event_handler_t )(void)
 WDT event handler function type.
 
typedef nrf_wdt_rr_register_t nrf_drv_wdt_channel_id
 WDT channel id type.
 

Functions

ret_code_t nrf_drv_wdt_init (nrf_drv_wdt_config_t const *p_config, nrf_wdt_event_handler_t wdt_event_handler)
 This function initializes watchdog. More...
 
ret_code_t nrf_drv_wdt_channel_alloc (nrf_drv_wdt_channel_id *p_channel_id)
 This function allocate watchdog channel. More...
 
void nrf_drv_wdt_enable (void)
 This function starts watchdog. More...
 
void nrf_drv_wdt_feed (void)
 This function feeds the watchdog. More...
 
void nrf_drv_wdt_channel_feed (nrf_drv_wdt_channel_id channel_id)
 This function feeds the invidual watchdog channel. More...
 
__STATIC_INLINE uint32_t nrf_drv_wdt_ppi_task_addr (nrf_wdt_tasks_t task)
 Function for returning a requested task address for the wdt driver module. More...
 
__STATIC_INLINE uint32_t nrf_drv_wdt_ppi_event_addr (nrf_wdt_events_t event)
 Function for returning a requested event address for the wdt driver module. More...
 

Detailed Description

WDT driver.

Macro Definition Documentation

#define NRF_DRV_WDT_DEAFULT_CONFIG
Value:
{ \
.behaviour = WDT_CONFIG_BEHAVIOUR, \
.reload_value = WDT_CONFIG_RELOAD_VALUE, \
.interrupt_priority = WDT_CONFIG_IRQ_PRIORITY, \
}

Function Documentation

ret_code_t nrf_drv_wdt_channel_alloc ( nrf_drv_wdt_channel_id p_channel_id)

This function allocate watchdog channel.

Note
This function can not be called after nrf_drv_wdt_start(void).
Parameters
[out]p_channel_idID of granted channel.
Returns
NRF_SUCCESS on success, otherwise an error code.
void nrf_drv_wdt_channel_feed ( nrf_drv_wdt_channel_id  channel_id)

This function feeds the invidual watchdog channel.

Parameters
[in]channel_idID of watchdog channel.
void nrf_drv_wdt_enable ( void  )

This function starts watchdog.

Note
After calling this function the watchdog is started, so the user needs to feed all allocated watchdog channels to avoid reset. At least one watchdog channel has to be allocated.
void nrf_drv_wdt_feed ( void  )

This function feeds the watchdog.

Function feeds all allocated watchdog channels.

ret_code_t nrf_drv_wdt_init ( nrf_drv_wdt_config_t const *  p_config,
nrf_wdt_event_handler_t  wdt_event_handler 
)

This function initializes watchdog.

Parameters
[in]p_configInitial configuration. Default configuration used if NULL.
[in]wdt_event_handlerspecifies event handler provided by user.
Note
Function asserts if wdt_event_handler is NULL.
Returns
NRF_SUCCESS on success, NRF_ERROR_INVALID_STATE if module ws already initialized.
__STATIC_INLINE uint32_t nrf_drv_wdt_ppi_event_addr ( nrf_wdt_events_t  event)

Function for returning a requested event address for the wdt driver module.

Parameters
[in]eventOne of the peripheral events.
Return values
Eventaddress
__STATIC_INLINE uint32_t nrf_drv_wdt_ppi_task_addr ( nrf_wdt_tasks_t  task)

Function for returning a requested task address for the wdt driver module.

Parameters
[in]taskOne of the peripheral tasks.
Return values
Taskaddress.