#include <stdint.h>
Macros | |
| #define | RCC_AHB1ENR (*(volatile uint32_t*)0x40023830) |
| < Include for uint32_t, optional if using std types | |
| #define | GPIOA_MODER (*(volatile uint32_t*)0x40020000) |
| GPIOA mode register. | |
| #define | GPIOA_ODR (*(volatile uint32_t*)0x40020014) |
| GPIOA output data register. | |
Functions | |
| void | delay (void) |
| Simple delay loop. | |
| int | main (void) |
| Main entry point. | |
| #define GPIOA_MODER (*(volatile uint32_t*)0x40020000) |
GPIOA mode register.
Address: 0x40020000
MODER5 (bits 11:10) control mode of PA5
| #define GPIOA_ODR (*(volatile uint32_t*)0x40020014) |
GPIOA output data register.
Address: 0x40020014
Bit 5 controls the output level of PA5
| #define RCC_AHB1ENR (*(volatile uint32_t*)0x40023830) |
< Include for uint32_t, optional if using std types
RCC AHB1 peripheral clock enable register
Address: 0x40023830
Bit 0: GPIOAEN - Enable clock for GPIOA
| void delay | ( | void | ) |
Simple delay loop.
A crude delay function using a for loop. Not precise; use timers for accurate delays.
| int main | ( | void | ) |
Main entry point.
Initializes GPIOA pin 5 as output and toggles it in an infinite loop. Typically connected to an LED (e.g., onboard LED on Nucleo boards).