first commit

This commit is contained in:
Dana Markova
2025-07-28 13:21:36 +03:00
commit 0de214c9a1
547 changed files with 287132 additions and 0 deletions

18
drv/iwdg.cpp Normal file
View File

@ -0,0 +1,18 @@
#include "stm32g4xx.h"
#include "iwdg.h"
void InitIWDG(unsigned short Reload)
{
IWDG->KR=0x0000CCCC;
IWDG->KR=0x00005555;
IWDG->PR=0;
IWDG->RLR=Reload;
while(IWDG->SR) { asm volatile("NOP"); }
IWDG->KR=0x0000AAAA;
}
void PingIWDG()
{
IWDG->KR=0x0000AAAA;
}