Enable the CAN Bus
Enabling the CAN bus interface means, that the CAN controller will go in “active” mode and is ready for communication.
Example: The CAN bus (we have configured in the chapter above) shall be enabled.
Source code:
#include “can_bus.h”
void Com_Start(void)
{
CPU_INT
16S err; /*-1-*/
CanBusInit(0L); /*-2-*/
err = CanBusEnable(&CanCfg); /*-3-*/
if (err == CAN_ERR_NONE
) {
/* e.g. start RX and TX tasks */
}
}
Description
CanBusEnable()
function call.End