source: projects/bull-anelex-project/trunk/anelex-interface/src/anelex.h @ 63

Last change on this file since 63 was 62, checked in by sven, 13 years ago

Bull-Anelex-Project, Anelex Interface:

  • Completely new RS232 I/O with ordinary Ring buffer (against FIFO in PC which still sends when CTS is low)
  • Integrated out-of-memory data printing, on button too (strange bug: uC resets when calling ?print X)
  • removed the toolchain.h (almost completely)
  • several improvements

-- sven @ workstation7

File size: 1.8 KB
Line 
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
38char current_line[LINE_LENGTH];
39volatile uint8_t current_line_cnt;
40
41void print_line();
42void print_line_feed();
43
44// + zwei ISRs
45
46/**
47 * State of printer driver (anelex.c):
48 **/
49volatile 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 */
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License