Serial transmit and receive with interrupts and circular buffer