% Formating of USB firmware source code for printout using LaTeX
% File: genpdf.tex
% Usage: pdflatex genpdf.tex
% S. Salewski, 18-JUL-2007

\documentclass[a4paper, 10pt]{article}
\usepackage[tmargin=2cm, bmargin=3cm, lmargin=2cm,rmargin=5mm]{geometry} 
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{marvosym} 
\usepackage{listings}

\newcommand{\setheader}[1]{\markboth{Free (GPL) USB Firmware for Atmels AT90USB 8-bit microprocessor --- \textbf{#1}}
{Free (GPL) USB Firmware for Atmels AT90USB 8-bit microprocessor --- \textbf{#1}}}

\begin{document}
\pagestyle{myheadings}
\lstset{language=C}
\lstset{breaklines=true}
\lstset{prebreak={\Righttorque}}
\lstset{flexiblecolumns=true}
\lstset{showstringspaces=false}

\setheader{README}
\lstinputlisting[language={}]{README}
\pagebreak[4]

\setheader{SUDAP.c}
\lstinputlisting{SUDAP.c}
\pagebreak[4]

\setheader{SUDD.c}
\lstinputlisting{SUDD.c}
\pagebreak[4]

\setheader{daq\_dev.h}
\lstinputlisting{daq_dev.h}
\pagebreak[4]

\setheader{daq\_dev.c}
\lstinputlisting{daq_dev.c}
\pagebreak[4]

\setheader{usb\_api.h}
\lstinputlisting{usb_api.h}
\pagebreak[4]

\setheader{usb\_api.c}
\lstinputlisting{usb_api.c}
\pagebreak[4]

\setheader{usb\_requests.h}
\lstinputlisting{usb_requests.h}
\pagebreak[4]

\setheader{usb\_requests.c}
\lstinputlisting{usb_requests.c}
\pagebreak[4]

\setheader{usb\_spec.h}
\lstinputlisting{usb_spec.h}
\pagebreak[4]

\setheader{usb\_spec.c}
\lstinputlisting{usb_spec.c}
\pagebreak[4]

\setheader{usb\_drv.h}
\lstinputlisting{usb_drv.h}
\pagebreak[4]

\setheader{usb\_drv.c}
\lstinputlisting{usb_drv.c}
\pagebreak[4]

\setheader{usart\_drv.h}
\lstinputlisting{usart_drv.h}
\pagebreak[4]

\setheader{usart\_drv.c}
\lstinputlisting{usart_drv.c}
\pagebreak[4]

\setheader{usart\_debug.h}
\lstinputlisting{usart_debug.h}
\pagebreak[4]

\setheader{usart\_debug.c}
\lstinputlisting{usart_debug.c}
\pagebreak[4]

\setheader{ringbuffer.h}
\lstinputlisting{ringbuffer.h}
\pagebreak[4]

\setheader{ringbuffer.c}
\lstinputlisting{ringbuffer.c}
\pagebreak[4]

\setheader{usb\_isr.c}
\lstinputlisting{usb_isr.c}
\pagebreak[4]

\setheader{com\_def.h}
\lstinputlisting{com_def.h}
\pagebreak[4]

\setheader{defines.h}
\lstinputlisting{defines.h}
\pagebreak[4]

\setheader{macros.h}
\lstinputlisting{macros.h}
\pagebreak[4]

\setheader{AT90USB-Errata.txt}
\lstinputlisting[language={}]{AT90USB-Errata.txt}
\pagebreak[4]

\end{document}
