IPC@CHIP® RTOS-LNX – API Documentation

Header image

Main page


◆ canInit()

CanError canInit ( unsigned  port,
unsigned  baudrate,
unsigned long  options 
)

This function initialises a CAN port. It can also be used to re-initialise an already opened port. But please note that in this case only the hardware settings (baud rate, etc.) will be applied. Software settings like the usage of a high priority transmission queue cannot be changed without closing the port before.

Parameters
portNumber of the desired CAN port (0 stands for CAN1, etc.)
baudrateDesired baud rate in kHz
optionsThis parameter can be used to set a couple of options. Several of the following constants can be OR-ed:
Returns
One of the following codes:
Since
V1.02
See also
canInitEx, canDeinit
Example:
CanError result;
/* Initialise the CAN1 port at 50 kBaud, enable an additional high priority
* transmission queue, use three sample points
*/
result = canInit(CAN_PORT_CAN1, 50,
if(result != CAN_ERROR_NO)
... // Error handling
Examples:
canEcho.c.





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Tue Dec 12 2017 09:23:36 by Doxygen 1.8.13