Last change
on this file since 50 was
50,
checked in by sven, 14 years ago
|
- The PC Documation M200 uC Serial Communication Protocol: Initial write
- driver/documation-m200: Implemented the protocol (code compiles, but not tested yet on device)
-- Sven @ p3
|
File size:
810 bytes
|
Line | |
---|
1 | #ifndef __M200_IO_H__ |
---|
2 | #define __M200_IO_H__ |
---|
3 | |
---|
4 | |
---|
5 | #include "pc-uc-protocol.h" |
---|
6 | #include "punchcard.h" |
---|
7 | |
---|
8 | #include <stdio.h> |
---|
9 | |
---|
10 | // type: char |
---|
11 | #define NO_INPUT 0 |
---|
12 | |
---|
13 | enum format_t { |
---|
14 | HEX = M200_CLIENT_HEX, |
---|
15 | DEBUG = M200_CLIENT_DEBUG, |
---|
16 | BINARY = M200_CLIENT_BINARY |
---|
17 | }; |
---|
18 | |
---|
19 | #define is_valid_format(f) ( f == HEX || f == DEBUG || f == BINARY ) |
---|
20 | |
---|
21 | static struct program_status_t { |
---|
22 | enum command_t { |
---|
23 | START_READER, |
---|
24 | STOP_READER |
---|
25 | } user_instruction; |
---|
26 | |
---|
27 | |
---|
28 | // for ISR |
---|
29 | uint8_t prev_pinc; |
---|
30 | uint8_t prev_pinb; |
---|
31 | |
---|
32 | uint8_t reader_waits_for_space; // also defacto der WRITER |
---|
33 | |
---|
34 | } status; |
---|
35 | |
---|
36 | |
---|
37 | int uart_transmit(char c, FILE* stream); |
---|
38 | |
---|
39 | unsigned char uart_recieve(); |
---|
40 | |
---|
41 | void print_bits(byte_t byte); |
---|
42 | |
---|
43 | void print_card(enum format_t out_format); |
---|
44 | |
---|
45 | void user_input_loop(); |
---|
46 | |
---|
47 | #endif /* __M200_IO_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.