CSE7766 Power Sensor

See Application::make_cse7766().

API Reference

class CSE7766Component : public Component, public UARTDevice

Public Functions

CSE7766Component(UARTComponent *parent)
CSE7766VoltageSensor *make_voltage_sensor(const std::string &name)
CSE7766CurrentSensor *make_current_sensor(const std::string &name)
CSE7766PowerSensor *make_power_sensor(const std::string &name)
void loop()

This method will be called repeatedly.

Analogous to Arduino’s loop(). setup() is guaranteed to be called before this. Defaults to doing nothing.

float get_setup_priority() const

priority of setup().

higher -> executed earlier

Defaults to 0.

Return
The setup priority of this component

Protected Functions

bool check_byte_()
void parse_data_()
uint32_t get_24_bit_uint(uint8_t start_index)

Protected Attributes

uint8_t raw_data_[24]
uint8_t raw_data_index_ = {0}
uint32_t last_transmission_ = {0}
CSE7766VoltageSensor *voltage_ = {nullptr}
CSE7766CurrentSensor *current_ = {nullptr}
CSE7766PowerSensor *power_ = {nullptr}
using sensor::CSE7766VoltageSensor = typedef EmptySensor<1, ICON_FLASH, UNIT_V>
using sensor::CSE7766CurrentSensor = typedef EmptySensor<1, ICON_FLASH, UNIT_A>
using sensor::CSE7766PowerSensor = typedef EmptySensor<1, ICON_FLASH, UNIT_W>