2021-06-30 12:02:46 +00:00
|
|
|
#pragma once
|
|
|
|
#include "stdint.h"
|
|
|
|
#include "stdbool.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-05-24 14:00:15 +00:00
|
|
|
/** Convert ASCII hex value to nibble
|
|
|
|
* @param c ASCII character
|
|
|
|
* @param nibble nibble pointer, output
|
|
|
|
*
|
|
|
|
* @return bool conversion status
|
2021-06-30 12:02:46 +00:00
|
|
|
*/
|
|
|
|
bool hex_char_to_hex_nibble(char c, uint8_t* nibble);
|
|
|
|
|
2022-05-24 14:00:15 +00:00
|
|
|
/** Convert ASCII hex values to byte
|
|
|
|
* @param hi hi nibble text
|
|
|
|
* @param low low nibble text
|
|
|
|
* @param value output value
|
|
|
|
*
|
|
|
|
* @return bool conversion status
|
2021-11-04 10:06:13 +00:00
|
|
|
*/
|
|
|
|
bool hex_chars_to_uint8(char hi, char low, uint8_t* value);
|
|
|
|
|
2022-05-24 14:00:15 +00:00
|
|
|
/** Convert ASCII hex values to uint64_t
|
|
|
|
* @param value_str ASCII 64 bi data
|
|
|
|
* @param value output value
|
|
|
|
*
|
|
|
|
* @return bool conversion status
|
|
|
|
*/
|
|
|
|
bool hex_chars_to_uint64(const char* value_str, uint64_t* value);
|
|
|
|
|
2021-06-30 12:02:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2022-05-06 13:37:10 +00:00
|
|
|
#endif
|