CANBUS_PARA
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 |
---|---|
| The default configuration for the receive buffer |
| The baudrate in bit/s. If this is set to 0 then the CanBusEnable-function will not set the CAN device to active state. |
| The bus node name, which must be used to open the interface with the can bus layer. This is a unique number. |
| 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. |
| The function pointer to the CAN low level device driver |
| The function pointer to the CAN low level device driver |
| The function pointer to the CAN low level device driver |
| The function pointer to the CAN low level device driver |
| The function pointer to the CAN low level device driver |
| The function pointer to the CAN low level device driver |
| The map for all needed IO function codes. The corresponding function codes shall be provided by the CAN low level device driver (see 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 |
Configuration TouCAN B |
Configuration TouCAN C |
Configuration SJA1000 1 |
Configuration SJA1000 2 |
Configuration SJA1000 3 |
If only one CAN device is used then bus node and driver device should be set to equal values.