Files
Colibri/dev/led.cpp
Dana Markova 748830dfb7 add firmware
2025-07-28 12:43:33 +03:00

21 lines
506 B
C++

#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;
}
//------------------------------------------------------------------------------