94 lines
1.6 KiB
C
94 lines
1.6 KiB
C
|
/*
|
|||
|
* struct.h
|
|||
|
*
|
|||
|
* Created on: 23 <EFBFBD><EFBFBD><EFBFBD>. 2019 <EFBFBD>.
|
|||
|
* Author: toporov
|
|||
|
*/
|
|||
|
|
|||
|
#ifndef STRUCT_H_
|
|||
|
#define STRUCT_H_
|
|||
|
|
|||
|
#include "stm32f4xx_hal.h"
|
|||
|
#include <stdbool.h>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
typedef union
|
|||
|
{
|
|||
|
uint8_t ch[4];
|
|||
|
uint16_t sh[2];
|
|||
|
uint32_t lg;
|
|||
|
float fl;
|
|||
|
} sfloat;
|
|||
|
|
|||
|
typedef union{
|
|||
|
uint8_t ch[4];
|
|||
|
float fl;
|
|||
|
} usfloat;
|
|||
|
|
|||
|
typedef union
|
|||
|
{
|
|||
|
uint8_t ch[8];
|
|||
|
uint16_t sh[4];
|
|||
|
uint32_t lg[2];
|
|||
|
float fl32[2];
|
|||
|
double fl64;
|
|||
|
} sfloat64;
|
|||
|
|
|||
|
typedef union
|
|||
|
{
|
|||
|
uint8_t ch[4];
|
|||
|
uint32_t lg;
|
|||
|
} ulong_t;
|
|||
|
|
|||
|
typedef union
|
|||
|
{
|
|||
|
uint8_t ch[4];
|
|||
|
int32_t lg;
|
|||
|
} long_t;
|
|||
|
|
|||
|
|
|||
|
typedef union{
|
|||
|
uint8_t ch[2];
|
|||
|
uint16_t sh;
|
|||
|
} usshort;
|
|||
|
|
|||
|
typedef union
|
|||
|
{
|
|||
|
uint8_t ch[2];
|
|||
|
int16_t sh;
|
|||
|
} sshort_t;
|
|||
|
|
|||
|
//*********************************************************************************************************************************
|
|||
|
//*********************************************************************************************************************************
|
|||
|
//*********************************************************************************************************************************
|
|||
|
|
|||
|
typedef struct
|
|||
|
{
|
|||
|
uint16_t OWN; // 0,1 4001
|
|||
|
uint16_t BAUD; // 2,3 4002
|
|||
|
uint16_t INFB; // 4,5 4003
|
|||
|
|
|||
|
uint16_t IIN; // 6,7 5001
|
|||
|
uint16_t IFV; // 8,9 5002
|
|||
|
uint16_t IFN; // 10,11 5003
|
|||
|
uint16_t IKU; // 12,13 5004
|
|||
|
uint16_t IKE; // 14,15 5005
|
|||
|
uint16_t IKD; // 16,17 5006
|
|||
|
uint16_t IKS; // 18,19 5007
|
|||
|
uint16_t IPZ; // 20,21 5008
|
|||
|
uint16_t OPZ; // 22,23 5009
|
|||
|
|
|||
|
float KCOND; // 24,25,26,27 7501
|
|||
|
float SENS; // 28,29,30,31 7502
|
|||
|
float ACCEL; // 32,33,34,35 7503
|
|||
|
|
|||
|
} UserData_TypeDef; // ********LENGTH = 28 bytes***********
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#endif /* STRUCT_H_ */
|