1 | #ifndef ANELEX_H |
---|
2 | #define ANELEX_H |
---|
3 | |
---|
4 | /** |
---|
5 | * ANELEX PRINTER Interface Microcontroller |
---|
6 | * Anelex communication |
---|
7 | * |
---|
8 | * All I/O with the Anelex device. |
---|
9 | * |
---|
10 | * Copyright (C) 2010, 2011 Sven Köppel, technikum29.de |
---|
11 | * |
---|
12 | * This program is free software; you can redistribute |
---|
13 | * it and/or modify it under the terms of the GNU General |
---|
14 | * Public License as published by the Free Software |
---|
15 | * Foundation; either version 3 of the License, or (at |
---|
16 | * your option) any later version. |
---|
17 | * |
---|
18 | * This program is distributed in the hope that it will |
---|
19 | * be useful, but WITHOUT ANY WARRANTY; without even the |
---|
20 | * implied warranty of MERCHANTABILITY or FITNESS FOR A |
---|
21 | * PARTICULAR PURPOSE. See the GNU General Public License |
---|
22 | * for more details. |
---|
23 | * |
---|
24 | * You should have received a copy of the GNU General |
---|
25 | * Public License along with this program; if not, see |
---|
26 | * <http://www.gnu.org/licenses/>. |
---|
27 | * |
---|
28 | **/ |
---|
29 | |
---|
30 | #include <avr/interrupt.h> |
---|
31 | #include <util/delay.h> |
---|
32 | #include <string.h> |
---|
33 | #include <stdio.h> |
---|
34 | |
---|
35 | #include "wiring.h" |
---|
36 | |
---|
37 | #define LINE_LENGTH 120 |
---|
38 | char current_line[LINE_LENGTH]; |
---|
39 | volatile uint8_t current_line_cnt; |
---|
40 | |
---|
41 | void print_line(); |
---|
42 | void print_line_feed(); |
---|
43 | |
---|
44 | // + zwei ISRs |
---|
45 | |
---|
46 | /** |
---|
47 | * State of printer driver (anelex.c): |
---|
48 | **/ |
---|
49 | volatile enum line_state_t { |
---|
50 | LINE_FINISHED, // Printer has finished printing and is ready for |
---|
51 | // transmit new data from pbuf to printer. |
---|
52 | |
---|
53 | LINE_TRANSMITTING, // Current line is transmitted from pbuf to printer. |
---|
54 | // so by now the anelex ISRs are working at high speed. |
---|
55 | // All other work should be avoided (like RS232 rx). |
---|
56 | |
---|
57 | LINE_PRINTING // Printer is working (no transmission possible), |
---|
58 | // best time to recieve new data via RS232. |
---|
59 | // This time is about 32ms |
---|
60 | } line_state; |
---|
61 | |
---|
62 | #endif /* ANELEX_H */ |
---|