User manual
2.5.2 Synchronous Functions
CPC_CAN_Init
Syntax: #include cpc.h
int CPC_CAN_Init(void);
Description: CPC_CAN_Init() initialises the parameters of
the CAN controller within CPC-XTI. The
CAN-controller is set up with parameters
supplied in the global structure
CPC_Init_Params (declaration in cpc.h).
These parameters can be changed before the
call to CPC_CAN_Init(). CPC_CAN_Init is to
be called before data transmission across the
CAN is initiated.
Return value: –
CPC_Control
Syntax: #include cpc.h
int CPC_Control(int);
Description: CPC_Control() serves for setup of the mes-
sage types to be transmitted from CPC-XTI
to the PC. The upper 6 bits select the type of
message, the lower 2 bits determine the
transmission behaviour. The properties that
can be influenced are described in cpc.h.
Return value: –
User Manual CPC-XTI
EMS Dr. Thomas Wünsche 9
CPC_Exit
Syntax: #include cpc.h
void CPC_Exit(void);
Description: CPC_Exit() is to be called before leaving the
application program. CPC_Exit() is in any case
to be used paired with CPC_Init().
Return value: –
CPC_Get_Busload
Syntax: #include cpc.h
int CPC_Get_Busload(void);
Description: CPC_Get_Busload() measures the actual
bus-load and returns it as percentage of the
maximum bus load.
Return value: Actual bus load: 0 corresponds to 0%, 255
corresponds to 100% bus-load.
CPC_Get_Serial
Syntax: #include cpc.h
char * CPC_Get_Serial(void);
Description: CPC_Get_Serial returns the serial number of
the connected CPC-XTI module.
Return value: Pointer to a string with the serial number or
NULL in case of errors.
CPC-XTI User Manual
10 EMS Dr. Thomas Wünsche