Added tests module for wwdg/mocks.
This commit is contained in:
parent
514c90cefe
commit
e1e6315f7f
2 changed files with 22 additions and 11 deletions
13
tests/wwdg/mocks/wwdg_hw.c
Normal file
13
tests/wwdg/mocks/wwdg_hw.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include "wwdg_hw.h"
|
||||||
|
|
||||||
|
|
||||||
|
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){};
|
||||||
|
|
@ -9,23 +9,21 @@
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
bool is_enabled;
|
bool is_enabled;
|
||||||
bool is_HSE;
|
bool is_HSE;
|
||||||
uint32_t clock_rate;
|
uint32_t clock_rate;
|
||||||
}RISCV_APB_CLK;
|
} RISCV_APB_CLK;
|
||||||
|
|
||||||
/* Window WatchDog Registers*/
|
/* Window WatchDog Registers*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint16_t CTLR; /* Control Register */
|
uint16_t CTLR; /* Control Register */
|
||||||
uint16_t RESERVED1;
|
uint16_t RESERVED1;
|
||||||
uint16_t CFGR; /* Configuration Register */
|
uint16_t CFGR; /* Configuration Register */
|
||||||
uint16_t RESERVED2;
|
uint16_t RESERVED2;
|
||||||
uint16_t STATR; /* Status Register */
|
uint16_t STATR; /* Status Register */
|
||||||
} WWDG_TypeDef;
|
} WWDG_TypeDef;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void wwdg_mock_setup(WWDG_TypeDef *wwdg);
|
void wwdg_mock_setup(WWDG_TypeDef *wwdg);
|
||||||
|
|
||||||
void wwdg_mock_reset(void);
|
void wwdg_mock_reset(void);
|
||||||
|
|
@ -34,4 +32,4 @@ void wwdg_mock_clock_tick(void);
|
||||||
|
|
||||||
void wwdg_mock_tick_n_times(size_t n);
|
void wwdg_mock_tick_n_times(size_t n);
|
||||||
|
|
||||||
#endif //WWDG_MOCK_H
|
#endif // WWDG_MOCK_H
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue