33 volatile unsigned int conf;
34 volatile unsigned int stat;
35 volatile unsigned int ctrl;
36 volatile unsigned int dummy0[3];
37 volatile unsigned int smask;
38 volatile unsigned int scode;
40 volatile unsigned int dummy1[56];
42 volatile unsigned int pimsr;
43 volatile unsigned int pimr;
44 volatile unsigned int pisr;
45 volatile unsigned int pir;
46 volatile unsigned int imr;
47 volatile unsigned int picr;
49 volatile unsigned int dummy2[58];
51 volatile unsigned int tx0ctrl;
52 volatile unsigned int tx0addr;
53 volatile unsigned int tx0size;
54 volatile unsigned int tx0wr;
55 volatile unsigned int tx0rd;
56 volatile unsigned int tx0irq;
58 volatile unsigned int dummy3[58];
60 volatile unsigned int rx0ctrl;
61 volatile unsigned int rx0addr;
62 volatile unsigned int rx0size;
63 volatile unsigned int rx0wr;
64 volatile unsigned int rx0rd;
65 volatile unsigned int rx0irq;
66 volatile unsigned int rx0mask;
67 volatile unsigned int rx0code;
71 unsigned int passive_cnt;
72 unsigned int overrun_cnt;
73 unsigned int rxsync_cnt;
74 unsigned int txsync_cnt;
75 unsigned int txloss_cnt;
76 unsigned int ahberr_cnt;
78 unsigned int busoff_cnt;
96 unsigned long long mask;
97 unsigned long long code;
106 unsigned char data[8];
112 GRCAN_RET_INVARG = -1,
113 GRCAN_RET_NOTSTARTED = -2,
114 GRCAN_RET_TIMEOUT = -3,
116 GRCAN_RET_BUSOFF = -4,
118 GRCAN_RET_AHBERR = -5,
143 #define GRCAN_CFG_ABORT 0x00000001 144 #define GRCAN_CFG_ENABLE0 0x00000002 145 #define GRCAN_CFG_ENABLE1 0x00000004 146 #define GRCAN_CFG_SELECTION 0x00000008 147 #define GRCAN_CFG_SILENT 0x00000010 148 #define GRCAN_CFG_BPR 0x00000300 149 #define GRCAN_CFG_RSJ 0x00007000 150 #define GRCAN_CFG_PS1 0x00f00000 151 #define GRCAN_CFG_PS2 0x000f0000 152 #define GRCAN_CFG_SCALER 0xff000000 154 #define GRCAN_CFG_BPR_BIT 8 155 #define GRCAN_CFG_RSJ_BIT 12 156 #define GRCAN_CFG_PS1_BIT 20 157 #define GRCAN_CFG_PS2_BIT 16 158 #define GRCAN_CFG_SCALER_BIT 24 160 #define GRCAN_CTRL_RESET 0x2 161 #define GRCAN_CTRL_ENABLE 0x1 163 #define GRCAN_TXCTRL_ENABLE 1 164 #define GRCAN_TXCTRL_ONGOING 1 166 #define GRCAN_RXCTRL_ENABLE 1 167 #define GRCAN_RXCTRL_ONGOING 1 170 #define GRCAN_IRQ_IRQ 0 171 #define GRCAN_IRQ_TXSYNC 1 172 #define GRCAN_IRQ_RXSYNC 2 174 #define GRCAN_ERR_IRQ 0x1 175 #define GRCAN_OFF_IRQ 0x2 176 #define GRCAN_OR_IRQ 0x4 177 #define GRCAN_RXAHBERR_IRQ 0x8 178 #define GRCAN_TXAHBERR_IRQ 0x10 179 #define GRCAN_RXIRQ_IRQ 0x20 180 #define GRCAN_TXIRQ_IRQ 0x40 181 #define GRCAN_RXFULL_IRQ 0x80 182 #define GRCAN_TXEMPTY_IRQ 0x100 183 #define GRCAN_RX_IRQ 0x200 184 #define GRCAN_TX_IRQ 0x400 185 #define GRCAN_RXSYNC_IRQ 0x800 186 #define GRCAN_TXSYNC_IRQ 0x1000 187 #define GRCAN_RXERR_IRQ 0x2000 188 #define GRCAN_TXERR_IRQ 0x4000 189 #define GRCAN_RXMISS_IRQ 0x8000 190 #define GRCAN_TXLOSS_IRQ 0x10000 192 #define GRCAN_STAT_PASS 0x1 193 #define GRCAN_STAT_OFF 0x2 194 #define GRCAN_STAT_OR 0x4 195 #define GRCAN_STAT_AHBERR 0x8 196 #define GRCAN_STAT_ACTIVE 0x10 197 #define GRCAN_STAT_RXERRCNT 0xff00 198 #define GRCAN_STAT_TXERRCNT 0xff0000 203 extern int grcan_dev_count(
void);
212 extern void *grcan_open(
int dev_no);
223 extern void *grcan_open_by_name(
char *name,
int *dev_no);
230 extern int grcan_close(
void *d);
251 extern int grcan_read(
276 extern int grcan_write(
295 extern int grcan_get_state(
void *d);
303 extern int grcan_start(
void *d);
305 extern int grcan_stop(
void *d);
307 extern int grcan_flush(
void *d);
313 extern int grcan_set_silent(
void *d,
int silent);
315 extern int grcan_set_abort(
void *d,
int abort);
317 extern int grcan_set_selection(
void *d,
const struct grcan_selection *selection);
319 extern int grcan_set_speed(
void *d,
unsigned int hz);
321 extern int grcan_set_btrs(
void *d,
const struct grcan_timing *timing);
325 int grcan_set_rxblock(
void* d,
int block);
327 int grcan_set_txblock(
void* d,
int block);
329 int grcan_set_txcomplete(
void* d,
int complete);
331 int grcan_set_rxcomplete(
void* d,
int complete);
333 extern int grcan_get_stats(
void *d,
struct grcan_stats *stats);
335 extern int grcan_clr_stats(
void *d);
337 extern int grcan_set_afilter(
void *d,
const struct grcan_filter *filter);
339 extern int grcan_set_sfilter(
void *d,
const struct grcan_filter *filter);
341 extern int grcan_get_status(
void *d,
unsigned int *status);
343 void grcan_register_drv(
void);
Definition: inftrees.h:24
Definition: b1553brm.c:75