File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed
Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change 3333
3434#define ADS1115_CONF_TEST_VALUE (1)
3535
36+ static inline int _ads1115_get_pga_voltage (ads1115_pga_t pga )
37+ {
38+ switch (pga ) {
39+ case ADS1115_PGA_6_144V : return 6144 ;
40+ case ADS1115_PGA_4_096V : return 4096 ;
41+ case ADS1115_PGA_2_048V : return 2048 ;
42+ case ADS1115_PGA_1_024V : return 1024 ;
43+ case ADS1115_PGA_0_512V : return 512 ;
44+ case ADS1115_PGA_0_256V :
45+ case ADS1115_PGA_0_256V_B :
46+ case ADS1115_PGA_0_256V_C :
47+ return 256 ;
48+ default :
49+ return 0 ;
50+ }
51+ }
3652
3753/**
3854 * @brief Builds the configuration register value from the parameters
Original file line number Diff line number Diff line change @@ -198,22 +198,6 @@ int ads1115_set_ain_ch_input(ads1115_t *dev, ads1115_mux_t mux);
198198 */
199199int ads1115_read_conversion (ads1115_t * dev , uint16_t * value );
200200
201- static inline int _ads1115_get_pga_voltage (ads1115_pga_t pga )
202- {
203- switch (pga ) {
204- case ADS1115_PGA_6_144V : return 6144 ;
205- case ADS1115_PGA_4_096V : return 4096 ;
206- case ADS1115_PGA_2_048V : return 2048 ;
207- case ADS1115_PGA_1_024V : return 1024 ;
208- case ADS1115_PGA_0_512V : return 512 ;
209- case ADS1115_PGA_0_256V :
210- case ADS1115_PGA_0_256V_B :
211- case ADS1115_PGA_0_256V_C :
212- return 256 ;
213- default :
214- return 0 ;
215- }
216- }
217201
218202/**
219203 * @brief Converts the digital value from the ADS1115 device to millivolts.
You can’t perform that action at this time.
0 commit comments