AVR-Playground/uart.h
2024-03-24 04:06:27 +01:00

20 lines
No EOL
455 B
C

#pragma once
// Simple UART library for ATmega328P
// Define DEBUG_UART_ENABLED to enable debug messages
#ifdef DEBUG_UART_ENABLED
#define DEBUG(...) UART_println(__VA_ARGS__)
#else
#define DEBUG(...) ((void)0) // Define as no operation (NOP)
#endif
#include <stdint.h>
// Initialize UART
void initUART();
// Transmit a byte over UART
void UART_transmit(uint8_t data);
// Print a formatted string over UART
void UART_println(const char* format, ...);