#include <stdint.h>
Macros | |
#define | WEAK_ALIAS __attribute__((weak, alias("Default_Handler"))) |
Weak aliases for all interrupt handlers to Default_Handler. |
Functions | |
int | main (void) |
Main entry point. | |
void | Default_Handler (void) |
Default handler used for all unimplemented interrupts. | |
void | Reset_Handler (void) |
Reset handler called at MCU startup. | |
void | NMI_Handler (void) |
Vector table placed in .isr_vector section. |
Variables | |
uint32_t | _sidata |
uint32_t | _sdata |
uint32_t | _edata |
uint32_t | _sbss |
uint32_t | _ebss |
uint32_t | _estack |
#define WEAK_ALIAS __attribute__((weak, alias("Default_Handler"))) |
Weak aliases for all interrupt handlers to Default_Handler.
void Default_Handler | ( | void | ) |
Default handler used for all unimplemented interrupts.
|
extern |
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).
Main entry point.
< Initialize SysTick with 1 ms tick
< Initialize UART2 at 9600 baud
< Send string over UART2
< Wait for 1 second
< Buffer to hold timer count as string
< Initialize SysTick with 1 ms tick
< Initialize UART2 at 9600 baud
< Initialize TIM5 with auto-reload 1e9
< Convert timer value to string
< Print label
< Print TIM5 counter value
< Newline and carriage return
< Initialize system clock with PLL
< Initialize SysTick with 1 ms tick
< Initialize UART2 at 9600 baud
Initialize TIM2, enable interrupt, attach callback
Initialize TIM3, enable interrupt, attach callback
Initialize TIM4, enable interrupt, attach callback
Initialize TIM5, enable interrupt, attach callback
Initialize TIM9, enable interrupt, attach callback
Optional debug prints uart2_write("SysTicks: "); uart2_write(hal_get_tick()); uart2_write(", Millis: "); uart2_write(timer_get_count(TIM5)); uart2_write("\n\r");
< Optional 1-second delay
< Initialize SysTick with 40 µs tick
< Initialize UART2 at 9600 baud
< Configure PA05 as output
< Initialize TIM5 with prescaler 0 and auto-reload 1e9
< Set PA05 HIGH
< Delay 500 ms
< Set PA05 LOW
< Delay 500 ms
< Print label
< Print system millis
< Newline and carriage return
< Initialize SysTick with 40 µs tick
< Initialize UART2 at 9600 baud
< Set PB10 as alternate function
< AF1 for TIM2_CH3
< Initialize PWM handle on TIM2, channel 3
< Init PWM at 15 kHz, 10% duty cycle
< Start PWM output
< Variable for duty cycle update
< Update PWM duty cycle
< Increment duty cycle by 1%
< Reset to 0% after 100%
< Print current duty cycle over UART2
< Newline and carriage return
< Delay 10 ms
< Initialize system clock with PLL
< Initialize SysTick with 40 µs tick
< Initialize UART2 at 9600 baud
< Print SYSCLK label
< Print system clock
< Print APB1CLK label
< Print APB1 clock
< Print APB2CLK label
< Print APB2 clock
< Print AHBCLK label
< Print AHB clock
< Newline
< Wait 1 second
< Initialize SysTick for delays
< Initialize UART2 at 9600 baud
< Stop execution if I2C init fails
< Wait for conversion (~4.5 ms for temperature)
< Assumes uart2_write_int exists
< Wait 1 second before next measurement
void NMI_Handler | ( | void | ) |
Vector table placed in .isr_vector section.
void Reset_Handler | ( | void | ) |
Reset handler called at MCU startup.
Reset handler for Cortex-M4.
Initializes the .data and .bss sections, enables interrupts, and calls the main application.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |