iSensor-SPI-Buffer  1.15
Firmware for the iSensor-SPI-Buffer board to enable full throughput buffered data capture on Analog Devices IMUs
Functions
watchdog.c File Reference

iSensor-SPI-Buffer watchdog reset timer module implementation More...

#include "reg.h"
#include "watchdog.h"
#include "stm32f3xx_hal.h"
#include "stm32f303xe.h"
Include dependency graph for watchdog.c:

Functions

void Watchdog_Feed ()
 Feeds the watchdog timer. Should be called periodically from main loop. More...
 
void Watchdog_Check_Status ()
 Check if system reset from independent watch dog timeout and sets the appropriate STATUS flag. More...
 
void Watchdog_Enable (uint32_t timeout_ms)
 Enables watch dog reset functionality. More...
 

Detailed Description

iSensor-SPI-Buffer watchdog reset timer module implementation

Copyright (c) Analog Devices Inc, 2020 All Rights Reserved.

Date
4/30/2020
Author
A. Nolan (alex..nosp@m.nola.nosp@m.n@ana.nosp@m.log..nosp@m.com)

Function Documentation

◆ Watchdog_Check_Status()

void Watchdog_Check_Status ( )

Check if system reset from independent watch dog timeout and sets the appropriate STATUS flag.

Returns
void
Here is the caller graph for this function:

◆ Watchdog_Enable()

void Watchdog_Enable ( uint32_t  timeout_ms)

Enables watch dog reset functionality.

Parameters
timeout_msThe watch dog reset time (in ms)

This functions calculates the watch dog time base based on desired timeout, to give the best granularity. The STM32 independent watch dog peripheral runs on a 40KHz RC oscillator. This 40KHz clock can be divided down in range 4 - 256. The watchdog itself resets the system when the watchdog timer reaches a value of 0 (12 bit counter).

Min timeout (highest resolution): 4095 / (40KHz / 4) -> 0.410s

Max timeout: 4095 / (40KHz / 256) -> 26.2s

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Watchdog_Feed()

void Watchdog_Feed ( )

Feeds the watchdog timer. Should be called periodically from main loop.

Returns
void

If this function is not called within the reset period, the watchdog timer will trip and force a system reset. Default watchdog timeout is 2s, which should be significantly longer than any operation execution time in firmware.

Here is the caller graph for this function: