SimAVR
AVR Simulator
Watchdog

Data Structures

struct  avr_watchdog_t
 

Macros

#define AVR_IOCTL_WATCHDOG_RESET   AVR_IOCTL_DEF('w','d','t','r')
 
#define AVR_WATCHDOG_DECLARE(_WDSR, _vec)
 This helps declare a watchdog block into a core. More...
 
#define AVR_WATCHDOG_DECLARE_128(_WDSR, _vec)
 

Typedefs

typedef struct avr_watchdog_t avr_watchdog_t
 

Functions

void avr_watchdog_init (avr_t *avr, avr_watchdog_t *p)
 

Detailed Description

Macro Definition Documentation

#define AVR_IOCTL_WATCHDOG_RESET   AVR_IOCTL_DEF('w','d','t','r')
#define AVR_WATCHDOG_DECLARE (   _WDSR,
  _vec 
)
Value:
.watchdog = { \
.wdrf = AVR_IO_REGBIT(MCUSR, WDRF), \
.wdce = AVR_IO_REGBIT(_WDSR, WDCE), \
.wde = AVR_IO_REGBIT(_WDSR, WDE), \
.wdp = { AVR_IO_REGBIT(_WDSR, WDP0),AVR_IO_REGBIT(_WDSR, WDP1), \
AVR_IO_REGBIT(_WDSR, WDP2),AVR_IO_REGBIT(_WDSR, WDP3) }, \
.watchdog = { \
.enable = AVR_IO_REGBIT(_WDSR, WDIE), \
.raised = AVR_IO_REGBIT(_WDSR, WDIF), \
.vector = _vec, \
}, \
}
#define WDIE
#define WDCE
Definition: sim_mega16.c:23
#define WDIF
#define AVR_IO_REGBIT(_io, _bit)
Definition: sim_regbit.h:150

This helps declare a watchdog block into a core.

No guarantee it will work with all, but it works with the one we have right now

#define AVR_WATCHDOG_DECLARE_128 (   _WDSR,
  _vec 
)
Value:
.watchdog = { \
.wdrf = AVR_IO_REGBIT(MCUCSR, WDRF), \
.wdce = AVR_IO_REGBIT(_WDSR, WDCE), \
.wde = AVR_IO_REGBIT(_WDSR, WDE), \
.wdp = { AVR_IO_REGBIT(_WDSR, WDP0),AVR_IO_REGBIT(_WDSR, WDP1), \
AVR_IO_REGBIT(_WDSR, WDP2) }, \
.watchdog = { \
.enable = AVR_IO_REGBIT(_WDSR, 6), \
.raised = AVR_IO_REGBIT(_WDSR, 7), \
.vector = _vec, \
}, \
}
#define WDCE
Definition: sim_mega16.c:23
#define AVR_IO_REGBIT(_io, _bit)
Definition: sim_regbit.h:150

Typedef Documentation

Function Documentation

void avr_watchdog_init ( avr_t avr,
avr_watchdog_t p 
)

Here is the call graph for this function:

Here is the caller graph for this function: