Initial commit of 0.0.18 just as it was released!
[freeems-vanilla.git] / src / inc / commsISRs.h
blob2e7509bf957f87eb3dc1b1894f8430b6e80e0717
1 /* commsISRs.h
3 Copyright 2008 Fred Cooke
5 This file is part of the FreeEMS project.
7 FreeEMS software is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 FreeEMS software is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with any FreeEMS software. If not, see <http://www.gnu.org/licenses/>.
20 We ask that if you make any changes to this file you send them upstream to us at admin@diyefi.org
22 Thank you for choosing FreeEMS to run your engine! */
24 /* Header file multiple inclusion protection courtesy eclipse Header Template */
25 /* and http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/ C pre processor manual */
26 #ifndef FILE_COMMS_ISRS_H_SEEN
27 #define FILE_COMMS_ISRS_H_SEEN
29 #ifdef COMMSISRS_C
30 #define EXTERN
31 #else
32 #define EXTERN extern
33 #endif
36 /* SCISR1 register fields
38 * From left most/most significant to right most/least significant.
40 * Abrev Description Actions/Meaning
41 * TRDE - Transmit Data Register Empty - Load with more data if there is any - Main Flag
42 * TC - Transmit Complete - Nothing being sent and nothing loaded ready - unused
43 * RDRF - Receive Data Register Full - Store data in buffer until packet complete - Main Flag
44 * IDLE - Idle Line - Receive line is quiet - unused
45 * OR - Overrun - Discard partial data received and increment counter
46 * NF - Noise Flag - Discard partial data received and increment counter
47 * FE - Framing Error - Discard partial data received and increment counter
48 * PF - Parity Error - Discard partial data received and increment counter
50 * SCISR1 flag masks */
51 #define SCISR1_TX_REGISTER_EMPTY BIT7
52 #define SCISR1_TX_COMPLETE BIT6
53 #define SCISR1_RX_REGISTER_FULL BIT5
54 #define SCISR1_RX_IDLE_LINE BIT4
55 #define SCISR1_RX_OVERRUN BIT3
56 #define SCISR1_RX_NOISE BIT2
57 #define SCISR1_RX_FRAMING BIT1
58 #define SCISR1_RX_PARITY BIT0
61 /* TX/RX state variables */
62 EXTERN unsigned char TXByteEscaped;
63 EXTERN unsigned char RXCalculatedChecksum;
66 #undef EXTERN
68 #else
69 /* let us know if we are being untidy with headers */
70 #warning "Header file COMMS_ISRS_H seen before, sort it out!"
71 /* end of the wrapper ifdef from the very top */
72 #endif