123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /***
- * @Author: chenjie
- * @Date: 2022-06-06
- * @LastEditTime: 2022-10-27
- * @LastEditors: chenjie
- * @Description:
- * @FilePath: \S32K146_4G\code\app\lib\AppFuncLib.h
- * @Copyright (c) 2022 by chenjie, All Rights Reserved.
- */
- #ifndef APPFUNCLIB_H_
- #define APPFUNCLIB_H_
- #include "hal_adapter.h"
- #include <stdarg.h>
- #include "stdio.h"
- #ifndef va_copy
- #define va_copy(dst, src) memcpy(&(dst), &(src), sizeof(va_list))
- #endif
- uint16 GetErrorNum(uint16 *ErrorArray, uint8 Errorlen);
- uint8 PutErrorNum(uint16 *ErrorArray, uint8 Errorlen, uint16 ErrorNum);
- uint16 ATstrdel(char *str);
- uint16 mstrlen(const char *s);
- int mstrncmp(const char *s1, const char *s2, int n);
- unsigned char HexToChar(unsigned char bHex);
- unsigned char CharToHex(unsigned char bChar);
- uint8 AtStrCompare(const char *a, const char *b);
- unsigned short CRC16_Modbus(unsigned char *pdata, int len);
- uint8 bcc_chk(uint8 *data, uint16 length);
- char *Myitoa(int value, char *result, int base);
- // 整数转字符串
- int _itoa(int num, char buf[32]);
- int _i2a(int num, char buf[32], int radix);
- // 浮点转字符串
- int _ftoa(double val, char buf[32], int eps);
- // 浮点转字符串,范围(-1,1)
- int __ftoa(double val, char buf[32], int eps);
- // 替代sprintf
- int _sprintf(char *dst, const char *format, ...);
- //串口校验
- uint16 crc_chk(uint8 *data, uint8 length);
- #endif /* APPFUNCLIB_H_ */
|