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 destination array.
Convert integer value into null-terminated string and stores the result in the array given by str parameter.
Convert string to an integer.
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.
Convert 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 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 is returned here. |
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 destination 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 the result in the array given by str parameter.
[in] | val | - Value to be converted to a string |
[in] | str | - Array in memory where to store the resulting null-terminated string |
Returns
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 | - This is the string representation of an integral number |
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 num
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
value in integer
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 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 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
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