ESPHome
2024.12.2
esphome
esphome
components
ads1115
ads1115.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/components/i2c/i2c.h
"
4
#include "
esphome/core/component.h
"
5
6
#include <vector>
7
8
namespace
esphome
{
9
namespace
ads1115 {
10
11
enum
ADS1115Multiplexer
{
12
ADS1115_MULTIPLEXER_P0_N1
= 0b000,
13
ADS1115_MULTIPLEXER_P0_N3
= 0b001,
14
ADS1115_MULTIPLEXER_P1_N3
= 0b010,
15
ADS1115_MULTIPLEXER_P2_N3
= 0b011,
16
ADS1115_MULTIPLEXER_P0_NG
= 0b100,
17
ADS1115_MULTIPLEXER_P1_NG
= 0b101,
18
ADS1115_MULTIPLEXER_P2_NG
= 0b110,
19
ADS1115_MULTIPLEXER_P3_NG
= 0b111,
20
};
21
22
enum
ADS1115Gain
{
23
ADS1115_GAIN_6P144
= 0b000,
24
ADS1115_GAIN_4P096
= 0b001,
25
ADS1115_GAIN_2P048
= 0b010,
26
ADS1115_GAIN_1P024
= 0b011,
27
ADS1115_GAIN_0P512
= 0b100,
28
ADS1115_GAIN_0P256
= 0b101,
29
};
30
31
enum
ADS1115Resolution
{
32
ADS1115_16_BITS
= 16,
33
ADS1015_12_BITS
= 12,
34
};
35
36
class
ADS1115Component
:
public
Component
,
public
i2c::I2CDevice
{
37
public
:
38
void
setup
()
override
;
39
void
dump_config
()
override
;
41
float
get_setup_priority
()
const override
{
return
setup_priority::DATA
; }
42
void
set_continuous_mode
(
bool
continuous_mode) {
continuous_mode_
= continuous_mode; }
43
45
float
request_measurement
(
ADS1115Multiplexer
multiplexer,
ADS1115Gain
gain
,
ADS1115Resolution
resolution);
46
47
protected
:
48
uint16_t
prev_config_
{0};
49
bool
continuous_mode_
;
50
};
51
52
}
// namespace ads1115
53
}
// namespace esphome
esphome::ads1115::ADS1115_GAIN_0P256
Definition:
ads1115.h:28
esphome::ads1115::ADS1115_GAIN_4P096
Definition:
ads1115.h:24
esphome::ads1115::ADS1115_MULTIPLEXER_P1_N3
Definition:
ads1115.h:14
esphome::setup_priority::DATA
const float DATA
For components that import data from directly connected sensors like DHT.
Definition:
component.cpp:19
esphome::ads1115::ADS1115_MULTIPLEXER_P2_N3
Definition:
ads1115.h:15
esphome::ads1115::ADS1115Component::request_measurement
float request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain, ADS1115Resolution resolution)
Helper method to request a measurement from a sensor.
Definition:
ads1115.cpp:79
esphome::ads1115::ADS1115_MULTIPLEXER_P2_NG
Definition:
ads1115.h:18
esphome::ads1115::ADS1115_MULTIPLEXER_P0_NG
Definition:
ads1115.h:16
esphome::Component
Definition:
component.h:68
esphome::ads1115::ADS1115Component
Definition:
ads1115.h:36
gain
AlsGain501 gain
Definition:
ltr_definitions_501.h:128
esphome::ads1115::ADS1115_MULTIPLEXER_P0_N3
Definition:
ads1115.h:13
esphome::ads1115::ADS1115Component::dump_config
void dump_config() override
Definition:
ads1115.cpp:72
esphome::ads1115::ADS1115_MULTIPLEXER_P3_NG
Definition:
ads1115.h:19
esphome::ads1115::ADS1115_MULTIPLEXER_P0_N1
Definition:
ads1115.h:12
esphome::ads1115::ADS1115Multiplexer
ADS1115Multiplexer
Definition:
ads1115.h:11
esphome::ads1115::ADS1115Component::set_continuous_mode
void set_continuous_mode(bool continuous_mode)
Definition:
ads1115.h:42
esphome::ads1115::ADS1115_GAIN_1P024
Definition:
ads1115.h:26
esphome::ads1115::ADS1115_16_BITS
Definition:
ads1115.h:32
esphome::ads1115::ADS1115Component::prev_config_
uint16_t prev_config_
Definition:
ads1115.h:48
esphome::ads1115::ADS1115Resolution
ADS1115Resolution
Definition:
ads1115.h:31
esphome::ads1115::ADS1115_GAIN_0P512
Definition:
ads1115.h:27
esphome::ads1115::ADS1115_GAIN_2P048
Definition:
ads1115.h:25
esphome::ads1115::ADS1115Component::setup
void setup() override
Definition:
ads1115.cpp:14
esphome::ads1115::ADS1115Component::get_setup_priority
float get_setup_priority() const override
HARDWARE_LATE setup priority.
Definition:
ads1115.h:41
esphome::ads1115::ADS1115_GAIN_6P144
Definition:
ads1115.h:23
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
component.h
esphome::ads1115::ADS1015_12_BITS
Definition:
ads1115.h:33
esphome::ads1115::ADS1115_MULTIPLEXER_P1_NG
Definition:
ads1115.h:17
esphome::ads1115::ADS1115Component::continuous_mode_
bool continuous_mode_
Definition:
ads1115.h:49
esphome::i2c::I2CDevice
This Class provides the methods to read/write bytes from/to an i2c device.
Definition:
i2c.h:133
esphome::ads1115::ADS1115Gain
ADS1115Gain
Definition:
ads1115.h:22
i2c.h
Generated by
1.8.13