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 Delay for synchronization 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 #define SJA1000_DELAY(void) \
40 for (delay=0;delay<SJA1000_SCLK;delay++) \
43 #define SJA1000_INIT_DELAY(void) \
46 for (delay=0;delay<20*SJA1000_SCLK;delay++) \
51 * struct can_baudparams_t - datatype for calling CONF_BAUDPARAMS IOCTL
52 * @flags: reserved for additional flags for chip configuration, should be written -1 or 0
53 * @baudrate: baud rate in Hz
54 * @sjw: synchronization jump width (0-3) prescaled clock cycles
55 * @sampl_pt: sample point in % (0-100) sets (TSEG1+1)/(TSEG1+TSEG2+2) ratio
57 * The structure is used to configure new set of parameters into CAN controller chip.
58 * If default value of some field should be preserved, fill field by value -1.
60 struct can_baudparams_t {
67 extern int can_init();
68 extern uint8_t can_read(uint8_t address);
69 extern void can_write(uint8_t data, uint8_t address);
71 #endif /* SJA1000_CAN_H */