
AIV-HM76V1FL Series User Manual
49
www.acrosser.com
Syntax: i32 getCanBaudRate(u8 *baud)
Description:
This function gets the current setting of the Baud Rate
of the CAN Bus. This function gets an ‘unsigned char’ to
represent the Baud Rate. Here is the table for the Baud
Rate:
Unsigned Char Baud Rate
1 10K
2 20K
3 50K
4 100K
5 125K
6 250K
7 500K
8 800K
9 1000K
Users can use the macros listed below to set the Baud
Rate:
/* Baud Rate */
#dene BAUD_RATE_10K 1
#dene BAUD_RATE_20K 2
#dene BAUD_RATE_50K 3
#dene BAUD_RATE_100K 4
#dene BAUD_RATE_125K 5
#dene BAUD_RATE_250K 6
#dene BAUD_RATE_500K 7
#dene BAUD_RATE_800K 8
#dene BAUD_RATE_1000K 9
Parameters:
This function gets a number which represents the specic
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.
Syntax: i32 setCanBaudRate(u8 baud)
Description:
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.