110VCGQ/project/110Vchuanganqi/Core/Inc/user_lib.h

35 lines
857 B
C
Raw Normal View History

2023-07-12 15:15:16 +08:00
/*
* user_lib.h
*
* Created on: 2023130
* Author: wyf
*/
#ifndef INC_USER_LIB_H_
#define INC_USER_LIB_H_
#include "user.h"
int str_len(char *_str);
void str_cpy(char *_tar, char *_src);
int str_cmp(char * s1, char * s2);
void mem_set(char *_tar, char _data, int _len);
void int_to_str(int _iNumber, char *_pBuf, unsigned char _len);
int str_to_int(char *_pStr);
uint16_t BEBufToUint16(uint8_t *_pBuf);
uint16_t LEBufToUint16(uint8_t *_pBuf);
uint32_t BEBufToUint32(uint8_t *_pBuf);
uint32_t LEBufToUint32(uint8_t *_pBuf);
uint16_t CRC16_Modbus(uint8_t *_pBuf, uint16_t _usLen) ;
int32_t CaculTwoPoint(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x);
char BcdToChar(uint8_t _bcd);
void HexToAscll(uint8_t * _pHex, char *_pAscii, uint16_t _BinBytes);
uint32_t AsciiToUint32(char *pAscii);
#endif /* INC_USER_LIB_H_ */