root / trunk / cardbox / cardreader.h @ 273
History | View | Annotate | Download (553 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 |
#define CR_ERR_BAD_PARITY -1 |
11 |
#define CR_ERR_NO_START -2 |
12 |
#define CR_ERR_NO_STOP -3 |
13 |
|
14 |
typedef enum { |
15 |
CR_NONE, |
16 |
CR_GOOD, |
17 |
CR_BAD |
18 |
} cr_flag_t; |
19 |
|
20 |
extern volatile cr_flag_t cr_flag; |
21 |
extern volatile uint8_t read_card; |
22 |
extern volatile uint8_t cr_buf[512]; |
23 |
extern volatile uint16_t cr_buf_idx; |
24 |
|
25 |
void card_reader_setup(void); |
26 |
int8_t parse_card(uint8_t *buf, uint8_t *buflen); |
27 |
#endif
|