XXX_IoCtl
Description
This function controls the given CAN device. The parameter func defines, which control operation the user wants to perform.
Prototype
CPU_INT16S XXX_IoCtl(CPU_INT16S devId, CPU_INT16U func, void *argp);
Parameter | Meaning |
---|---|
devId | device identifier, returned by |
| function code |
| optional function argument |
Additional Information
Function Code IO_<DRV_NAME>_* | Meaning | used by μC/CAN |
| set the bus baudrate | yes |
| configure the CAN receiver to receive only CAN standard identifiers. | no |
| configure the CAN receiver to receive only CAN extended identifiers. | yes* |
| starts the CAN controller interface. Most common is to set the CAN controller in active mode | yes |
| stop the CAN controller interface. Most common is to set the CAN controller in passive mode | yes |
| get the node status from the CAN controller | no** |
| get status if CAN controller is ready to send new CAN frame | yes |
* is used at startup, but some CAN devices will receive both extended or standard identifier if no mask is set
** needed only if CanBusNSHandler()
is used.
Note: Its possible that some CAN devices do not support the function codes RX_STANDARD
and RX_EXTENDED
(e.g. SJA1000) or that this filter setting must be done via other function codes, e.g. for LPC2xxx CAN device drivers this must be set via SET_xxx_FILTER
function codes. Please see the appropriate CanDriverManual if the function code is supported.
Return Value
Zero for success or -1 if an error occurs.