beautypg.com

COMMELL MPX-2515 User Manual

Page 10

background image

Commell MPX-2515 User’s Guide Rev 0100

Taiwan Commate Computer Inc.

10

1.5.3 CAN_SET_LED_SWITCH

The CAN_SET_LED_SWITCH command turns the main LED switch on or off.
Every individual LED indicator will be in the off state if application sets the main
LED switch to the OFF state via this command. Please be noted that the main LED
switch is default to ON state each time the MPX-2515 card be powered on.

#define CCP_CAN_SYSTEM_SERVICE 0X20 /* COMMAND: service code */
#define CAN_SET_LED_SWITCH 0X03 /* DATA_0: sub-command code */
#define LED_SWITCH_OFF 0X00 /* @ DATA_1 */
#define LED_SWITCH_ON 0X01 /* @ DATA_1 */
#define EP2 2 /* Endpoint 2 */
#define EP3 3 /* Endpoint 3 */

OFFSET

BULK OUT (EP2)

BULK IN (EP1)

SIZEOF_DATA

0X02

0X01

COMMAND

0X20

0X20

ERROR

0X00

Error code

DATA_0

0X03

Number of byte written (0X01)

DATA_1

0X00 / 0X01

Checksum

DATA_2

Checksum

DATA_3

DATA_4

DATA_5

1.5.4 CAN_SET_TRANSFER_RATE

The CAN_SET_TRANSFER_RATE command sets the MCP2515 bit transfer rate
on the connecting CAN bus.

MPX-2515 defaults to 125 Kbps transfer rate each time it boots up. Application
issues this command to change to its desired CAN bus transfer rate. There are four
transfer rates that the application can set via this command. Applications need to
program all relevant MCP2515 registers if other transfer rate is desired.

#define CCP_CAN_SYSTEM_SERVICE 0X20 /* COMMAND: service code */
#define CAN_SET_TRANSFER_RATE 0X04 /* DATA_0: sub-command code */
#define CAN_1000K_BPS 0X00 /* @DATA_1 */
#define CAN_500K_BPS 0X01 /* @DATA_1 */
#define CAN_250K_BPS 0X03 /* @DATA_1 */
#define CAN_125K_BPS 0X07 /* @DATA_1 */
#define EP2 2 /* Endpoint 2 */
#define EP3 3 /* Endpoint 3 */

OFFSET

BULK OUT (EP2)

BULK IN (EP1)

SIZEOF_DATA

0X02

0X01

COMMAND

0X20

0X20