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:

Last update: 2011-12-12 12:47
Author: Support
Revision: 1.0

Digg it! Print this record Send to a friend Show this as PDF file
Please rate this entry:

Average rating: 5 out of 5 (1 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry