source: projects/punch-card/driver/documation-m200/src/driver.h @ 51

Last change on this file since 51 was 51, checked in by sven, 10 years ago

Sorted the sources a bit:

  • moved all the interrupt and card ring buffer related things to driver.c
  • renamed io.c (stupid name) to protocol.c (good name)
File size: 1.8 KB
Line 
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
39void process_buffer_queue(enum format_t out_format);
40
41// some kind of global storage for some quick & dirty solutions
42static 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__ */
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