hex.h 553 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include "stdint.h"
  3. #include "stdbool.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /**
  8. * Convert ASCII hex value to nibble
  9. * @param c ASCII character
  10. * @param nibble nibble pointer, output
  11. * @return bool conversion status
  12. */
  13. bool hex_char_to_hex_nibble(char c, uint8_t* nibble);
  14. /**
  15. * Convert ASCII hex values to byte
  16. * @param hi hi nibble text
  17. * @param low low nibble text
  18. * @param value output value
  19. * @return bool conversion status
  20. */
  21. bool hex_chars_to_uint8(char hi, char low, uint8_t* value);
  22. #ifdef __cplusplus
  23. }
  24. #endif