g0b1vetx-board/middleware/Util/util.h
2584532475@qq.com 0f40dd8b17 网络自适应
2024-09-10 11:51:07 +08:00

53 lines
679 B
C

#ifndef _UTIL_H
#define _UTIL_H
#include <stdint.h>
typedef union
{
uint32_t data;
char byte[4];
} Int;
typedef union
{
float data;
char byte[4];
} Float;
typedef union{
int16_t value;
char byte[2];
}Int16Tobyte;
typedef union
{
uint32_t val;
uint8_t valBuf[4];
} DSH_INT_U;
typedef union
{
float val;
uint8_t valBuf[4];
} DSH_FLOAT_U;
float Bytes2Float (char * data);
uint32_t Bytes2Int (char * data);
int hexstr_to_hexbyte (char *src, char *obj, uint16_t length);
float iee754_to_float (char * data);
uint32_t byte_to_Inverse(char * data);
// 754 תfloat
float float_to_iee754 (float ff1,char * data);
int16_t Bytes2Int16 (char * data);
#endif