Die Lib ist nicht besonders groß, aber die UART und die Motorsteuerung sind drin. Hier die H-Datei
Code:
#include <avr/io.h>			
#include <avr/interrupt.h>	
#include <stdlib.h>			

#ifndef F_CPU
#define F_CPU 8000000
#endif

#define BAUD_LOW 38400  //Low speed - 38.4 kBaud
#define UBRR_BAUD_LOW	((F_CPU/(16*BAUD_LOW))-1)
#define FWD 0
#define BWD 1








void startADC(uint8_t channel); 

void setMotorDir(uint8_t left_dir, uint8_t right_dir); //Richtungsangabe

void setMotorPWM(uint8_t power_left, uint8_t power_right); //Gibt an wie schnell der RP6 links und rechts fahren a´soll

void delay(uint8_t d); //Verzögerung

void delta_init(void); //Initialisierung der Hauptfunktionen

void usart_init(void); //Initialisierung der USART

uint8_t usart_byte_avail(void); //Prüft ob ein Byte im Puffer liegt

uint8_t readByte(void); //liest dieses Byte

uint8_t readInteger(void); //liest einen Integerwert
 
void writeChar(char ch); //liest ein Zeichen 

void writeString(char *string); //schreibt eine Zeichenfolge

void writeInteger(int16_t number, uint8_t base); //schreibt einen Integerwert

void usart_test(void); //UART-Test: bestätigt jede Eingabe mit zurücksenden der Zeichen
Und noch die C-Datei:
Code:
#include <avr/io.h>			// I/O Port definitions
#include <avr/interrupt.h>	// Interrupt macros
#include <stdlib.h>			// C standard functions (e.g. itoa...)
#ifndef F_CPU
#define F_CPU 8000000
#endif

#define BAUD_LOW            38400  //Low speed - 38.4 kBaud
#define UBRR_BAUD_LOW	((F_CPU/(16*BAUD_LOW))-1)
#define FWD 0
#define BWD 1


// Motor Power
void setMotorPWM(uint8_t power_left, uint8_t power_right)
{
	if (power_left>210) power_left=210;
	if (power_right>210) power_right=210;
	OCR1BL = power_left;
	OCR1AL = power_right;
	if (power_left || power_right)
		TCCR1A = (1 << WGM11) | (1 << COM1A1) | (1 << COM1B1);
	else
		TCCR1A = 0;
}
// Motor Richtung
void setMotorDir(uint8_t left_dir, uint8_t right_dir)
{
	if (left_dir) 
	{ PORTC |= (1 << PINC2);} 
	else 
	{PORTC &= ~(1 << PINC2);}
	if (right_dir)
    {PORTC |= (1 << PINC3);} 
    else
    {PORTC &= ~(1 << PINC3);}
}
void startADC(uint8_t channel)
{
	ADMUX = (1<<REFS0) | (0<<REFS1) | (channel<<MUX0);
	ADCSRA = (0<<ADIE) | (1<<ADSC) | (1<<ADEN) | (1<<ADPS2) | (1<<ADPS1) | (1<<ADIF);
}
uint16_t readADC(uint8_t channel)
{
	if((ADCSRA & (1<<ADSC))) return 0; // check if ADC is buisy...
	ADMUX = (1<<REFS0) | (0<<REFS1) | (channel<<MUX0);
	ADCSRA = (0<<ADIE) | (1<<ADSC) | (1<<ADEN) | (1<<ADPS2) | (1<<ADPS1) | (1<<ADIF);
	while ((ADCSRA & (1<<ADSC)));
	ADCSRA |= (1<<ADIF);
	return ADC;
}


void writeChar(char ch)
{
    while (!(UCSRA & (1<<UDRE)));
    UDR = (uint8_t)ch;
}
void writeString(char *string)
{
	while(*string)
		writeChar(*string++);
}
void writeInteger(int16_t number, uint8_t base)
{
	char buffer[17];
	itoa(number, &buffer[0], base);
	writeString(&buffer[0]);
}

void delay(uint8_t d)
{
	uint16_t d1, dummy;
	for (d1=d*255; d1>0; d1--) dummy^=d1;
}
void delta_init(void)
{
	cli();
	

	// Initialize Timer1 - PWM:
	// PWM, phase correct with ICR1 as top value.
	TCCR1A = (0 << WGM10) | (1 << WGM11) | (1 << COM1A1) | (1 << COM1B1);
	TCCR1B =  (1 << WGM13) | (0 << WGM12) | (1 << CS10);
	ICR1 = 210;
	OCR1AL = 0;
	OCR1BL = 0;
	
	sei();
}
void usart_init(void){
// UART:

	UBRRH = UBRR_BAUD_LOW >> 8;	// Setup UART: Baudrate is Low Speed
	UBRRL = (uint8_t) UBRR_BAUD_LOW;
	UCSRA = 0x00;
    UCSRC = UCSRC|=0x86;
    UCSRB = (1 << TXEN) | (1 << RXEN);
   
}

uint8_t usart_byte_avail(void){
if(UCSRA&(1<<RXC))
return 1;
else return 0;
}

uint8_t readByte()
{
while(!(UCSRA&(1<<RXC)));

return UDR;
}

void usart_test(void)
{
char test;
while(1)
{
test = readByte();
writeString("Byte:");
writeChar(test);
writeString("\n");
delay(200);


}

}



uint8_t readInteger()
{
    // Liefer das empfangene Zeichen, falls etwas empfangen wurde; -1 sonst 
    return (UCSRA & (1 << RXC)) ? (int) UDR : -1;
}