Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

Description

This structure contains the information for a bus. A bus represents one interface to the world.

Members

typedef struct {
    CPU_BOOLEAN  Extended;
    CPU_INT32U   Baudrate;
    CPU_INT32U   BusNodeName;
    CPU_INT32U   DriverDevName;
    CPU_INT16S (*Init)  (CPU_INT32U);
    CPU_INT16S (*Open)  (CPU_INT16S, CPU_INT32U, CPU_INT16U);
    CPU_INT16S (*Close) (CPU_INT16S);
    CPU_INT16S (*IoCtl) (CPU_INT16S, CPU_INT16U, void *);
    CPU_INT16S (*Read)  (CPU_INT16S, CPU_INT08U *, CPU_INT16U);
    CPU_INT16S (*Write) (CPU_INT16S, CPU_INT08U *, CPU_INT16U);
    CPU_INT16U   Io[CAN_IO_FUNC_N];

} CANBUS_PARA;

Member

Meaning

Extended

The default configuration for the receive buffer

Baudrate

The baudrate in bit/s. If this is set to 0 then the CanBusEnable-function will not set the CAN device to active state.

BusNodeName

The bus node name, which must be used to open the interface with the can bus layer. This is a unique number.

DriverDevName

The driver device name, which must be used to open the interface with the low level device driver. This number is unique for a device driver.

Init

The function pointer to the CAN low level device driver XXX_Init() function (see chapter 4.1 Driver Layer)

Open

The function pointer to the CAN low level device driver XXX_Open() function (see chapter 4.1 Driver Layer)

Close

The function pointer to the CAN low level device driver XXX_Close() function (see chapter 4.1 Driver Layer)

IoCtl

The function pointer to the CAN low level device driver XXX_IoCtl() function (see chapter 4.1 Driver Layer)

Read

The function pointer to the CAN low level device driver XXX_Read() function (see chapter 4.1 Driver Layer)

Write

The function pointer to the CAN low level device driver XXX_Write() function (see chapter 4.1 Driver Layer)

Io

The map for all needed IO function codes. The corresponding function codes shall be provided by the CAN low level device driver (see chapter 4.1.4 XXX_IoCtl)

Additional Information

Separation of bus node from driver device is necessary when different CAN modules are used, i.e. on a processor with integrated CAN module and also external CAN module(s).

Example: On a MPC565 processor TouCAN A, B, C are used and also 3 external SJA1000 CAN modules. Then 6 CAN nodes are available (range 0-5), but driver devices from TouCAN range 0-2 and driver devices from SJA1000 do also range from 0-2.

In this case a possible configuration could be:

Configuration TouCAN A

Bus node 0

Driver device 0

Configuration TouCAN B

Bus node 1

Driver device 1

Configuration TouCAN C

Bus node 4

Driver device 2

Configuration SJA1000 1

Bus node 5

Driver device 0

Configuration SJA1000 2

Bus node 2

Driver device 1

Configuration SJA1000 3

Bus node 3

Driver device 2

If only one CAN device is used then bus node and driver device should be set to equal values.

  • No labels