Reinforced Safety Watchdog Timer (RSWDT) example for SAM.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | BLINK_PERIOD 300 |
LED blink time 300ms. More... | |
#define | PUSHBUTTON_FILTER_GLITCH_VAULE 10 |
PIO debounce filter parameters 10 Hz. More... | |
#define | RSWDT_PERIOD 3000 |
Reinforced Safety Watchdog period 3000ms. More... | |
#define | RSWDT_RESTART_PERIOD 2000 |
Reinforced Safety Watchdog restart 2000ms. More... | |
#define | STRING_EOL "\r" |
#define | STRING_HEADER |
Functions | |
static void | button_handler (uint32_t id, uint32_t mask) |
Handler for Button 1 rising edge interrupt. More... | |
static void | configure_button (void) |
Configure the Pushbutton. More... | |
static void | configure_console (void) |
Configure the Console UART. More... | |
static void | configure_led (void) |
Configure LED. More... | |
int | main (void) |
Application entry point for RSWDT example. More... | |
void | SysTick_Handler (void) |
Handler for System Tick interrupt. More... | |
void | WDT_Handler (void) |
Handler for reinforced safety watchdog interrupt.RSWDT and WDT are the same as the interrupt number. More... | |
Variables | |
volatile bool | g_b_button_event = false |
Pushbutton event flag. More... | |
volatile bool | g_b_systick_event = false |
System Tick event flag. More... | |
volatile uint32_t | g_ul_ms_ticks = 0 |
System tick increased by 1 every millisecond. More... | |
#define BLINK_PERIOD 300 |
LED blink time 300ms.
Referenced by main().
#define PUSHBUTTON_FILTER_GLITCH_VAULE 10 |
PIO debounce filter parameters 10 Hz.
Referenced by configure_button().
#define RSWDT_PERIOD 3000 |
Reinforced Safety Watchdog period 3000ms.
Referenced by main().
#define RSWDT_RESTART_PERIOD 2000 |
Reinforced Safety Watchdog restart 2000ms.
Referenced by main().
#define STRING_EOL "\r" |
#define STRING_HEADER |
Referenced by main().
|
static |
Handler for Button 1 rising edge interrupt.
Referenced by configure_button().
|
static |
Configure the Pushbutton.
References button_handler(), pio_configure(), pio_set_debounce_filter(), pmc_enable_periph_clk(), and PUSHBUTTON_FILTER_GLITCH_VAULE.
Referenced by main().
|
static |
Configure the Console UART.
References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().
Referenced by main().
|
static |
int main | ( | void | ) |
Application entry point for RSWDT example.
References BLINK_PERIOD, BOARD_FREQ_SLCK_XTAL, board_init(), configure_button(), configure_console(), configure_led(), pio_enable_interrupt(), rswdt_get_timeout_value(), rswdt_get_us_timeout_period(), rswdt_init(), RSWDT_INVALID_ARGUMENT, RSWDT_PERIOD, rswdt_restart(), RSWDT_RESTART_PERIOD, STRING_HEADER, sysclk_get_cpu_hz(), and sysclk_init().
void SysTick_Handler | ( | void | ) |
Handler for System Tick interrupt.
void WDT_Handler | ( | void | ) |
Handler for reinforced safety watchdog interrupt.RSWDT and WDT are the same as the interrupt number.
References rswdt_get_status(), and rswdt_restart().
volatile uint32_t g_ul_ms_ticks = 0 |
System tick increased by 1 every millisecond.