add firmware

This commit is contained in:
Dana Markova
2025-07-28 12:43:33 +03:00
parent 6cf2747ec9
commit 748830dfb7
84 changed files with 40709 additions and 0 deletions

20
dev/led.cpp Normal file
View File

@ -0,0 +1,20 @@
#include "stm32g4xx.h"
#include "gpio.h"
#include "led.h"
void LED_Init()
{
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN;
GPIO_InitPin(GPIO_PIN_15 | GPIO_PORT_A | GPIO_OUTPUT);
GPIO_InitPin(GPIO_PIN_14 | GPIO_PORT_B | GPIO_OUTPUT);
}
//------------------------------------------------------------------------------
void LED_Set(bool Set)
{
if (Set) GPIOA->BSRR = GPIO_BSRR_BS_15;
else GPIOA->BSRR = GPIO_BSRR_BR_15;
}
//------------------------------------------------------------------------------