User guide

Chapter 2. Communication
69
AT6nnn
Interrupt Driver
The AT6nnn interrupt driver can be thought of as having a top half and a bottom half ( see
illustration below).
do_isr()
Top Half
undo_isr() ReadRingBuffer() WriteRingBuffer()
AT6nnn_isr()
Bottom Half
inbuff[] outbuff[]
The top half consists of those functions that can be called from your program (see table
below).
Function Description
do_isr()
Initializes interrupt vector, and enables PC-AT and AT6nnn interrupts
undo_isr()
Disables AT6nnn interrupts and restores original interrupt vector
ReadRingBuffer()
Used to read AT6nnn response data from input ring buffer
WriteRingBuffer()
Used to write AT6nnn command data into output ring buffer
The bottom half is called on an interrupt issued by the AT6nnn (see below).
Function Description
AT6nnn_isr()
Interrupt service routine
inbuff[]
Input ring buffer
outbuff[]
Output ring buffer
You may have noticed that a ring buffer was not set up to handle the AT6nnn general-purpose
interrupt. Instead, a flag is set in the interrupt service routine upon receipt of the general
purpose interrupt. Seeing this flag set, the background polling loop displays the interrupt
status bits and clears the flag. You can just as easily set up another ring buffer to collect the
interrupt status bits.