ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
hmc5883l.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::hmc5883l {
8
15
25
36
38 SUB_SENSOR(x)
39 SUB_SENSOR(y)
40 SUB_SENSOR(z)
41 SUB_SENSOR(heading)
42
43 public:
44 void setup() override;
45 void dump_config() override;
46 void update() override;
47
48 void set_oversampling(HMC5883LOversampling oversampling) { oversampling_ = oversampling; }
49 void set_datarate(HMC5883LDatarate datarate) { datarate_ = datarate; }
50 void set_range(HMC5883LRange range) { range_ = range; }
51
52 protected:
57};
58
59} // namespace esphome::hmc5883l
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:84
Helper class to request loop() to be called as fast as possible.
Definition helpers.h:2329
This class simplifies creating components that periodically check a state.
Definition component.h:532
HighFrequencyLoopRequester high_freq_
Definition hmc5883l.h:56
HMC5883LOversampling oversampling_
Definition hmc5883l.h:53
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
bool z
Definition msa3xx.h:1
Range range
Definition msa3xx.h:0
@ HMC5883L_DATARATE_15_0_HZ
Definition hmc5883l.h:21
@ HMC5883L_DATARATE_0_75_HZ
Definition hmc5883l.h:17
@ HMC5883L_DATARATE_30_0_HZ
Definition hmc5883l.h:22
@ HMC5883L_DATARATE_75_0_HZ
Definition hmc5883l.h:23
uint16_t x
Definition tt21100.cpp:5
uint16_t y
Definition tt21100.cpp:6