1 Star 0 Fork 0

NEO/ADIS16505

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
adis16505.h 6.10 KB
一键复制 编辑 原始数据 按行查看 历史
/**
* @file adis16505.h
* @brief Header file for the ADIS16505 inertial sensor driver.
*
* This header file contains the function declarations and type definitions
* necessary for interfacing with the ADIS16505 inertial sensor.
*
* @author Neo
* @date March, 2024
* @version V2.0
*
* @note This driver assumes a specific hardware interface and communication protocol.
* Please refer to the ADIS16505 datasheet for more details.
*/
#ifndef __ADIS16505_H
#define __ADIS16505_H
#include "platform_specific_impl.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define tSTALL 20 // Stall period between data (≥16) (unit: us)
/* SENSITIVITY */
// 32-bit data format (divide by 65536.0 (2^16) for 16-bit data format)
#define ACCL_SENSITIVITY 26756268.0 // LSB/(m/sec^2) ≈ 2.45e-3 m/sec^2/LSB
// ADIS16505-1BMLZ
#define GYRO_SENSITIVITY_1 10485760.0 // LSB/(°/sec) = 0.00625 °/sec/LSB
// ADIS16505-2BMLZ
#define GYRO_SENSITIVITY_2 2621440.0 // LSB/(°/sec) = 0.025 °/sec/LSB
// ADIS16505-3BMLZ
#define GYRO_SENSITIVITY_3 655360.0 // LSB/(°/sec) = 0.1 °/sec/LSB
/* TEMPERATURE SENSOR */
#define TEMP_SCALE_FACTOR 0.1 // 0.1°C/LSB
/* REGISTER MEMORY MAP */
#define FLASH_CNT 0x00 // Flash memory write count
#define DIAG_STAT 0x02 // Diagnostic and operational status
#define X_GYRO_LOW 0x04 // X-axis gyroscope output, lower word
#define X_GYRO_OUT 0x06 // X-axis gyroscope output, upper word
#define Y_GYRO_LOW 0x08 // Y-axis gyroscope output, lower word
#define Y_GYRO_OUT 0x0A // Y-axis gyroscope output, upper word
#define Z_GYRO_LOW 0x0C // Z-axis gyroscope output, lower word
#define Z_GYRO_OUT 0x0E // Z-axis gyroscope output, upper word
#define X_ACCL_LOW 0x10 // X-axis accelerometer output, lower word
#define X_ACCL_OUT 0x12 // X-axis accelerometer output, upper word
#define Y_ACCL_LOW 0x14 // Y-axis accelerometer output, lower word
#define Y_ACCL_OUT 0x16 // Y-axis accelerometer output, upper word
#define Z_ACCL_LOW 0x18 // Z-axis accelerometer output, lower word
#define Z_ACCL_OUT 0x1A // Z-axis accelerometer output, upper word
#define TEMP_OUT 0x1C // Temperature output (internal, not calibrated)
#define TIME_STAMP 0x1E // PPS mode time stamp
#define DATA_CNT 0x22
#define X_DELTANG_LOW 0x24 // X-axis delta angle output, lower word
#define X_DELTANG_OUT 0x26 // X-axis delta angle output, upper word
#define Y_DELTANG_LOW 0x28 // Y-axis delta angle output, lower word
#define Y_DELTANG_OUT 0x2A // Y-axis delta angle output, upper word
#define Z_DELTANG_LOW 0x2C // Z-axis delta angle output, lower word
#define Z_DELTANG_OUT 0x2E // Z-axis delta angle output, upper word
#define X_DELTVEL_LOW 0x30 // X-axis delta velocity output, lower word
#define X_DELTVEL_OUT 0x32 // X-axis delta velocity output, upper word
#define Y_DELTVEL_LOW 0x34 // Y-axis delta velocity output, lower word
#define Y_DELTVEL_OUT 0x36 // Y-axis delta velocity output, upper word
#define Z_DELTVEL_LOW 0x38 // Z-axis delta velocity output, lower word
#define Z_DELTVEL_OUT 0x3A // Z-axis delta velocity output, upper word
#define XG_BIAS_LOW 0x40 // X-axis gyroscope bias offset correction, lower word
#define XG_BIAS_HIGH 0x42 // X-axis gyroscope bias offset correction, upper word
#define YG_BIAS_LOW 0x44 // Y-axis gyroscope bias offset correction, lower word
#define YG_BIAS_HIGH 0x46 // Y-axis gyroscope bias offset correction, upper word
#define ZG_BIAS_LOW 0x48 // Z-axis gyroscope bias offset correction, lower word
#define ZG_BIAS_HIGH 0x4A // Z-axis gyroscope bias offset correction, upper word
#define XA_BIAS_LOW 0x4C // X-axis accelerometer bias offset correction, lower word
#define XA_BIAS_HIGH 0x4E // X-axis accelerometer bias offset correction, upper word
#define YA_BIAS_LOW 0x50 // Y-axis accelerometer bias offset correction, lower word
#define YA_BIAS_HIGH 0x52 // Y-axis accelerometer bias offset correction, upper word
#define ZA_BIAS_LOW 0x54 // Z-axis accelerometer bias offset correction, lower word
#define ZA_BIAS_HIGH 0x56 // Z-axis accelerometer bias offset correction, upper word
#define FILT_CTRL 0x5C // Filter control
#define RANG_MDL 0x5E // Measurement range (model specific) identifier
#define MSC_CTRL 0x60 // Miscellaneous control
#define UP_SCALE 0x62 // Clock scale factor, PPS mode
#define DEC_RATE 0x64 // Decimation rate control (output data rate)
#define NULL_CNFG 0x66 // Auto-null configuration control
#define GLOB_CMD 0x68 // Global commands
#define FIRM_REV 0x6C // Firmware revision
#define FIRM_DM 0x6E // Firmware revision date, month and day
#define FIRM_Y 0x70 // Firmware revision date, year
#define PROD_ID 0x72 // Product identification
#define SERIAL_NUM 0x74 // Serial number (relative to assembly lot)
#define USER_SCR1 0x76 // User scratch register 1
#define USER_SCR2 0x78 // User scratch register 2
#define USER_SCR3 0x7A // User scratch register 3
#define FLSHCNT_LOW 0x7C // Flash update count, lower word
#define FLSHCNT_HIGH 0x7E // Flash update count, upper word
#define BURST_CMD 0x6800 // burst read command
typedef struct __ADIS16505_PropTypDef {
/* sensitivity */
float Gyro_sens_32bit;
float Gyro_sens_16bit;
float Accel_sens_32bit;
float Accel_sens_16bit;
/* user calibration */
int32_t Gyro_bias[3];
int32_t Accel_bias[3];
} ADIS16505_PropTypeDef;
typedef struct __ADIS16505_DataTypeDef {
// origin data from ADIS16505
volatile int32_t Gyro_raw[3];
volatile int32_t Accel_raw[3];
// store real data in float
float Gyro[3]; // deg/sec
float Accel[3]; // m/sec^2
float Temp; // °C
} ADIS16505_DataTypeDef;
typedef struct __ADIS16505 {
ADIS16505_PropTypeDef prop;
ADIS16505_DataTypeDef data;
} ADIS16505;
void ADIS16505_StructInit(ADIS16505 *pImu);
uint16_t ADIS16505_ReadID(ADIS16505 *imu);
uint8_t ADIS16505_Init(ADIS16505 *imu);
void ADIS16505_ReadGyro(ADIS16505 *imu);
void ADIS16505_ReadAccel(ADIS16505 *mpu);
void ADIS16505_ReadTemp(ADIS16505 *imu);
uint8_t ADIS16505_BurstRead(ADIS16505 *imu);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __ADIS16505_H */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qCwCp/ADIS16505.git
git@gitee.com:qCwCp/ADIS16505.git
qCwCp
ADIS16505
ADIS16505
main

搜索帮助