2025-01-14 18:25:02 +08:00
|
|
|
|
/*************************************************************************************************
|
|
|
|
|
**Filename: lsm6d.h
|
|
|
|
|
**Version :
|
|
|
|
|
**Author :
|
|
|
|
|
**Date :
|
|
|
|
|
**Description:
|
|
|
|
|
**
|
|
|
|
|
*************************************************************************************************/
|
|
|
|
|
#ifndef __LSM6D_H_
|
|
|
|
|
#define __LSM6D_H_
|
|
|
|
|
|
|
|
|
|
#include "ARMCM0.h"
|
|
|
|
|
#include "lsm6dso_reg.h"
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
|
* Global Macros ('#define')
|
|
|
|
|
*/
|
|
|
|
|
#define LSM6DSO_ADDRESS (LSM6DSO_I2C_ADD_L>>1)
|
|
|
|
|
#define LSM6DSO_ID 0x6C
|
|
|
|
|
|
|
|
|
|
#ifndef ABS
|
|
|
|
|
#define ABS(x) ((x) < 0 ? -(x) : (x))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
|
* Struct type definitions('typedef')
|
|
|
|
|
*/
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
float C_angle;
|
|
|
|
|
float bias_cf;
|
|
|
|
|
float C_angle_dot;
|
|
|
|
|
|
|
|
|
|
}tFilter_Type;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
uint8_t exist;
|
|
|
|
|
uint8_t batt_level;
|
2025-06-20 14:26:06 +08:00
|
|
|
|
uint16_t batt_vol;
|
2025-01-14 18:25:02 +08:00
|
|
|
|
int16_t RPM;
|
|
|
|
|
int16_t angle;
|
|
|
|
|
uint8_t actFlag;
|
|
|
|
|
uint8_t adjustFlag;
|
|
|
|
|
uint16_t sleepCnt;
|
|
|
|
|
uint8_t sleepFlag;
|
2025-06-12 14:56:12 +08:00
|
|
|
|
uint8_t sleepState;
|
|
|
|
|
uint8_t chargeState;
|
2025-06-20 14:26:06 +08:00
|
|
|
|
uint32_t transpModes; //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>־λ ע<>⣺Ҫռ4<D5BC><34><EFBFBD>ֽڣ<D6BD><DAA3><EFBFBD><EFBFBD><EFBFBD>Flash<73><68><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD>־λ<D6BE><CEBB>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
uint8_t exitTransmode; //<2F>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>־
|
2025-01-14 18:25:02 +08:00
|
|
|
|
|
|
|
|
|
} PAS_SENSOR_t;
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
|
* Global Variable declared ('extern')
|
|
|
|
|
*/
|
|
|
|
|
extern float Angle;
|
|
|
|
|
extern PAS_SENSOR_t PAS;
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
|
* Global Function declared ('extern')
|
|
|
|
|
*/
|
|
|
|
|
void Lsm6dso_Init(void);
|
|
|
|
|
void Lsm6dso_RPM_Cal(void);
|
|
|
|
|
void Lsm6dso_Correct(void);
|
|
|
|
|
void Lsm6dso_Disable(void);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|