Utils#
Functions#
Convert uint16 to two byte array.
Convert uint32 to four byte array.
Convert a 2 byte array to uint16, first byte in array is LSB.
Convert a 4 byte array to uint32, first byte in array is LSB.
ASCII to HEX conversion.
Convert given ASCII HEX notation to decimal notation (used for MAC address).
Convert notation MAC address to a 6-byte HEX address.
Hex to ascii conversion.
Convert given 6-byte HEX address to ASCII Mac address.
Calculate CRC for a given byte and accumulate CRC.
Calculate 6-bit hash value for given MAC address.
Convert the given lower-case character to upper case.
Convert the given string to array.
Convert integer value into null-terminated string and stores it.
Convert string to an integer.
ASCII to hex conversion.
Convert given ASCII HEX notation to decimal notation (used for mac address).
Convert ASCII notation MAC address to a 6-byte HEX address.
Convert ASCII notation network address to 4-byte HEX address.
Convert IP address to reverse HEX format.
Converts the unsigned integer from network byte order to host byte order.
Convert ASCII to Decimal Value.
Reverses the given string.
converts the integer into a string.
Convert uint16 to two byte array.
Convert uint32 to four byte array.
Convert a 2 byte array to uint16, first byte in array is LSB.
Convert a 4 byte array to uint32, first byte in array is LSB.
Function Documentation#
rsi_uint16_to_2bytes#
void rsi_uint16_to_2bytes (uint8_t * dBuf, uint16_t val)
Convert uint16 to two byte array.
[in] | dBuf | - Pointer to buffer to put the data in |
[in] | val | - Data to convert |
Returns
void
37
of file driver/rsi_utils.c
rsi_uint32_to_4bytes#
void rsi_uint32_to_4bytes (uint8_t * dBuf, uint32_t val)
Convert uint32 to four byte array.
[in] | dBuf | - Pointer to buffer to put the data in |
[in] | val | - Data to convert |
Returns
void
55
of file driver/rsi_utils.c
rsi_bytes2R_to_uint16#
uint16_t rsi_bytes2R_to_uint16 (uint8_t * dBuf)
Convert a 2 byte array to uint16, first byte in array is LSB.
[in] | dBuf | - Pointer to a buffer to get the data from |
Returns
Converted 16 bit data
71
of file driver/rsi_utils.c
rsi_bytes4R_to_uint32#
uint32_t rsi_bytes4R_to_uint32 (uint8_t * dBuf)
Convert a 4 byte array to uint32, first byte in array is LSB.
[in] | dBuf | - Pointer to a buffer to get the data from |
Returns
Converted 32 bit data
88
of file driver/rsi_utils.c
rsi_ascii_hex2num#
int8_t rsi_ascii_hex2num (int8_t ascii_hex_in)
ASCII to HEX conversion.
[in] | ascii_hex_in | - ASCII HEX input |
Returns
HEX number
104
of file driver/rsi_utils.c
rsi_char_hex2dec#
int8 rsi_char_hex2dec (int8_t * cBuf)
Convert given ASCII HEX notation to decimal notation (used for MAC address).
[in] | cBuf | - ASCII HEX notation string |
Returns
Integer Value
123
of file driver/rsi_utils.c
rsi_ascii_dev_address_to_6bytes_rev#
uint8_t * rsi_ascii_dev_address_to_6bytes_rev (uint8_t * hex_addr, int8_t * ascii_mac_address)
Convert notation MAC address to a 6-byte HEX address.
[in] | hex_addr | - Source address to convert, must be a null terminated string. |
[out] | ascii_mac_address | - Converted HEX address. |
Returns
HEX address
142
of file driver/rsi_utils.c
hex_to_ascii#
int8_t hex_to_ascii (uint8_t hex_num)
Hex to ascii conversion.
[in] | hex_num | - HEX number |
Returns
Ascii value for given HEX value
176
of file driver/rsi_utils.c
rsi_6byte_dev_address_to_ascii#
int8_t * rsi_6byte_dev_address_to_ascii (uint8_t * ascii_mac_address, uint8_t * hex_addr)
Convert given 6-byte HEX address to ASCII Mac address.
[in] | ascii_mac_address | - HEX address input. |
[out] | hex_addr | - Converted ASCII mac address is returned here. |
Returns
Converted ASCII mac address
219
of file driver/rsi_utils.c
lmac_crc8_c#
uint8_t lmac_crc8_c (uint8_t crc8_din, uint8_t crc8_state, uint8_t end)
Calculate CRC for a given byte and accumulate CRC.
[in] | crc8_din | - CRC byte input |
[in] | crc8_state | - accumulated CRC |
[in] | end | - last byte CRC |
Returns
CRC value
247
of file driver/rsi_utils.c
multicast_mac_hash#
uint8_t multicast_mac_hash (uint8_t * mac)
Calculate 6-bit hash value for given MAC address.
[in] | mac | - pointer to MAC address |
Returns
6-bit Hash value
310
of file driver/rsi_utils.c
convert_lower_case_to_upper_case#
uint8_t convert_lower_case_to_upper_case (uint8_t lwrcase)
Convert the given lower-case character to upper case.
[in] | lwrcase | - Lower case character to convert |
Returns
Converted Upper case character
327
of file driver/rsi_utils.c
string2array#
void string2array (uint8_t * dst, uint8_t * src, uint32_t length)
Convert the given string to array.
[in] | dst | - Pointer to destination array |
[in] | src | - Pointer to source string |
[in] | length | - Length of the string |
Returns
Void
343
of file driver/rsi_utils.c
rsi_itoa#
uint8_t * rsi_itoa (uint32_t val, uint8_t * str)
Convert integer value into null-terminated string and stores it.
[in] | val | - Value to be converted to a string |
[in] | str | - Array in memory where to store the resulting null-terminated string |
Returns
Null-terminated string
363
of file driver/rsi_utils.c
rsi_atoi#
int32_t rsi_atoi (const int8_t * str)
Convert string to an integer.
[in] | str | - String to be converted to integer |
Returns
Converted Integer
396
of file driver/rsi_utils.c
asciihex_2_num#
int8_t asciihex_2_num (int8_t ascii_hex_in)
ASCII to hex conversion.
[in] | ascii_hex_in | - ASCII hex input |
Returns
HEX number
422
of file driver/rsi_utils.c
rsi_charhex_2_dec#
int8_t rsi_charhex_2_dec (int8_t * cBuf)
Convert given ASCII HEX notation to decimal notation (used for mac address).
[in] | cBuf | - ASCII HEX notation string. |
Returns
Integer value
441
of file driver/rsi_utils.c
rsi_ascii_mac_address_to_6bytes#
void rsi_ascii_mac_address_to_6bytes (uint8_t * hexAddr, int8_t * asciiMacAddress)
Convert ASCII notation MAC address to a 6-byte HEX address.
[in] | hexAddr | - Source address to convert, must be a null terminated string. |
[out] | asciiMacAddress | - Converted HEX address is returned here. |
Returns
Void
459
of file driver/rsi_utils.c
rsi_ascii_dot_address_to_4bytes#
void rsi_ascii_dot_address_to_4bytes (uint8_t * hexAddr, int8_t * asciiDotAddress)
Convert ASCII notation network address to 4-byte HEX address.
[in] | hexAddr | - Source address to convert, must be a null terminated string. |
[out] | asciiDotAddress | - Output value is passed back in the 4-byte HEX Address. |
Returns
Void
491
of file driver/rsi_utils.c
ip_to_reverse_hex#
uint64_t ip_to_reverse_hex (char * ip)
Convert IP address to reverse HEX format.
[in] | ip | - IP address to convert. |
Returns
IP address in reverse HEX format
532
of file driver/rsi_utils.c
rsi_ntohl#
uint32_t rsi_ntohl (uint32_t a)
Converts the unsigned integer from network byte order to host byte order.
[in] | a | - Unsigned integer to convert. |
Returns
Unsigned integer in host byte order
558
of file driver/rsi_utils.c
ascii_to_dec#
uint8_t ascii_to_dec (uint8_t * num)
Convert ASCII to Decimal Value.
[in] | num | - ASCII input |
Returns
dec_val - value after conversion
569
of file driver/rsi_utils.c
rsi_reverse#
void rsi_reverse (char * str, int len)
Reverses the given string.
[in] | str | - string to be reversed |
[in] | len | - the length of the given string |
Returns
void
589
of file driver/rsi_utils.c
rsi_intToStr#
int rsi_intToStr (int x, char str, int d)
converts the integer into a string.
[in] | x | - the string in which the result must be stored |
[in] | str | - the float number that needs to be converted into a string |
[in] | d | - the number of points after the decimal that needs to be printed, should be less than 6. |
Converts a floating-point/double number to a string.
Returns
the lenght of the string
Returns
void
610
of file driver/rsi_utils.c
rsi_ftoa#
void rsi_ftoa (char * res, float n, int afterpoint)
N/A | res | |
N/A | n | |
N/A | afterpoint |
637
of file driver/rsi_utils.c
ROM_WL_rsi_uint16_to_2bytes#
void ROM_WL_rsi_uint16_to_2bytes (global_cb_t * global_cb_p, uint8_t * dBuf, uint16_t val)
Convert uint16 to two byte array.
[in] | global_cb_p | - pointer to the common buffer |
[in] | dBuf | - pointer to buffer to put the data in |
[in] | val | - data to convert |
Returns
void
40
of file driver/rsi_utils_rom.c
ROM_WL_rsi_uint32_to_4bytes#
void ROM_WL_rsi_uint32_to_4bytes (global_cb_t * global_cb_p, uint8_t * dBuf, uint32_t val)
Convert uint32 to four byte array.
[in] | global_cb_p | - pointer to the common buffer |
[in] | dBuf | - pointer to the buffer to put the data in |
[in] | val | - data to convert |
Returns
void
61
of file driver/rsi_utils_rom.c
ROM_WL_rsi_bytes2R_to_uint16#
uint16_t ROM_WL_rsi_bytes2R_to_uint16 (global_cb_t * global_cb_p, uint8_t * dBuf)
Convert a 2 byte array to uint16, first byte in array is LSB.
[in] | global_cb_p | - pointer to the common buffer |
[in] | dBuf | - pointer to a buffer to get the data from |
Returns
Converted data
85
of file driver/rsi_utils_rom.c
ROM_WL_rsi_bytes4R_to_uint32#
uint32_t ROM_WL_rsi_bytes4R_to_uint32 (global_cb_t * global_cb_p, uint8_t * dBuf)
Convert a 4 byte array to uint32, first byte in array is LSB.
[in] | global_cb_p | - pointer to the common buffer |
[in] | dBuf | - pointer to buffer to get the data from |
Returns
Converted data
109
of file driver/rsi_utils_rom.c