24
24
#include " SIM_I2C.h"
25
25
#include " SIM_ToshibaLED.h"
26
26
#include " SIM_MaxSonarI2CXL.h"
27
+ #include " SIM_BattMonitor_SMBus_Generic.h"
27
28
#include " SIM_BattMonitor_SMBus_Maxell.h"
28
29
#include " SIM_BattMonitor_SMBus_Rotoye.h"
29
30
#include " SIM_Airspeed_DLVR.h"
@@ -59,20 +60,38 @@ static IgnoredI2CDevice ignored;
59
60
#if AP_SIM_TOSHIBALED_ENABLED
60
61
static ToshibaLED toshibaled;
61
62
#endif
63
+ #if AP_SIM_MAXSONARI2CXL_ENABLED
62
64
static MaxSonarI2CXL maxsonari2cxl;
63
65
static MaxSonarI2CXL maxsonari2cxl_2;
66
+ #endif
67
+ #if AP_SIM_BATTMONITORSMBUSMAXELL_ENABLED
64
68
static Maxell maxell;
69
+ #endif
70
+ #if AP_SIM_BATTMONITORSMBUSROTOYE_ENABLED
65
71
static Rotoye rotoye;
72
+ #endif
66
73
static SIM_BattMonitor_SMBus_Generic smbus_generic;
74
+ #if AP_SIM_AIRSPEEDDLVR_ENABLED
67
75
static Airspeed_DLVR airspeed_dlvr;
76
+ #endif
77
+ #if AP_SIM_TEMPERATURETSYS01_ENABLED
68
78
static TSYS01 tsys01;
79
+ #endif
69
80
#if AP_SIM_TSYS03_ENABLED
70
81
static TSYS03 tsys03;
71
82
#endif
83
+ #if AP_SIM_TEMPERATUREMCP9600_ENABLED
72
84
static MCP9600 mcp9600;
85
+ #endif
86
+ #if AP_SIM_ICM40609_ENABLED
73
87
static ICM40609 icm40609;
88
+ #endif
89
+ #if AP_SIM_MS5525_ENABLED
74
90
static MS5525 ms5525;
91
+ #endif
92
+ #if AP_SIM_MS5611_ENABLED
75
93
static MS5611 ms5611;
94
+ #endif
76
95
#if AP_SIM_LP5562_ENABLED
77
96
static LP5562 lp5562;
78
97
#endif
@@ -95,25 +114,43 @@ struct i2c_device_at_address {
95
114
uint8_t addr;
96
115
I2CDevice &device;
97
116
} i2c_devices[] {
117
+ #if AP_SIM_MAXSONARI2CXL_ENABLED
98
118
{ 0 , 0x70 , maxsonari2cxl }, // RNGFNDx_TYPE = 2, RNGFNDx_ADDR = 112
119
+ #endif
120
+ #if AP_SIM_TEMPERATUREMCP9600_ENABLED
99
121
{ 0 , 0x60 , mcp9600 }, // 0x60 is low address
122
+ #endif
123
+ #if AP_SIM_MAXSONARI2CXL_ENABLED
100
124
{ 0 , 0x71 , maxsonari2cxl_2 }, // RNGFNDx_TYPE = 2, RNGFNDx_ADDR = 113
125
+ #endif
126
+ #if AP_SIM_ICM40609_ENABLED
101
127
{ 1 , 0x01 , icm40609 },
128
+ #endif
102
129
#if AP_SIM_TOSHIBALED_ENABLED
103
130
{ 1 , 0x55 , toshibaled },
104
131
#endif
105
132
{ 1 , 0x38 , ignored }, // NCP5623
106
133
{ 1 , 0x39 , ignored }, // NCP5623C
107
134
{ 1 , 0x40 , ignored }, // KellerLD
135
+ #if AP_SIM_MS5525_ENABLED
108
136
{ 1 , 0x76 , ms5525 }, // MS5525: ARSPD_TYPE = 4
137
+ #endif
109
138
#if AP_SIM_INA3221_ENABLED
110
139
{ 1 , 0x42 , ina3221 },
111
140
#endif
141
+ #if AP_SIM_TEMPERATURETSYS01_ENABLED
112
142
{ 1 , 0x77 , tsys01 },
143
+ #endif
144
+ #if AP_SIM_BATTMONITORSMBUSROTOYE_ENABLED
113
145
{ 1 , 0x0B , rotoye }, // Rotoye: BATTx_MONITOR 19, BATTx_I2C_ADDR 13
146
+ #endif
147
+ #if AP_SIM_BATTMONITORSMBUSMAXELL_ENABLED
114
148
{ 2 , 0x0B , maxell }, // Maxell: BATTx_MONITOR 16, BATTx_I2C_ADDR 13
149
+ #endif
115
150
{ 3 , 0x0B , smbus_generic}, // BATTx_MONITOR 7, BATTx_I2C_ADDR 13
151
+ #if AP_SIM_AIRSPEEDDLVR_ENABLED
116
152
{ 2 , 0x28 , airspeed_dlvr }, // ARSPD_TYPE = 7 5inch H2O sensor
153
+ #endif
117
154
#if AP_SIM_LP5562_ENABLED
118
155
{ 2 , 0x30 , lp5562 }, // LP5562 RGB LED driver
119
156
#endif
@@ -126,7 +163,9 @@ struct i2c_device_at_address {
126
163
#if AP_SIM_TSYS03_ENABLED
127
164
{ 2 , 0x40 , tsys03 },
128
165
#endif
166
+ #if AP_SIM_MS5611_ENABLED
129
167
{ 2 , 0x77 , ms5611 }, // MS5611: BARO_PROBE_EXT = 2
168
+ #endif
130
169
#if AP_SIM_COMPASS_QMC5883L_ENABLED
131
170
{ 2 , 0x0D , qmc5883l },
132
171
#endif
0 commit comments