| M480 BSP V3.05.001 The Board Support Package for M480 Series

Macros | Functions
WDT Exported Functions
Standard Driver » WDT Driver

## Macros
#define | WDT_CLEAR_RESET_FLAG()
| Clear WDT Reset System Flag. More...
#define | WDT_CLEAR_TIMEOUT_INT_FLAG()
| Clear WDT Time-out Interrupt Flag. More...
#define | WDT_CLEAR_TIMEOUT_WAKEUP_FLAG()
| Clear WDT Wake-up Flag. More...
#define | WDT_GET_RESET_FLAG()
| Get WDT Time-out Reset Flag. More...
#define | WDT_GET_TIMEOUT_INT_FLAG()
| Get WDT Time-out Interrupt Flag. More...
#define | WDT_GET_TIMEOUT_WAKEUP_FLAG()
| Get WDT Time-out Wake-up Flag. More...
#define | WDT_RESET_COUNTER()
| Reset WDT Counter. More...

## Functions
__STATIC_INLINE void | WDT_Close (void)
| Stop WDT Counting. More...
__STATIC_INLINE void | WDT_EnableInt (void)
| Enable WDT Time-out Interrupt. More...
__STATIC_INLINE void | WDT_DisableInt (void)
| Disable WDT Time-out Interrupt. More...
void | WDT_Open (uint32_t u32TimeoutInterval, uint32_t u32ResetDelay, uint32_t u32EnableReset, uint32_t u32EnableWakeup)
| Initialize WDT and start counting. More...

## Detailed Description

## Macro Definition Documentation

## ◆ WDT_CLEAR_RESET_FLAG

#define WDT_CLEAR_RESET_FLAG | ( |  | ) |

Clear WDT Reset System Flag.

Parameters

  None |

Returns
  None

This macro clears WDT time-out reset system flag.

Definition at line 71 of file wdt.h.

## ◆ WDT_CLEAR_TIMEOUT_INT_FLAG

#define WDT_CLEAR_TIMEOUT_INT_FLAG | ( |  | ) |

Clear WDT Time-out Interrupt Flag.

Parameters

  None |

Returns
  None

This macro clears WDT time-out interrupt flag.

Definition at line 83 of file wdt.h.

## ◆ WDT_CLEAR_TIMEOUT_WAKEUP_FLAG

#define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG | ( |  | ) |

Clear WDT Wake-up Flag.

Parameters

  None |

Returns
  None

This macro clears WDT time-out wake-up system flag.

Definition at line 95 of file wdt.h.

## ◆ WDT_GET_RESET_FLAG

#define WDT_GET_RESET_FLAG | ( |  | ) |

Get WDT Time-out Reset Flag.

Parameters

  None |

Return values

  0 | WDT time-out reset system did not occur
  1 | WDT time-out reset system occurred

This macro indicates system has been reset by WDT time-out reset or not.

Definition at line 108 of file wdt.h.

## ◆ WDT_GET_TIMEOUT_INT_FLAG

#define WDT_GET_TIMEOUT_INT_FLAG | ( |  | ) |

Get WDT Time-out Interrupt Flag.

Parameters

  None |

Return values

  0 | WDT time-out interrupt did not occur
  1 | WDT time-out interrupt occurred

This macro indicates WDT time-out interrupt occurred or not.

Definition at line 121 of file wdt.h.

## ◆ WDT_GET_TIMEOUT_WAKEUP_FLAG

#define WDT_GET_TIMEOUT_WAKEUP_FLAG | ( |  | ) |

Get WDT Time-out Wake-up Flag.

Parameters

  None |

Return values

  0 | WDT time-out interrupt does not cause CPU wake-up
  1 | WDT time-out interrupt event cause CPU wake-up

This macro indicates WDT time-out interrupt event has waked up system or not.

Definition at line 134 of file wdt.h.

## ◆ WDT_RESET_COUNTER

#define WDT_RESET_COUNTER | ( |  | ) |

Reset WDT Counter.

Parameters

  None |

Returns
  None

This macro is used to reset the internal 18-bit WDT up counter value.

Note
  If WDT is activated and time-out reset system function is enabled also, user should
  reset the 18-bit WDT up counter value to avoid generate WDT time-out reset signal to
  reset system before the WDT time-out reset delay period expires.

Definition at line 149 of file wdt.h.

## Function Documentation

## ◆ WDT_Close()

__STATIC_INLINE void WDT_Close | ( | void |  | ) |

Stop WDT Counting.

Parameters

  None |

Returns
  None

This function will stop WDT counting and disable WDT module.

Definition at line 165 of file wdt.h.

## ◆ WDT_DisableInt()

__STATIC_INLINE void WDT_DisableInt | ( | void |  | ) |

Disable WDT Time-out Interrupt.

Parameters

  None |

Returns
  None

This function will disable the WDT time-out interrupt function.

Definition at line 195 of file wdt.h.

## ◆ WDT_EnableInt()

__STATIC_INLINE void WDT_EnableInt | ( | void |  | ) |

Enable WDT Time-out Interrupt.

Parameters

  None |

Returns
  None

This function will enable the WDT time-out interrupt function.

Definition at line 180 of file wdt.h.

## ◆ WDT_Open()

void WDT_Open | ( | uint32_t | u32TimeoutInterval,
|  | uint32_t | u32ResetDelay,
|  | uint32_t | u32EnableReset,
|  | uint32_t | u32EnableWakeup
| ) |  |

Initialize WDT and start counting.

Parameters

  [in] | u32TimeoutInterval | Time-out interval period of WDT module. Valid values are: WDT_TIMEOUT_2POW4 WDT_TIMEOUT_2POW6 WDT_TIMEOUT_2POW8 WDT_TIMEOUT_2POW10 WDT_TIMEOUT_2POW12 WDT_TIMEOUT_2POW14 WDT_TIMEOUT_2POW16 WDT_TIMEOUT_2POW18
  [in] | u32ResetDelay | Configure WDT time-out reset delay period. Valid values are: WDT_RESET_DELAY_1026CLK WDT_RESET_DELAY_130CLK WDT_RESET_DELAY_18CLK WDT_RESET_DELAY_3CLK
  [in] | u32EnableReset | Enable WDT time-out reset system function. Valid values are TRUE and FALSE.
  [in] | u32EnableWakeup | Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE.

Returns
  None

This function makes WDT module start counting with different time-out interval, reset delay period and choose to
enable or disable WDT time-out reset system or wake-up system.

Note
  Please make sure that Register Write-Protection Function has been disabled before using this function.

Definition at line 50 of file wdt.c.