35 lines
668 B
C
35 lines
668 B
C
#ifndef WWDG_MOCK_H
|
|
#define WWDG_MOCK_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
// Stuff that we have globally.
|
|
|
|
typedef struct
|
|
{
|
|
bool is_enabled;
|
|
bool is_HSE;
|
|
uint32_t clock_rate;
|
|
} RISCV_APB_CLK;
|
|
|
|
/* Window WatchDog Registers*/
|
|
typedef struct
|
|
{
|
|
uint16_t CTLR; /* Control Register */
|
|
uint16_t RESERVED1;
|
|
uint16_t CFGR; /* Configuration Register */
|
|
uint16_t RESERVED2;
|
|
uint16_t STATR; /* Status Register */
|
|
} WWDG_TypeDef;
|
|
|
|
void wwdg_mock_setup(WWDG_TypeDef *wwdg);
|
|
|
|
void wwdg_mock_reset(void);
|
|
|
|
void wwdg_mock_clock_tick(void);
|
|
|
|
void wwdg_mock_tick_n_times(size_t n);
|
|
|
|
#endif // WWDG_MOCK_H
|