wdt->clk_src_sel = LPC_WDT_CLK_WDOSC;
}
/* Use the windows functionnality ? */
- if (wd_conf->nb_clk_win > 0x100) {
- wdt->window_compare = (wd_conf->nb_clk_win & LPC_WDT_TIMER_MAX);
+ if (wd_conf->wdt_window > 0x100) {
+ wdt->window_compare = (wd_conf->wdt_window & LPC_WDT_TIMER_MAX);
} else {
wdt->window_compare = LPC_WDT_TIMER_MAX;
}
/* Warning interrupt ? */
- if (wd_conf->nb_clk_warn != 0) {
- if (wd_conf->nb_clk_warn > LPC_WDT_WARNINT_MAXVAL) {
+ if (wd_conf->wdt_warn != 0) {
+ if (wd_conf->wdt_warn > LPC_WDT_WARNINT_MAXVAL) {
wdt->warning_int_compare = LPC_WDT_WARNINT_MAXVAL;
} else {
- wdt->warning_int_compare = wd_conf->nb_clk_warn;
+ wdt->warning_int_compare = wd_conf->wdt_warn;
}
}
/* Protect any of the watchdog functions now ? */
int clk_sel;
int intr_mode_only; /* If set to 1, a watchdog timeout will trigger an interrupt instead of a reset */
uint32_t locks; /* Bitfield from WDT_*_LOCK defined in watchdog.h */
- uint32_t nb_clk; /* Watchdog timer reload value : 0x3FF to 0x03FFFFFF */
- uint32_t nb_clk_win; /* Watchdog window value : 0x100 to 0x00FFFFFF */
- uint16_t nb_clk_warn; /* 0x00 to 0x3FF */
+ /* Number of clk_src clocks before the watchdog timer times out. Will be divided by 4 to give
+ * the watchdog reload value */
+ uint32_t nb_clk; /* 0x3FF to 0x03FFFFFF */
+ /* The next two values are relative to the timer value, not the number of clk_src clocks. */
+ uint32_t wdt_window; /* Watchdog window value : 0x100 to 0x00FFFFFF */
+ uint16_t wdt_warn; /* 0x00 to 0x3FF */
};
/***************************************************************************** */