STM32 Traffic Control
Loading...
Searching...
No Matches
uart.h File Reference

Public API for UART2 peripheral. More...

#include <stdint.h>
#include "stm32f446xx.h"

Go to the source code of this file.

Macros

#define LOG(fmt, ...)
 Format for printf.

Functions

void uart2_init (void)
 Initialize UART2 peripheral.
void uart2_write (int ch)
 Transmit a single character over UART2.

Detailed Description

Public API for UART2 peripheral.

Macro Definition Documentation

◆ LOG

#define LOG ( fmt,
... )
Value:
printf( fmt "\n\r", ##__VA_ARGS__)

Format for printf.

Function Documentation

◆ uart2_init()

void uart2_init ( void )

Initialize UART2 peripheral.

UART2 is configured for basic asynchronous communication and is used primarily for logging and debugging.

◆ uart2_write()

void uart2_write ( int ch)

Transmit a single character over UART2.

This function blocks until the transmit data register is empty, then writes the provided character to the UART data register.

Parameters
chCharacter to transmit.