This might give you a good starting point: http://www.sebastians-site.de/homepage/elektronik/avr-library-for-lc7981.html