mylib.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef __MYLIB_H
  2. #define __MYLIB_H
  3. /*********************************************************************************************************/
  4. #include "stdint.h"
  5. #include "time.h"
  6. #include "bs_type.h"
  7. uint32_t mylib_sum(const uint8_t *p, uint16_t size);
  8. int mylib_memcmp(const void *p1, const void *p2, int size);
  9. int mylib_memcmp_b(uint8_t *p1, uint8_t value, int size);
  10. void mylib_uDelay(uint32_t us);
  11. uint16_t mylib_crc16(uint8_t *p, uint16_t size);
  12. void mylib_BigtoLittle16(const void *frm, void *to, uint16_t size);
  13. void mylib_BigtoLittle32(const void *frm, void *to, uint16_t size);
  14. double mylib_BigtoLittle_fp64(double dat);
  15. uint8_t mylib_HEXtoBCD(uint8_t hex);
  16. uint8_t mylib_BCDtoHEX(uint8_t bcd);
  17. char *my_itoa(int value, char *str, uint8_t radix);
  18. int mylib_bytes_to_string(char *str, const uint8_t *bytes, int size);
  19. int mylib_string_to_bytes(char *str, uint8_t *bytes);
  20. char *strlwr(char *str);
  21. int strval(char *str, char *num);
  22. void printf_hex(const uint8_t *p, int size);
  23. void utc_to_time(uint32_t utc_s, struct tm *t, int tz);
  24. int mylib_day_index(uint8_t mon, uint8_t day);
  25. uint32_t htoi(const char *s);
  26. uint32_t _msize(const void *mp);
  27. /*********************************************************************************************************/
  28. #endif
  29. /*******************************************************************************************************
  30. ** End Of File
  31. ********************************************************************************************************/