Industrial PC » EmRunner
ID #1087
CAN support in Linux
EmRunner's CAN registers are accessed in two step:
1. put register address on the wire
2. put/read data to/from register
That is the reason, why standard LinCan driver is not working as is. Following changes have to be made to make the driver working.
Introduce such a global variable: can_ioptr_t base_addr; in gensja1000io_init_chip_data() base_addr should the value of chip_base_addr.
So write routine in gensja1000io.c would look like this:
gensja1000io_write_register( data, address) { can_outb(address - base_addr, base_addr); // calculate register offset can_outb(data, base_addr + 1); } Read routine would look like this: gensja1000io_read_register( address) { can_outb(address - base_addr, base_addr); // calculate register offset can_inb(data, base_addr + 1); }
CAN reset is to be handled the same way.
Tags: -
Related entries:
Author: Support
Revision: 1.0
You cannot comment on this entry