7 #include <system_def.h>
9 #include <local_config.h>
10 #include <usb/usbdebug.h>
13 #include <usb/usb_srq.h>
15 #include <hal_machperiph.h>
21 * Header file for the Linux CAN-bus driver.
22 * Written by Arnaud Westenberg email:arnaud@wanadoo.nl
23 * Rewritten for new CAN queues by Pavel Pisa - OCERA team member
24 * email:pisa@cmp.felk.cvut.cz
25 * This software is released under the GPL-License.
26 * Version lincan-0.3 17 Jun 2004
30 NOP count for synchronizing with peripheral (SJA1000)
32 #define SJA1000_CLK (24000000) /* XTAL frequency */
33 #define SJA1000_PRESC (2) /* embedded prescaler */
34 #define SJA1000_CCLK (SJA1000_CLK/SJA1000_PRESC) /* SJA core frequency */
35 #define SJA1000_SCLK (PCLK/SJA1000_CCLK) /* Clock count to synchronize with LPC */
37 volatile int slowdown;
40 * struct can_baudparams_t - datatype for calling CONF_BAUDPARAMS IOCTL
41 * @flags: reserved for additional flags for chip configuration, should be written -1 or 0
42 * @baudrate: baud rate in Hz
43 * @sjw: synchronization jump width (0-3) prescaled clock cycles
44 * @sampl_pt: sample point in % (0-100) sets (TSEG1+1)/(TSEG1+TSEG2+2) ratio
46 * The structure is used to configure new set of parameters into CAN controller chip.
47 * If default value of some field should be preserved, fill field by value -1.
49 struct can_baudparams_t {
56 extern int can_init();
57 extern int can_autobaud(int tries);
58 extern int can_read(uint8_t address,uint8_t *data);
59 extern int can_write(uint8_t address,uint8_t *data);
61 extern int can_set_mask(int dual_mask,int count,uint8_t *mask,uint8_t *accept);
63 extern int can_poll();
64 extern int can_transmit_direct(uint8_t *data);
65 //int can_transmit(char ext_header,char rtr,int mask_size,uint8_t *mask,int numbytes,uint8_t *data);
66 extern int can_transmit(int ext_header,int rtr,uint8_t *mask,int numbytes,uint8_t *data);
67 //int can_receive(uint8_t *data);
68 extern int can_receive(uint8_t len,uint8_t *data);
70 #endif /* SJA1000_CAN_H */