/* * em7180.h * * Created on: Jan 18, 2021 * Author: Daniel Peter Chokola * * Adapted From: * EM7180_LSM6DSM_LIS2MDL_LPS22HB_Butterfly * by: Kris Winer * 06/29/2017 Copyright Tlera Corporation * * Library may be used freely and without limit with attribution. */ #ifndef EM7180_H_ #define EM7180_H_ /* Includes */ #include /* Definitions */ /* * EM7180 SENtral register map * see http://www.emdeveloper.com/downloads/7180/EMSentral_EM7180_Register_Map_v1_3.pdf */ #define EM7180_QX 0x00 // this is a 32-bit normalized floating point number read from registers 0x00-03 #define EM7180_QY 0x04 // this is a 32-bit normalized floating point number read from registers 0x04-07 #define EM7180_QZ 0x08 // this is a 32-bit normalized floating point number read from registers 0x08-0B #define EM7180_QW 0x0C // this is a 32-bit normalized floating point number read from registers 0x0C-0F #define EM7180_QTIME 0x10 // this is a 16-bit unsigned integer read from registers 0x10-11 #define EM7180_MX 0x12 // int16_t from registers 0x12-13 #define EM7180_MY 0x14 // int16_t from registers 0x14-15 #define EM7180_MZ 0x16 // int16_t from registers 0x16-17 #define EM7180_MTIME 0x18 // uint16_t from registers 0x18-19 #define EM7180_AX 0x1A // int16_t from registers 0x1A-1B #define EM7180_AY 0x1C // int16_t from registers 0x1C-1D #define EM7180_AZ 0x1E // int16_t from registers 0x1E-1F #define EM7180_ATIME 0x20 // uint16_t from registers 0x20-21 #define EM7180_GX 0x22 // int16_t from registers 0x22-23 #define EM7180_GY 0x24 // int16_t from registers 0x24-25 #define EM7180_GZ 0x26 // int16_t from registers 0x26-27 #define EM7180_GTIME 0x28 // uint16_t from registers 0x28-29 #define EM7180_Baro 0x2A // start of two-byte MS5637 pressure data, 16-bit signed interger #define EM7180_BaroTIME 0x2C // start of two-byte MS5637 pressure timestamp, 16-bit unsigned #define EM7180_Temp 0x2E // start of two-byte MS5637 temperature data, 16-bit signed interger #define EM7180_TempTIME 0x30 // start of two-byte MS5637 temperature timestamp, 16-bit unsigned #define EM7180_QRateDivisor 0x32 // uint8_t #define EM7180_EnableEvents 0x33 #define EM7180_HostControl 0x34 #define EM7180_EventStatus 0x35 #define EM7180_SensorStatus 0x36 #define EM7180_SentralStatus 0x37 #define EM7180_AlgorithmStatus 0x38 #define EM7180_FeatureFlags 0x39 #define EM7180_ParamAcknowledge 0x3A #define EM7180_SavedParamByte0 0x3B #define EM7180_SavedParamByte1 0x3C #define EM7180_SavedParamByte2 0x3D #define EM7180_SavedParamByte3 0x3E #define EM7180_ActualMagRate 0x45 #define EM7180_ActualAccelRate 0x46 #define EM7180_ActualGyroRate 0x47 #define EM7180_ActualBaroRate 0x48 #define EM7180_ActualTempRate 0x49 #define EM7180_ErrorRegister 0x50 #define EM7180_AlgorithmControl 0x54 #define EM7180_MagRate 0x55 #define EM7180_AccelRate 0x56 #define EM7180_GyroRate 0x57 #define EM7180_BaroRate 0x58 #define EM7180_TempRate 0x59 #define EM7180_LoadParamByte0 0x60 #define EM7180_LoadParamByte1 0x61 #define EM7180_LoadParamByte2 0x62 #define EM7180_LoadParamByte3 0x63 #define EM7180_ParamRequest 0x64 #define EM7180_ROMVersion1 0x70 #define EM7180_ROMVersion2 0x71 #define EM7180_RAMVersion1 0x72 #define EM7180_RAMVersion2 0x73 #define EM7180_ProductID 0x90 #define EM7180_RevisionID 0x91 #define EM7180_RunStatus 0x92 #define EM7180_UploadAddress 0x94 // uint16_t registers 0x94 (MSB)-5(LSB) #define EM7180_UploadData 0x96 #define EM7180_CRCHost 0x97 // uint32_t from registers 0x97-9A #define EM7180_ResetRequest 0x9B #define EM7180_PassThruStatus 0x9E #define EM7180_PassThruControl 0xA0 #define EM7180_ACC_LPF_BW 0x5B //Register GP36 #define EM7180_GYRO_LPF_BW 0x5C //Register GP37 #define EM7180_BARO_LPF_BW 0x5D //Register GP38 #define EM7180_ADDRESS 0x28 // Address of the EM7180 SENtral sensor hub #define M24512DFM_DATA_ADDRESS 0x50 // Address of the 500 page M24512DFM EEPROM data buffer, 1024 bits (128 8-bit bytes) per page #define M24512DFM_IDPAGE_ADDRESS 0x58 // Address of the single M24512DFM lockable EEPROM ID page #define AFS_2G 0 #define AFS_4G 1 #define AFS_8G 2 #define AFS_16G 3 #define GFS_250DPS 0 #define GFS_500DPS 1 #define GFS_1000DPS 2 #define GFS_2000DPS 3 #define MFS_14BITS 0 // 0.6 mG per LSB #define MFS_16BITS 1 // 0.15 mG per LSB /* Function Prototypes */ void em7180_gyro_set_fs(uint16_t gyro_fs); void em7180_mag_acc_set_fs(uint16_t mag_fs, uint16_t acc_fs); void em7180_set_integer_param(uint8_t param, uint32_t param_val); #endif /* EM7180_H_ */