24 #define USE_PCNT false 32 void setup()
override;
void set_power_sensor(sensor::Sensor *power_sensor)
void set_initial_mode(HLW8012InitialMode initial_mode)
void set_current_sensor(sensor::Sensor *current_sensor)
void set_voltage_divider(float voltage_divider)
PulseCounterStorageBase * get_storage(bool hw_pcnt)
uint32_t change_mode_every_
void set_sel_pin(GPIOPin *sel_pin)
This class simplifies creating components that periodically check a state.
sensor::Sensor * energy_sensor_
sensor::Sensor * power_sensor_
float current_multiplier_
InternalGPIOPin * cf_pin_
void set_energy_sensor(sensor::Sensor *energy_sensor)
void set_cf_pin(InternalGPIOPin *cf_pin)
pulse_counter::PulseCounterStorageBase & cf_store_
HLW8012SensorModels sensor_model_
void set_current_resistor(float current_resistor)
void set_change_mode_every(uint32_t change_mode_every)
sensor::Sensor * voltage_sensor_
float get_setup_priority() const override
float voltage_multiplier_
Implementation of SPI Controller mode.
sensor::Sensor * current_sensor_
pulse_counter::PulseCounterStorageBase & cf1_store_
Base-class for all sensors.
InternalGPIOPin * cf1_pin_
void dump_config() override
uint64_t cf_total_pulses_
void set_voltage_sensor(sensor::Sensor *voltage_sensor)
void set_cf1_pin(InternalGPIOPin *cf1_pin)
void set_sensor_model(HLW8012SensorModels sensor_model)