watchdog 2.0.0.0
Watchdog Click Driver

API for configuring and manipulating Watchdog Click driver. More...

Topics

 Watchdog Registers Settings
 Settings for registers of Watchdog Click driver.
 
 Watchdog MikroBUS Map
 MikroBUS pin mapping of Watchdog Click driver.
 

Functions

void watchdog_cfg_setup (watchdog_cfg_t *cfg)
 Watchdog configuration object setup function.
 
err_t watchdog_init (watchdog_t *ctx, watchdog_cfg_t *cfg)
 Watchdog initialization function.
 
err_t watchdog_default_cfg (watchdog_t *ctx)
 Watchdog default configuration function.
 
void watchdog_set_set0 (watchdog_t *ctx, uint8_t set0_state)
 Set S0 ( RST ) pin state function.
 
void watchdog_set_set1 (watchdog_t *ctx, uint8_t set1_state)
 Set S1 ( CS ) pin state function.
 
void watchdog_set_wdi (watchdog_t *ctx, uint8_t wdi_state)
 Set WDI ( PWM ) pin state function.
 
uint8_t watchdog_get_wdo (watchdog_t *ctx)
 Get WDO ( INT ) pin state function.
 
void watchdog_send_pulse (watchdog_t *ctx, uint16_t p_duration_ms)
 Send pulse function.
 
void watchdog_setup_time (watchdog_t *ctx, uint8_t setup_time_mode)
 Set the watchdog time function.
 

Detailed Description

API for configuring and manipulating Watchdog Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ watchdog_cfg_setup()

void watchdog_cfg_setup ( watchdog_cfg_t * cfg)

Watchdog configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See watchdog_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ watchdog_default_cfg()

err_t watchdog_default_cfg ( watchdog_t * ctx)

Watchdog default configuration function.

This function executes a default configuration of Watchdog click board.

Parameters
[in]ctx: Click context object. See watchdog_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ watchdog_get_wdo()

uint8_t watchdog_get_wdo ( watchdog_t * ctx)

Get WDO ( INT ) pin state function.

The function check the state of the WDO ( INT ) which is the pulse sending indicator in the watchdog timeout occurs to the TPS3430 Window Watchdog Timer with Programmable Reset Delay on the Watchdog click board.

Parameters
[in]ctx: Click context object. See watchdog_t object definition for detailed explanation.
Returns
  • 0 - Fault,
  • 1 - Correct Operation.

◆ watchdog_init()

err_t watchdog_init ( watchdog_t * ctx,
watchdog_cfg_t * cfg )

Watchdog initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See watchdog_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See watchdog_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ watchdog_send_pulse()

void watchdog_send_pulse ( watchdog_t * ctx,
uint16_t p_duration_ms )

Send pulse function.

The function sends a pulse with the desired pulse duration to the TPS3430 Window Watchdog Timer with Programmable Reset Delay on the Watchdog click board.

Parameters
[in]ctx: Click context object. See watchdog_t object definition for detailed explanation.
[in]p_duration_ms: The desired pulse duration time in milliseconds.
Returns
Nothing.
Note
Minimum WDI pulse duration is 50 microseconds.

◆ watchdog_set_set0()

void watchdog_set_set0 ( watchdog_t * ctx,
uint8_t set0_state )

Set S0 ( RST ) pin state function.

The function set the state of the S0 ( RST ) to configure a valid window watchdog ratio of the TPS3430 Window Watchdog Timer with Programmable Reset Delay on the Watchdog click board.

Parameters
[out]ctx: Click context object. See watchdog_t object definition for detailed explanation.
set0_state
  • 0 : Low state.
  • 1 : High state.
Returns
Nothing.

◆ watchdog_set_set1()

void watchdog_set_set1 ( watchdog_t * ctx,
uint8_t set1_state )

Set S1 ( CS ) pin state function.

The function set the state of the S1 ( CS ) to configure a valid window watchdog ratio of the TPS3430 Window Watchdog Timer with Programmable Reset Delay on the Watchdog click board.

Parameters
[out]ctx: Click context object. See watchdog_t object definition for detailed explanation.
set1_state
  • 0 : Low state.
  • 1 : High state.
Returns
Nothing.

◆ watchdog_set_wdi()

void watchdog_set_wdi ( watchdog_t * ctx,
uint8_t wdi_state )

Set WDI ( PWM ) pin state function.

The function set the state of the WDI ( PWM ) which is used to send a pulse to the TPS3430 Window Watchdog Timer with Programmable Reset Delay on the Watchdog click board.

Parameters
[out]ctx: Click context object. See watchdog_t object definition for detailed explanation.
wdi_state
  • 0 : Low state.
  • 1 : High state.
Returns
Nothing.

◆ watchdog_setup_time()

void watchdog_setup_time ( watchdog_t * ctx,
uint8_t setup_time_mode )

Set the watchdog time function.

The function set the desired watchdog operating mode of the TPS3430 Window Watchdog Timer with Programmable Reset Delay on the Watchdog click board.

Parameters
[in]ctx: Click context object. See watchdog_t object definition for detailed explanation.
[in]setup_time_mode: Mode in witch Watchdog Click bord is working.
Returns
Nothing.
Note
For more information on Timing Requirements, please see the TPS3430 datasheet.