1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
#ifndef _RFID_ASIC_RC632_H
#define _RFID_ASIC_RC632_H
struct rfid_asic_transport_handle;
struct rfid_asic_rc632_transport {
struct {
int (*reg_write)(struct rfid_asic_transport_handle *rath,
unsigned char reg,
unsigned char value);
int (*reg_read)(struct rfid_asic_transport_handle *rath,
unsigned char reg,
unsigned char *value);
int (*fifo_write)(struct rfid_asic_transport_handle *rath,
unsigned char len,
const unsigned char *buf,
unsigned char flags);
int (*fifo_read)(struct rfid_asic_transport_handle *rath,
unsigned char len,
unsigned char *buf);
} fn;
};
struct rfid_asic_handle;
struct iso14443a_atqa;
struct iso14443a_anticol_cmd;
struct rfid_asic_rc632 {
struct {
int (*power_up)(struct rfid_asic_handle *h);
int (*power_down)(struct rfid_asic_handle *h);
int (*turn_on_rf)(struct rfid_asic_handle *h);
int (*turn_off_rf)(struct rfid_asic_handle *h);
int (*transcieve)(struct rfid_asic_handle *h,
const unsigned char *tx_buf,
unsigned int tx_len,
unsigned char *rx_buf,
unsigned int *rx_len,
u_int64_t timeout,
unsigned int flags);
struct {
int (*init)(struct rfid_asic_handle *h);
int (*transcieve_sf)(struct rfid_asic_handle *h,
unsigned char cmd,
struct iso14443a_atqa *atqa);
int (*transcieve_acf)(struct rfid_asic_handle *h,
struct iso14443a_anticol_cmd *cmd,
unsigned int *bit_of_col);
} iso14443a;
struct {
int (*init)(struct rfid_asic_handle *h);
} iso14443b;
struct {
int (*init)(struct rfid_asic_handle *h);
} iso15693;
} fn;
};
struct rc632_transport_handle {
};
/* A handle to a specific RC632 chip */
struct rfid_asic_rc632_handle {
struct rc632_transport_handle th;
};
int
rc632_reg_write(struct rfid_asic_handle *handle,
unsigned char reg,
unsigned char val);
int
rc632_reg_read(struct rfid_asic_handle *handle,
unsigned char reg,
unsigned char *val);
int
rc632_fifo_write(struct rfid_asic_handle *handle,
unsigned char len,
const unsigned char *buf,
unsigned char flags);
int
rc632_fifo_read(struct rfid_asic_handle *handle,
unsigned char len,
unsigned char *buf);
int
rc632_set_bits(struct rfid_asic_handle *handle, unsigned char reg,
unsigned char val);
int
rc632_clear_bits(struct rfid_asic_handle *handle, unsigned char reg,
unsigned char val);
int
rc632_turn_on_rf(struct rfid_asic_handle *handle);
int
rc632_turn_off_rf(struct rfid_asic_handle *handle);
int
rc632_power_up(struct rfid_asic_handle *handle);
int
rc632_power_down(struct rfid_asic_handle *handle);
int
rc632_wait_idle(struct rfid_asic_handle *handle, u_int64_t time);
int
rc632_transmit(struct rfid_asic_handle *handle,
const unsigned char *buf,
unsigned char len,
u_int64_t timeout);
int
rc632_transcieve(struct rfid_asic_handle *handle,
const unsigned char *tx_buf,
unsigned char tx_len,
unsigned char *rx_buf,
unsigned char *rx_len,
unsigned int timer,
unsigned int toggle);
int
rc632_read_eeprom(struct rfid_asic_handle *handle);
int
rc632_calc_crc16_from(struct rfid_asic_handle *handle);
int
rc632_register_dump(struct rfid_asic_handle *handle, unsigned char *buf);
struct rfid_asic_handle * rc632_open(struct rfid_asic_transport_handle *th);
extern struct rfid_asic rc632;
#endif
|