HOME       UP       PREV       NEXT (A SoC consists of interconnected IP Blocks)  

Programming for the UART using Interrupts

Click on this: »C Code For Device Driver

This second code fragment illustrates the complete set of five software routines needed to manage a pair of circular buffers for input and output to the UART using interrupts.

If the UART has a single interrupt output for both send and receive events, then two of the five routines are combined with a software dispatch between their bodies. Not shown is that the ISR must be prefixed and postfixed with code that saves and restores the processor state (this is normally written in assembler).


25: (C) 2008-18, DJ Greaves, University of Cambridge, Computer Laboratory.