Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 3, 2019 03:34
Show Gist options
  • Save surinoel/4c4b8af1b8bb3676ae88fd2858a2cebd to your computer and use it in GitHub Desktop.
Save surinoel/4c4b8af1b8bb3676ae88fd2858a2cebd to your computer and use it in GitHub Desktop.
#include "gpio.h"
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_gpio.h"
void on_green_led(void)
{
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_13, GPIO_PIN_SET);
}
void off_green_led(void)
{
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_13, GPIO_PIN_RESET);
}
void blink_green_led(void)
{
on_green_led();
HAL_Delay(500);
off_green_led();
HAL_Delay(500);
}
void on_red_led(void)
{
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_14, GPIO_PIN_SET);
}
void off_red_led(void)
{
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_14, GPIO_PIN_RESET);
}
void blink_red_led(void)
{
on_red_led();
HAL_Delay(500);
off_red_led();
HAL_Delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment