root / trunk / cardbox / cardreader.h @ 267
History | View | Annotate | Download (473 Bytes)
| 1 | #ifndef __CARDREADER_H__
|
|---|---|
| 2 | #define __CARDREADER_H__
|
| 3 | |
| 4 | #include <avr/io.h> |
| 5 | #include <avr/interrupt.h> |
| 6 | #include <stdint.h> |
| 7 | #include "main.h" |
| 8 | #include "rs485_int.h" |
| 9 | |
| 10 | typedef enum { |
| 11 | CR_NONE, |
| 12 | CR_GOOD, |
| 13 | CR_BAD |
| 14 | } cr_flag_t; |
| 15 | |
| 16 | typedef enum { |
| 17 | CR_IDLE, |
| 18 | CR_SS, |
| 19 | CR_DATA |
| 20 | } cr_state_t; |
| 21 | |
| 22 | extern volatile cr_flag_t cr_flag; |
| 23 | extern volatile uint8_t read_card; |
| 24 | extern volatile uint8_t cr_buf[512]; |
| 25 | extern volatile uint8_t cr_buf_idx; |
| 26 | |
| 27 | void card_reader_setup(void); |
| 28 | #endif
|