Download 6 - Diversant Software

Transcript
RTX-51 / RTX-251
135
Application Interface
The CAN communication interface is similar to the RTX-51/251 interface.
Using RTXCAN/x51 with the KEIL C51/C251 compiler is straightforward. The
header file RTXCAN.H is provided to simplify application programming.
Each CAN function returns status information, which can be tested by the application
program.
For example:
#include <rtxcan.h>
...
/* Define object 1000 */
if (can_def_obj (1000, 2, D_REC) != C_OK) {
/* Return status indicates "not okay" */
...
}
6