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

Example: Multiple timers with callbacks and UART output. More...

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

Macros

#define CORTEX_M4

Functions

void print2 (void)
void print3 (void)
void print4 (void)
void print5 (void)
void print6 (void)
void print7 (void)
void print9 (void)
void print12 (void)
int main (void)

Variables

hal_pll_config_t pll_cfg
hal_clock_config_t cfg = {.source = HAL_CLOCK_SOURCE_HSI}

Detailed Description

Example: Multiple timers with callbacks and UART output.

This example demonstrates:

  • Configuring the system clock using HSI or PLL.
  • Initializing SysTick timer with 1 ms tick.
  • Initializing UART2 at 9600 baud for console output.
  • Setting up TIM2, TIM3, TIM4, TIM5, and TIM9 timers with interrupts.
  • Attaching callbacks to each timer to print messages via UART2.

© 2025 NAVROBOTEC PVT. LTD. All rights reserved.

Macro Definition Documentation

◆ CORTEX_M4

#define CORTEX_M4

Function Documentation

◆ main()

int main ( void )

< 1 ms tick

< UART2 at 9600 baud

< 1-second delay

◆ print12()

void print12 ( void )

◆ print2()

void print2 ( void )

◆ print3()

void print3 ( void )

◆ print4()

void print4 ( void )

◆ print5()

void print5 ( void )

◆ print6()

void print6 ( void )

◆ print7()

void print7 ( void )

◆ print9()

void print9 ( void )

Variable Documentation

◆ cfg

Use HSI as system clock

◆ pll_cfg

PLL config (unused if HSI)