Installation guide

VxWorks Installation
CAN-API Installation
Manual • Doc. No.: C.2001.21 / Rev. 3.0 •
© 2000-2007 esd gmbh
Page 95 of 112
5.1.3.2 Configuration of the VxWorks 5.x Driver
Driver for VxWorks 5.x are configured calling the driver start with a pointer to an initialized structure
of the type CAN_INFO. This can be either performed modifying the code of the example startup file
caninit.c
(recommended) or by calling the driver start routine from within your own application. In
either case please take a look into the
caninit.c
to see configuration examples for several target
architectures.
The following text describes the member of the CAN_INFO structure:
struct CAN_INFO
{
unsigned long base;
unsigned char net[4];
unsigned char prio;
unsigned char irq;
unsigned char reserved[6];
};
base CAN-ISA modules
:
I/O-address of the CAN-ISA module.
base
has to be set to the value configured on the hardware via jumpers or coding
switches. If
base
is set to ‘0’, the driver terminates the search for further CAN
interfaces.
CAN-PCI modules:
For
x86 host
CPU architectures the base address of the CAN hardware is configured
usually by a BIOS. In order to tell the device driver to use this address you have to
set the parameter
base
to -1. You have to make that your BSP got enough unused
entries in the MMU-Memory Descriptor table to enter the PCI-address area of the
CAN module there (this is usually the case).
For
PPC host
CPU architectures where the BSP or a bootloader performs the PCI
bus configuration you have to set the parameter
base
to -1. In this case the PCI-
address space is accessed with the common VxWorks offset of 0xC0000000. The
offset value of the address area is set in the driver.
For
PPC host
CPU architectures without PCI bus configuration by the BSP or
bootloader you have to find a 3 MB
free
page size aligned physical address area
which address is used for the parameter
base
.
net[0]
Logical network number which is to be assigned to the first physical CAN port in this
module. If a module has got more than one CAN port, the ports get consecutive numbers
starting with this number.
The values of
net[1]
to
net[3]
are ignored by the driver.
The user has to make sure that all logical CAN network numbers are only assigned once
in a system, otherwise the driver might not be initialized correctly.
prio
Priority of back-end task, which is, depending on the hardware, started for each physical
interface or module.