root / trunk / cardbox / cardreader.h @ 278
History | View | Annotate | Download (585 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 "cardbox.h" |
8 |
#include "rs485_int.h" |
9 |
|
10 |
#define CR_ERR_BAD_PARITY -1 |
11 |
#define CR_ERR_NO_START -2 |
12 |
#define CR_ERR_NO_STOP -3 |
13 |
|
14 |
#define CR_BUF_SIZE 800 |
15 |
|
16 |
typedef enum { |
17 |
CR_NONE, |
18 |
CR_GOOD, |
19 |
CR_BAD |
20 |
} cr_flag_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 uint16_t cr_buf_idx;
|
26 |
|
27 |
void card_reader_setup(void); |
28 |
int8_t parse_card(uint8_t *buf, uint8_t *buflen); |
29 |
#endif
|