Enabling the CAN Bus
Before the application have access to the CAN bus, the CAN controller must be configured with the needed communication parameters.
Figure - Enabling the CAN bus
- The function
CanBusEnable()
is called with an application specific CAN bus configuration parameter structure (see documentation of structureCANBUS_PARA
). - The bus node in the configuration parameter structure selects the object in the CAN bus table.
- The given CAN configuration parameter structure is checked to contain plausible data and function pointers to the lowlevel device drivers. If this check was successful, the structure is linked to the CAN bus object.
- The function pointers to the lowlevel device drivers are used to access the CAN controller. This function uses
Init()
,Open()
andIoCtl()
to initialize the CAN controller. In case that the baudrate is configured to 0 then the CAN controller will not be set to active state.