#include "usart.h" void USART::init() { UCSR0A = _BV(U2X0); UCSR0B = _BV(RXEN0) | _BV(TXEN0); // Einstellen des Datenformats: 8 Datenbits, 1 Stoppbit UCSR0C = _BV(UCSZ00) |_BV(UCSZ01);// (1<> 8) & 0xFF; UBRR0L = ((F_CPU / (8UL * BAUDRATE))-1) & 0xFF; } void USART::writeByte(uint8_t b) { while (!(UCSR0A & (1<>= 8; while (!(UCSR0A & (1<>= 1; } } writeByte(crc); return readByte(); } uint8_t USART::readByte() { while (!(UCSR0A & (1<