g0b1vetx-board/middleware/Util/util.h
2584532475@qq.com 4a963bd78c 2024-05-31
2024-05-31 16:57:54 +08:00

36 lines
542 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;
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