4.1.11 CAN_ConfigWithoutStructure
Description:
This function is the same as
CAN_Config
. But this function doesn’t use
ConfigStruct structure type. To provide this function is for that the
structure address of some application development is allocated different
from the PISOCAN.lib. So if users use CAN_Config and can’t configure
CAN card correctly, the CAN_ConfigWithoutStruct function can instead.
Syntax:
int CAN_ConfigWithoutStructure(BYTE BoardNo, BYTE Port, DWORD
AccCode, DWORD AccMask, BYTE BaudRate, BYTE BT0,
BYTE BT1);
Parameter:
BoardNo: [input] PISO-CAN board number (0~7).
Port: [input] CAN port number (1~8)
AccCode: Acceptance code for CAN controller, low byte will be mapped
to ACR[3], high byte will be mapped to ACR[0].
AccMask: Acceptance mask for CAN controller low byte will be mapped
to AMR[3], high byte will be mapped to AMR[0].
BaudRate: 0
→
user-defined(must to set BT0,BT1), 1
→
10Kbps,
2
→
20Kbps, 3
→
50Kbps, 4
→
125Kbps, 5
→
250Kbps,
6
→
500Kbps, 7
→
800Kbps, 8
→
1Mbps.
BT0, BT1: user-defined baud rate (used only if BaudRate=0)). For
example, BT0=0x04, BT1=0x1C, then baud rate setting for
the CAN controller is 100Kbps. For more detail baud rate
setting, please refer to manual of SJA1000 CAN controller.
Return:
CAN_NoError: OK
CAN_DriverError: Kernel driver can’t be opened.
CAN_BoardNumberError: BoardNo is not correct or exceeds the current
total board number.
CAN_PortNumberError: Port number is not correct.
CAN_ActiveBoardError: This board is not activated.
CAN_SoftResetError: CAN controller software reset error.
PISO-CAN/PEX-CAN/PCM-CAN Series User’s Manual (v2.6 Dec/2013) -------
44
CAN_SetACRError: Set Acceptance code to CAN controller error
CAN_SetAMRError: Set Acceptance mask to CAN controller error
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru