hal
Hardware Abstraction Layer
stm32f4_gpio.c File Reference

Implementation for toggling the red LED onboard the stm32f446re development board. More...

#include "stm32f4xx.h"
#include "gpio.h"
Include dependency graph for stm32f4_gpio.c:

Macros

#define GPIOAEN   (1U << 0)
 
#define PIN5   (1U << 5)
 
#define LED_PIN   (PIN5)
 

Functions

hal_status_t hal_gpio_init ()
 Initialize the module. Must be called only once prior to using toggle. More...
 
hal_status_t hal_gpio_toggle_led ()
 Toggle the onboard LED. More...
 

Detailed Description

Implementation for toggling the red LED onboard the stm32f446re development board.

Copyright (c) 2025 Cory McKiel. Licensed under the MIT License. See LICENSE file in the project root.

Macro Definition Documentation

◆ GPIOAEN

#define GPIOAEN   (1U << 0)

Bit to enable GPIO port A.

◆ LED_PIN

#define LED_PIN   (PIN5)

The onboard LED is wired to GPIO port A, pin 5.

◆ PIN5

#define PIN5   (1U << 5)

Pin five for GPIO port A.

Function Documentation

◆ hal_gpio_init()

hal_status_t hal_gpio_init ( )

Initialize the module. Must be called only once prior to using toggle.

Returns
HAL_STATUS_OK on success.

◆ hal_gpio_toggle_led()

hal_status_t hal_gpio_toggle_led ( )

Toggle the onboard LED.

Returns
HAL_STATUS_OK on success.