55 volatile unsigned int conf;
56 volatile unsigned int stat;
57 volatile unsigned int ctrl;
58 volatile unsigned int dummy0[3];
59 volatile unsigned int smask;
60 volatile unsigned int scode;
62 volatile unsigned int dummy1[8];
64 volatile unsigned int nbtr;
65 volatile unsigned int fdbtr;
66 volatile unsigned int tdelay;
68 volatile unsigned int dummy1b[45];
70 volatile unsigned int pimsr;
71 volatile unsigned int pimr;
72 volatile unsigned int pisr;
73 volatile unsigned int pir;
74 volatile unsigned int imr;
75 volatile unsigned int picr;
77 volatile unsigned int dummy2[58];
79 volatile unsigned int tx0ctrl;
80 volatile unsigned int tx0addr;
81 volatile unsigned int tx0size;
82 volatile unsigned int tx0wr;
83 volatile unsigned int tx0rd;
84 volatile unsigned int tx0irq;
86 volatile unsigned int dummy3[58];
88 volatile unsigned int rx0ctrl;
89 volatile unsigned int rx0addr;
90 volatile unsigned int rx0size;
91 volatile unsigned int rx0wr;
92 volatile unsigned int rx0rd;
93 volatile unsigned int rx0irq;
94 volatile unsigned int rx0mask;
95 volatile unsigned int rx0code;
99 unsigned int passive_cnt;
100 unsigned int overrun_cnt;
101 unsigned int rxsync_cnt;
102 unsigned int txsync_cnt;
103 unsigned int txloss_cnt;
104 unsigned int ahberr_cnt;
106 unsigned int busoff_cnt;
110 unsigned char scaler;
118 unsigned char scaler;
122 unsigned char resv_zero;
132 unsigned long long mask;
133 unsigned long long code;
136#define GRCAN_FDOPT_NOM 0
137#define GRCAN_FDOPT_FDBTR 0x01
138#define GRCAN_FDOPT_FDFRM 0x02
139#define GRCAN_FDMASK (GRCAN_FDOPT_FDBTR | GRCAN_FDOPT_FDFRM)
147 unsigned char data[8];
166 GRCAN_RET_INVARG = -1,
167 GRCAN_RET_NOTSTARTED = -2,
168 GRCAN_RET_TIMEOUT = -3,
170 GRCAN_RET_BUSOFF = -4,
172 GRCAN_RET_AHBERR = -5,
197#define GRCAN_CFG_ABORT 0x00000001
198#define GRCAN_CFG_ENABLE0 0x00000002
199#define GRCAN_CFG_ENABLE1 0x00000004
200#define GRCAN_CFG_SELECTION 0x00000008
201#define GRCAN_CFG_SILENT 0x00000010
202#define GRCAN_CFG_BPR 0x00000300
203#define GRCAN_CFG_RSJ 0x00007000
204#define GRCAN_CFG_PS1 0x00f00000
205#define GRCAN_CFG_PS2 0x000f0000
206#define GRCAN_CFG_SCALER 0xff000000
208#define GRCAN_CFG_BPR_BIT 8
209#define GRCAN_CFG_RSJ_BIT 12
210#define GRCAN_CFG_PS1_BIT 20
211#define GRCAN_CFG_PS2_BIT 16
212#define GRCAN_CFG_SCALER_BIT 24
214#define GRCAN_CTRL_RESET 0x2
215#define GRCAN_CTRL_ENABLE 0x1
217#define GRCAN_TXCTRL_ENABLE 1
218#define GRCAN_TXCTRL_ONGOING 1
220#define GRCAN_RXCTRL_ENABLE 1
221#define GRCAN_RXCTRL_ONGOING 1
223#define GRCANFD_NBTR_SCALER 0x00ff0000
224#define GRCANFD_NBTR_PS1 0x0000fc00
225#define GRCANFD_NBTR_PS2 0x000003e0
226#define GRCANFD_NBTR_SJW 0x0000001f
228#define GRCANFD_NBTR_SCALER_BIT 16
229#define GRCANFD_NBTR_PS1_BIT 10
230#define GRCANFD_NBTR_PS2_BIT 5
231#define GRCANFD_NBTR_SJW_BIT 0
233#define GRCANFD_FDBTR_SCALER 0x00ff0000
234#define GRCANFD_FDBTR_PS1 0x00003c00
235#define GRCANFD_FDBTR_PS2 0x000001e0
236#define GRCANFD_FDBTR_SJW 0x0000000f
238#define GRCANFD_FDBTR_SCALER_BIT 16
239#define GRCANFD_FDBTR_PS1_BIT 10
240#define GRCANFD_FDBTR_PS2_BIT 5
241#define GRCANFD_FDBTR_SJW_BIT 0
244#define GRCAN_IRQ_IRQ 0
245#define GRCAN_IRQ_TXSYNC 1
246#define GRCAN_IRQ_RXSYNC 2
248#define GRCAN_ERR_IRQ 0x1
249#define GRCAN_OFF_IRQ 0x2
250#define GRCAN_OR_IRQ 0x4
251#define GRCAN_RXAHBERR_IRQ 0x8
252#define GRCAN_TXAHBERR_IRQ 0x10
253#define GRCAN_RXIRQ_IRQ 0x20
254#define GRCAN_TXIRQ_IRQ 0x40
255#define GRCAN_RXFULL_IRQ 0x80
256#define GRCAN_TXEMPTY_IRQ 0x100
257#define GRCAN_RX_IRQ 0x200
258#define GRCAN_TX_IRQ 0x400
259#define GRCAN_RXSYNC_IRQ 0x800
260#define GRCAN_TXSYNC_IRQ 0x1000
261#define GRCAN_RXERR_IRQ 0x2000
262#define GRCAN_TXERR_IRQ 0x4000
263#define GRCAN_RXMISS_IRQ 0x8000
264#define GRCAN_TXLOSS_IRQ 0x10000
266#define GRCAN_STAT_PASS 0x1
267#define GRCAN_STAT_OFF 0x2
268#define GRCAN_STAT_OR 0x4
269#define GRCAN_STAT_AHBERR 0x8
270#define GRCAN_STAT_ACTIVE 0x10
271#define GRCAN_STAT_RXERRCNT 0xff00
272#define GRCAN_STAT_TXERRCNT 0xff0000
277extern int grcan_dev_count(
void);
286extern void *grcan_open(
int dev_no);
297extern void *grcan_open_by_name(
char *name,
int *dev_no);
304extern int grcan_close(
void *d);
313extern int grcan_canfd_capable(
void *d);
334extern int grcan_read(
359extern int grcanfd_read(
384extern int grcan_write(
409extern int grcanfd_write(
428extern int grcan_get_state(
void *d);
436extern int grcan_start(
void *d);
438extern int grcan_stop(
void *d);
440extern int grcan_flush(
void *d);
446extern int grcan_set_silent(
void *d,
int silent);
448extern int grcan_set_abort(
void *d,
int abort);
450extern int grcan_set_selection(
void *d,
const struct grcan_selection *selection);
452extern int grcan_set_speed(
void *d,
unsigned int hz);
454extern int grcan_set_btrs(
void *d,
const struct grcan_timing *timing);
459extern int grcanfd_set_speed(
void *d,
unsigned int nomhz,
unsigned int fdhz);
461extern int grcanfd_set_btrs(
468int grcan_set_rxblock(
void* d,
int block);
470int grcan_set_txblock(
void* d,
int block);
472int grcan_set_txcomplete(
void* d,
int complete);
474int grcan_set_rxcomplete(
void* d,
int complete);
476extern int grcan_get_stats(
void *d,
struct grcan_stats *stats);
478extern int grcan_clr_stats(
void *d);
480extern int grcan_set_afilter(
void *d,
const struct grcan_filter *filter);
482extern int grcan_set_sfilter(
void *d,
const struct grcan_filter *filter);
484extern int grcan_get_status(
void *d,
unsigned int *status);
486void grcan_register_drv(
void);
Definition: inftrees.h:24
Definition: b1553brm.c:94