USB-CANmodul
38
SYS TEC electronic GmbH 2001 L-487e_6
UcanInitCan
Syntax:
BYTE STDCALL UcanInitCan (tUcanHandle UcanHandle_p,
BYTE bBTR0_p, BYTE bBTR1_p, DWORD dwAMR_p,
DWORD dwACR_p);
Usability:
HW_INIT
Parameter:
UcanHandle_p: USB-CAN handle received with the function
UcanInitHardware ().
bBTR0_p: Baud rate register 0 (refer to SJA1000 data sheet)
bBTR1_p: Baud rate register 1 (refer to SJA1000 data sheet)
dwAMR_p: Acceptance Mask Register
dwACR_p: Acceptance Code Register
Return values: Error code of the function.
USBCAN_SUCCESSFUL
USBCAN_ERR_MAXINSTANCES
USBCAN_ERR_ILLHANDLE
USBCAN_ERR_RESOURCE
USBCAN_ERR_BUSY
USBCAN_ERR_IOFAILED
USBCAN_ERRCMD_NOTEQU
USBCAN_ERRCMD_REGTST
USBCAN_ERRCMD_ILLCMD
Description:
Initializes the CAN interface of a USB-CANmodul. The software
changes into the state CAN_INIT. Now it is possible to transmit and
receive CAN messages. Table 4 shows the possible functions in this
state.