NavHAL 0.1.0
NAVRobotec's architecture-agnostic HAL for embedded systems.
Loading...
Searching...
No Matches
main.c File Reference

Blink LED on PA05 and print system millis over UART2. More...

#include "navhal.h"
Include dependency graph for main.c:

Macros

#define CORTEX_M4

Functions

int main (void)

Detailed Description

Blink LED on PA05 and print system millis over UART2.

This example demonstrates:

  • Initializing SysTick timer with 40 µs tick.
  • Configuring GPIO PA05 as output for LED control.
  • Initializing UART2 at 9600 baud for console output.
  • Initializing TIM5 timer (prescaler 0, auto-reload 1e9).
  • Toggling LED and printing system millis in an infinite loop.

© 2025 NAVROBOTEC PVT. LTD. All rights reserved.

Macro Definition Documentation

◆ CORTEX_M4

#define CORTEX_M4

Function Documentation

◆ main()

int main ( void )

< 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