Acrosser AR-B6051 User Manual

Page 47

Advertising
background image

Users can use the macros listed below to set the Baud Rate:

/* Baud Rate */

#define BAUD_RATE_10K 1

#define BAUD_RATE_20K 2

#define BAUD_RATE_50K 3

#define BAUD_RATE_100K 4

#define BAUD_RATE_125K 5

#define BAUD_RATE_250K 6

#define BAUD_RATE_500K 7

#define BAUD_RATE_800K 8

#define BAUD_RATE_1000K 9

Parameters: This function gets a number which represents the specific Baud

Rate and stores it

at the memory which is pointed at by the pointer ‘baud’.

Return Value: If this function gets the baud rate successfully, it returns 0, any other returned value

stands for error.

3. Syntax:

i32 setCanBaudRate(u8 baud)

Descriptions: This function sets the Baud Rate of the CAN Bus.

Parameters: It takes an ‘unsigned char’ as the parameter and sets the Baud Rate according to the

value stored at the parameter ‘baud’. The correspondence between the Baud rate and the value to set

to the function is the same as the table listed in the previous API ‘getCanBaudRate( )’

Return Value: If this function sets the baud rate successfully, it returns 0, any other returned value

stands for error.

4. Syntax:

i32 sendCanMessage( struct CanMsg *buffer, u8 count )

Description: This function sends out CAN packages over the CAN bus.

Parameters: If there is more than one CAN packet to send, these CAN packages are stored in an

array of type ‘CanMsg’. This function sends out packets in a sequential fashion. The memory

47

Advertising