1 | #ifndef __M200_DRIVER_H__ |
---|
2 | #define __M200_DRIVER_H__ |
---|
3 | |
---|
4 | /** |
---|
5 | * AVR M200 Punch card reader controller |
---|
6 | * Driver implementation |
---|
7 | * |
---|
8 | * The driver.c file does the real work: It implements a set of IVR interrupt |
---|
9 | * vector routines (PCINT1_vect, PCINT2_vect, INT0_vect). As these functions |
---|
10 | * are stored in the interrupt vector table, their symbols don't have to be |
---|
11 | * exported in this header file. |
---|
12 | * |
---|
13 | * So there's only the process_buffer_queue(...) function that is called from |
---|
14 | * protocol.c from the main queue. Thus all card ring buffer related algorithms |
---|
15 | * are placed in the driver.c file. |
---|
16 | * |
---|
17 | * |
---|
18 | * This file is part of the Punched Paper Project - Punch Card Device Drivers |
---|
19 | * Copyright (C) 2009 Sven Koeppel |
---|
20 | * |
---|
21 | * This program is free software; you can redistribute it and/or |
---|
22 | * modify it under the terms of the GNU General Public License as |
---|
23 | * published by the Free Software Foundation; either version 3 of |
---|
24 | * the License, or (at your option) any later version. |
---|
25 | * |
---|
26 | * This program is distributed in the hope that it will be useful, |
---|
27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
29 | * GNU General Public License for more details. |
---|
30 | * |
---|
31 | * You should have received a copy of the GNU General Public License |
---|
32 | * along with this program; if not, see |
---|
33 | * <http://www.gnu.org/licenses/>. |
---|
34 | **/ |
---|
35 | |
---|
36 | #include <stdio.h> // testweise |
---|
37 | #include "protocol.h" |
---|
38 | |
---|
39 | void process_buffer_queue(enum format_t out_format); |
---|
40 | |
---|
41 | // some kind of global storage for some quick & dirty solutions |
---|
42 | static struct program_status_t { |
---|
43 | enum command_t { |
---|
44 | START_READER, |
---|
45 | STOP_READER |
---|
46 | } user_instruction; |
---|
47 | |
---|
48 | |
---|
49 | // for ISR |
---|
50 | uint8_t prev_pinc; |
---|
51 | uint8_t prev_pinb; |
---|
52 | |
---|
53 | uint8_t reader_waits_for_space; // also defacto der WRITER |
---|
54 | |
---|
55 | } status; |
---|
56 | |
---|
57 | |
---|
58 | #endif /* __M200_DRIVER_H__ */ |
---|