uart.c

Source file: uart.c

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Function: uart_init

int uart_init(unsigned int baud)

Initialize the UART peripheral.

Parameters:

Name Type Description
baud unsigned int Baud rate (e.g. 115200).

Returns: 0 on success.


Function: uart_send

void uart_send(unsigned char byte)

Send a byte over UART.

Parameters:

Name Type Description
byte unsigned char The byte to transmit.

Function: uart_recv

unsigned char uart_recv(void)

Receive a byte from UART (blocking).

Returns: The received byte.