num2str.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * NUM2STR - Functions to handle the conversion of numeric vales to strings.
  3. *
  4. * @author Neven Boyanov
  5. *
  6. * This is part of the Tinusaur/TinyAVRLib project.
  7. *
  8. * Copyright (c) 2017 Neven Boyanov, The Tinusaur Team. All Rights Reserved.
  9. * Distributed as open source software under MIT License, see LICENSE.txt file.
  10. * Retain in your source code the link http://tinusaur.org to the Tinusaur project.
  11. *
  12. * Source code available at: https://bitbucket.org/tinusaur/tinyavrlib
  13. *
  14. */
  15. // ============================================================================
  16. #ifndef NUM2STR_H
  17. #define NUM2STR_H
  18. // ----------------------------------------------------------------------------
  19. #include <stdint.h>
  20. // ----------------------------------------------------------------------------
  21. #define USINT2DECASCII_MAX_DIGITS 5
  22. #define USINT2HEXASCII_MAX_DIGITS 4
  23. #define USINT2BINASCII_MAX_DIGITS 16
  24. // ----------------------------------------------------------------------------
  25. uint8_t usint2decascii(uint16_t, char *);
  26. uint8_t usint2hexascii(uint16_t, char *);
  27. uint8_t usint2binascii(uint16_t, char *);
  28. // ----------------------------------------------------------------------------
  29. #endif
  30. // ============================================================================