62 static const float BL0942_PREF = 596;
63 static const float BL0942_UREF = 15873.35944299;
64 static const float BL0942_IREF = 251213.46469622;
65 static const float BL0942_EREF = 3304.61127328;
98 this->current_reference_ = current_ref;
99 this->current_reference_set_ =
true;
102 this->energy_reference_ = energy_ref;
103 this->energy_reference_set_ =
true;
106 this->power_reference_ = power_ref;
107 this->power_reference_set_ =
true;
110 this->voltage_reference_ = voltage_ref;
111 this->voltage_reference_set_ =
true;
114 void loop()
override;
115 void update()
override;
116 void setup()
override;
117 void dump_config()
override;
129 float power_reference_ = BL0942_PREF;
130 bool power_reference_set_ =
false;
132 float voltage_reference_ = BL0942_UREF;
133 bool voltage_reference_set_ =
false;
135 float current_reference_ = BL0942_IREF;
136 bool current_reference_set_ =
false;
138 float energy_reference_ = BL0942_EREF;
139 bool energy_reference_set_ =
false;
140 uint8_t address_ = 0;
143 uint32_t rx_start_ = 0;
144 uint32_t prev_cf_cnt_ = 0;
147 int read_reg_(uint8_t reg);
148 void write_reg_(uint8_t reg, uint32_t
val);
internal::LittleEndianLayout< uint16_t > uint16_le_t
void set_voltage_reference(float voltage_ref)
enum esphome::bl0942::LineFrequency __attribute__
This class simplifies creating components that periodically check a state.
void set_address(uint8_t address)
void set_power_reference(float power_ref)
void set_current_sensor(sensor::Sensor *current_sensor)
void set_frequency_sensor(sensor::Sensor *frequency_sensor)
void set_line_freq(LineFrequency freq)
internal::LittleEndianLayout< uint24_t > uint24_le_t
void set_energy_sensor(sensor::Sensor *energy_sensor)
void set_power_sensor(sensor::Sensor *power_sensor)
Implementation of SPI Controller mode.
internal::LittleEndianLayout< int24_t > int24_le_t
void set_reset(bool reset)
Base-class for all sensors.
void set_current_reference(float current_ref)
void set_voltage_sensor(sensor::Sensor *voltage_sensor)
void set_energy_reference(float energy_ref)