AVR-Playground/uart.h

20 lines
459 B
C
Raw Normal View History

2024-03-23 21:18:52 +01:00
#pragma once
// Simple UART library for ATmega328P
// Define DEBUG_UART_ENABLED to enable debug messages
#ifdef DEBUG_UART_ENABLED
#define DEBUG(message) UART_println(message)
#else
#define DEBUG(message) ((void)0) // Define as no operation (NOP)
#endif
2024-03-23 21:18:52 +01:00
#include <stdint.h>
// Initialize UART
2024-03-23 21:18:52 +01:00
void initUART();
// Transmit a byte over UART
2024-03-23 21:18:52 +01:00
void UART_transmit(uint8_t data);
// Print a formatted string over UART
2024-03-24 01:55:23 +01:00
void UART_println(const char* format, ...);