mikroSDK Reference Manual
|
Conversions library API Reference. More...
Functions list | |
void | int8_to_hex (int8_t input, char *output) |
Converts int8_t to hex value. More... | |
void | uint8_to_hex (uint8_t input, char *output) |
Converts uint8_t to hex value. More... | |
void | uint16_to_hex (uint16_t input, char *output) |
Converts uint16_t to hex value. More... | |
void | int16_to_hex (int16_t input, char *output) |
Converts int16_t to hex value. More... | |
void | uint32_to_hex (uint32_t input, char *output) |
Converts uint32_t to hex value. More... | |
void | int32_to_hex (int32_t input, char *output) |
Converts int32_t to hex value. More... | |
void | uint64_to_hex (uint64_t input, char *output) |
Converts uint64_t to hex value. More... | |
void | int64_to_hex (int64_t input, char *output) |
Converts int64_t to hex value. More... | |
void | uint8_to_str (uint8_t input, char *output) |
Converts uint8_t to string. More... | |
void | uint8_to_str_with_zeros (uint8_t input, char *output) |
Converts uint8_t to string with zeros. More... | |
void | uint16_to_str (uint16_t input, char *output) |
Converts uint16_t to string. More... | |
void | uint16_to_str_with_zeros (uint16_t input, char *output) |
Converts uint16_t to string with zeros. More... | |
void | int8_to_str (int8_t input, char *output) |
Converts int8_t to string. More... | |
void | int8_to_str_with_zeros (int8_t input, char *output) |
Converts int8_t to string with zeros. More... | |
void | int16_to_str (int16_t input, char *output) |
Converts int16_t to string. More... | |
void | int16_to_str_with_zeros (int16_t input, char *output) |
Converts int16_t to string with zeros. More... | |
void | uint32_to_str (uint32_t input, char *output) |
Converts uint32_t to string. More... | |
void | uint32_to_str_with_zeros (uint32_t input, char *output) |
Converts uint32_t to string with zeros. More... | |
void | int32_to_str (int32_t input, char *output) |
Converts int32_t to string. More... | |
void | int32_to_str_with_zeros (int32_t input, char *output) |
Converts int32_t to string with zeros. More... | |
void | uint64_to_str_with_zeros (uint64_t input, char *output) |
Converts uint64_t to string with zeros. More... | |
void | int64_to_str_with_zeros (int64_t input, char *output) |
Converts int64_t to string with zeros. More... | |
void | uint64_to_str (uint64_t input, char *output) |
Converts uint64_t to string. More... | |
void | int64_to_str (int64_t input, char *output) |
Converts int64_t to string. More... | |
uint8_t | dec_to_bcd (uint8_t decnum) |
Converts decimal number to bcd value. More... | |
uint8_t | bcd_to_dec (uint8_t bcdnum) |
Converts bcd value to decimal number. More... | |
uint16_t | bcd_to_dec16 (uint16_t bcdnum) |
Converts bcd value to decimal number. More... | |
uint16_t | dec_to_bcd16 (uint16_t decnum) |
Converts decimal number to bcd value. More... | |
char * | r_trim (char *string) |
Trims the trailing spaces from an array given with *string. More... | |
char * | l_trim (char *string) |
Trims the leading spaces from an array given with *string. More... | |
uint8_t | float_to_str (float f_num, char *string) |
Converts floating point number into string. More... | |
uint8_t | str_to_uint8 (char uint8_in[3]) |
Converts string into uint8. More... | |
int8_t | str_to_int8 (char int8_in[4]) |
Converts string into int8. More... | |
int16_t | str_to_int16 (char int16_in[6]) |
Converts string into int16. More... | |
uint16_t | str_to_uint16 (char uint16_in[5]) |
Converts string into uint16. More... | |
uint32_t | str_to_uint32 (char uint32_in[10]) |
Converts string into uint32. More... | |
int32_t | str_to_int32 (char int32_in[11]) |
Converts string into int32. More... | |
int64_t | str_to_int64 (char int64_in[20]) |
Converts string into int64. More... | |
uint64_t | str_to_uint64 (char uint64_in[20]) |
Converts string into uint64. More... | |
float | str_to_float (char data_str[20]) |
Converts string into float. More... | |
uint8_t | hex_to_uint8 (char hex_in[2]) |
Converts hex into uint8. More... | |
uint16_t | hex_to_uint16 (char hex_in[4]) |
Converts hex into uint16. More... | |
uint32_t | hex_to_uint32 (char hex_in[8]) |
Converts hex into uint32. More... | |
uint64_t | hex_to_uint64 (char hex_in[16]) |
Converts hex into uint64. More... | |
int8_t | hex_to_int8 (char hex_in[2]) |
Converts hex into int8. More... | |
int16_t | hex_to_int16 (char hex_in[4]) |
Converts hex into int16. More... | |
int32_t | hex_to_int32 (char hex_in[8]) |
Converts hex into int32. More... | |
int64_t | hex_to_int64 (char hex_in[16]) |
Converts hex into int64. More... | |
uint8_t | long_double_to_str (long double dnum, char *str) |
Converts a long double number into a string. More... | |
The Conversions Library provides routines for converting numerals to strings and BCD/decimal conversions.
void int8_to_hex | ( | int8_t | input, |
char * | output | ||
) |
Converts input number to a string containing the number's hexadecimal representation.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint8_to_hex | ( | uint8_t | input, |
char * | output | ||
) |
Converts input number to a string containing the number's hexadecimal representation.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint16_to_hex | ( | uint16_t | input, |
char * | output | ||
) |
Converts input number to a string containing the number's hexadecimal representation.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int16_to_hex | ( | int16_t | input, |
char * | output | ||
) |
Converts input number to a string containing the number's hexadecimal representation.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint32_to_hex | ( | uint32_t | input, |
char * | output | ||
) |
Converts input number to a string containing the number's hexadecimal representation.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int32_to_hex | ( | int32_t | input, |
char * | output | ||
) |
Converts input number to a string containing the number's hexadecimal representation.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint64_to_hex | ( | uint64_t | input, |
char * | output | ||
) |
Converts input number to a string containing the number's hexadecimal representation.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int64_to_hex | ( | int64_t | input, |
char * | output | ||
) |
Converts input number to a string containing the number's hexadecimal representation.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint8_to_str | ( | uint8_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint8_to_str_with_zeros | ( | uint8_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint16_to_str | ( | uint16_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint16_to_str_with_zeros | ( | uint16_t | input, |
char * | output | ||
) |
Converts input value to a string. The output string is right justified and remaining positions on the left (if any) are filled with zeros.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int8_to_str | ( | int8_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int8_to_str_with_zeros | ( | int8_t | input, |
char * | output | ||
) |
Converts input value to a string. The output string is right justified and remaining positions on the left (if any) are filled with zeros.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int16_to_str | ( | int16_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int16_to_str_with_zeros | ( | int16_t | input, |
char * | output | ||
) |
Converts input value to a string. The output string is right justified and remaining positions on the left (if any) are filled with zeros.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint32_to_str | ( | uint32_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint32_to_str_with_zeros | ( | uint32_t | input, |
char * | output | ||
) |
Converts input value to a string. The output string is right justified and remaining positions on the left (if any) are filled with zeros.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int32_to_str | ( | int32_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int32_to_str_with_zeros | ( | int32_t | input, |
char * | output | ||
) |
Converts input value to a string. The output string is right justified and remaining positions on the left (if any) are filled with zeros.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint64_to_str_with_zeros | ( | uint64_t | input, |
char * | output | ||
) |
Converts input value to a string. The output string is right justified and remaining positions on the left (if any) are filled with zeros.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int64_to_str_with_zeros | ( | int64_t | input, |
char * | output | ||
) |
Converts input value to a string. The output string is right justified and remaining positions on the left (if any) are filled with zeros.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void uint64_to_str | ( | uint64_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
void int64_to_str | ( | int64_t | input, |
char * | output | ||
) |
Converts input value to a string.
[in] | input | Value to be converted. |
[out] | output | Destination string. |
uint8_t dec_to_bcd | ( | uint8_t | decnum | ) |
Converts 8-bit unsigned decimal number to its appropriate BCD representation.
[in] | decnum | Value to be converted. |
uint8_t bcd_to_dec | ( | uint8_t | bcdnum | ) |
Converts 8-bit BCD numeral to its decimal equivalent.
[in] | bcdnum | Value to be converted. |
uint16_t bcd_to_dec16 | ( | uint16_t | bcdnum | ) |
Converts 16-bit BCD numeral to its decimal equivalent.
[in] | bcdnum | Value to be converted. |
uint16_t dec_to_bcd16 | ( | uint16_t | decnum | ) |
Converts 16-bit unsigned decimal number to its appropriate BCD representation.
[in] | decnum | Value to be converted. |
char* r_trim | ( | char * | string | ) |
Trims the trailing spaces from an array given with *string.
[in] | string | Array to be trimmed. |
char* l_trim | ( | char * | string | ) |
Trims the leading spaces from array an given with *string.
[in] | string | Array to be trimmed. |
uint8_t float_to_str | ( | float | f_num, |
char * | string | ||
) |
Converts a floating point number to a string. The output string is left justified and null terminated after the last digit.
[in] | f_num | Floating point number to be converted. |
[out] | string | Pointer to a string where converted number is stored. |
0
- if conversion is ok (fnum is not +INF, -INF or NaN) 1
- if fnum is +INF 2
- if fnum is -INF 3
- if fnum is NaN uint8_t str_to_uint8 | ( | char | uint8_in[3] | ) |
Converts input string into uint8.
[in] | uint8_in | String to be converted. |
int8_t str_to_int8 | ( | char | int8_in[4] | ) |
Converts input string into int8.
[in] | int8_in | String to be converted. |
int16_t str_to_int16 | ( | char | int16_in[6] | ) |
Converts input string into int16.
[in] | int16_in | String to be converted. |
uint16_t str_to_uint16 | ( | char | uint16_in[5] | ) |
Converts input string into uint16.
[in] | uint16_in | String to be converted. |
uint32_t str_to_uint32 | ( | char | uint32_in[10] | ) |
Converts input string into uint32.
[in] | uint32_in | String to be converted. |
int32_t str_to_int32 | ( | char | int32_in[11] | ) |
Converts input string into int32.
[in] | int32_in | String to be converted. |
int64_t str_to_int64 | ( | char | int64_in[20] | ) |
Converts input string into int64.
[in] | int64_in | String to be converted. |
uint64_t str_to_uint64 | ( | char | uint64_in[20] | ) |
Converts input string into uint64.
[in] | uint64_in | String to be converted. |
float str_to_float | ( | char | data_str[20] | ) |
Converts input string into float.
[in] | data_str | String to be converted. |
uint8_t hex_to_uint8 | ( | char | hex_in[2] | ) |
Converts a string containing the number's hexadecimal representation to uint8.
[in] | hex_in | String to be converted. |
uint16_t hex_to_uint16 | ( | char | hex_in[4] | ) |
Converts a string containing the number's hexadecimal representation to uint16.
[in] | hex_in | String to be converted. |
uint32_t hex_to_uint32 | ( | char | hex_in[8] | ) |
Converts a string containing the number's hexadecimal representation to uint32.
[in] | hex_in | String to be converted. |
uint64_t hex_to_uint64 | ( | char | hex_in[16] | ) |
Converts a string containing the number's hexadecimal representation to uint64.
[in] | hex_in | String to be converted. |
int8_t hex_to_int8 | ( | char | hex_in[2] | ) |
Converts a string containing the number's hexadecimal representation to int8.
[in] | hex_in | String to be converted. |
int16_t hex_to_int16 | ( | char | hex_in[4] | ) |
Converts a string containing the number's hexadecimal representation to int16.
[in] | hex_in | String to be converted. |
int32_t hex_to_int32 | ( | char | hex_in[8] | ) |
Converts a string containing the number's hexadecimal representation to int32.
[in] | hex_in | String to be converted. |
int64_t hex_to_int64 | ( | char | hex_in[16] | ) |
Converts a string containing the number's hexadecimal representation to int64.
[in] | hex_in | String to be converted. |
uint8_t long_double_to_str | ( | long double | dnum, |
char * | str | ||
) |
Converts a long double number to a string. The output string is left justified and null terminated after the last digit.
[in] | dnum | Long double number to be converted. |
[out] | str | Pointer to a string where converted number is stored. |
0
- if conversion is ok (fnum is not +INF, -INF or NaN) 1
- if fnum is +INF 2
- if fnum is -INF 3
- if fnum is NaN