10 namespace ade7953_base {
12 static const uint8_t PGA_V_8 =
14 static const uint8_t PGA_IA_8 =
16 static const uint8_t PGA_IB_8 =
19 static const uint32_t AIGAIN_32 =
21 static const uint32_t AVGAIN_32 = 0x381;
22 static const uint32_t AWGAIN_32 =
24 static const uint32_t AVARGAIN_32 =
26 static const uint32_t AVAGAIN_32 =
29 static const uint32_t BIGAIN_32 =
31 static const uint32_t BVGAIN_32 = 0x38D;
32 static const uint32_t BWGAIN_32 =
34 static const uint32_t BVARGAIN_32 =
36 static const uint32_t BVAGAIN_32 =
79 void setup()
override;
111 virtual bool ade_write_8(uint16_t reg, uint8_t value) = 0;
113 virtual bool ade_write_16(uint16_t reg, uint16_t value) = 0;
115 virtual bool ade_write_32(uint16_t reg, uint32_t value) = 0;
117 virtual bool ade_read_8(uint16_t reg, uint8_t *value) = 0;
119 virtual bool ade_read_16(uint16_t reg, uint16_t *value) = 0;
121 virtual bool ade_read_32(uint16_t reg, uint32_t *value) = 0;
sensor::Sensor * apparent_power_b_sensor_
sensor::Sensor * frequency_sensor_
void set_frequency_sensor(sensor::Sensor *frequency_sensor)
void set_pga_ia(uint8_t pga_ia)
void set_irq_pin(InternalGPIOPin *irq_pin)
sensor::Sensor * voltage_sensor_
virtual bool ade_read_32(uint16_t reg, uint32_t *value)=0
void set_bwgain(uint32_t bwgain)
void set_reactive_power_b_sensor(sensor::Sensor *reactive_power_b)
void set_use_acc_energy_regs(bool use_acc_energy_regs)
void set_bigain(uint32_t bigain)
sensor::Sensor * reactive_power_a_sensor_
bool use_acc_energy_regs_
sensor::Sensor * power_factor_b_sensor_
void set_awgain(uint32_t awgain)
void set_active_power_a_sensor(sensor::Sensor *active_power_a_sensor)
This class simplifies creating components that periodically check a state.
void set_pga_ib(uint8_t pga_ib)
virtual bool ade_write_32(uint16_t reg, uint32_t value)=0
void set_aigain(uint32_t aigain)
void set_current_a_sensor(sensor::Sensor *current_a_sensor)
void set_power_factor_a_sensor(sensor::Sensor *power_factor_a)
void set_reactive_power_a_sensor(sensor::Sensor *reactive_power_a)
void set_active_power_b_sensor(sensor::Sensor *active_power_b_sensor)
void set_power_factor_b_sensor(sensor::Sensor *power_factor_b)
void dump_config() override
void set_voltage_sensor(sensor::Sensor *voltage_sensor)
sensor::Sensor * active_power_b_sensor_
virtual bool ade_read_8(uint16_t reg, uint8_t *value)=0
sensor::Sensor * power_factor_a_sensor_
void set_current_b_sensor(sensor::Sensor *current_b_sensor)
InternalGPIOPin * irq_pin_
virtual bool ade_write_16(uint16_t reg, uint16_t value)=0
sensor::Sensor * reactive_power_b_sensor_
void set_apparent_power_b_sensor(sensor::Sensor *apparent_power_b)
sensor::Sensor * current_b_sensor_
sensor::Sensor * active_power_a_sensor_
void set_pga_v(uint8_t pga_v)
Implementation of SPI Controller mode.
virtual bool ade_read_16(uint16_t reg, uint16_t *value)=0
Base-class for all sensors.
sensor::Sensor * apparent_power_a_sensor_
void set_vgain(uint32_t vgain)
void set_apparent_power_a_sensor(sensor::Sensor *apparent_power_a)
sensor::Sensor * current_a_sensor_
virtual bool ade_write_8(uint16_t reg, uint8_t value)=0