PISO-CPM100(U) / PCM-CPM100 user manual (ver. 2.02) Dec/03/2012 ----------------- 40
4.5.7. CPM100_InitMaster
Description:
The function must be applied when configuring the CAN controller
and initialize the CPM100. It must be called once before using other
functions of the CPM100.lib.
Syntax:
WORD
CPM100_InitMaster(
BYTE
BoardNo,
BYTE
Node,
BYTE
BaudRate,
BYTE
BlockMode)
Parameter:
BoardNo:
[input] CPM100 board number (0~7).
Node:
[input] Master’s node ID. If the parameter is 0, the master will be
a normal master, and no other master can control it. If the
parameter is 1 ~ 127 (different from other slave), other master
can do some control to it through some ISR function.
BaudRate:
[input] The baudrate of the CPM100
Value
Baud rate
0 10Kbps
1 20Kbps
2 50Kbps
3 125Kbps
4 250Kbps
5 500Kbps
6 800Kbps
7 1Mbps
BlockMode:
[input] 0 means this function is non-block-function, and 1
means this function is block-function. If set this parameter to 1, the
running procedure of the users’ application will be held in the
function until return. If set to 0, this function will return “CPM_
Processing” directly. This function will return its process status
while users apply it with the same “BoardNo” and “Node” again. If
the procedure is still not complete, it will return “CPM_Wait”.