SparkFun Qwiic Current Sensor - ADE7953  v1.0.0-3-g9a02684
Arduino Library for the SparkFun Qwiic Current Sensor (ADE7953)
Loading...
Searching...
No Matches
SparkFun_ADE7953.h
Go to the documentation of this file.
1
20#pragma once
21
22// clang-format off
23#include <SparkFun_Toolkit.h>
24#include "sfTk/sfDevADE7953.h"
25#include <Arduino.h>
26// clang-format on
27
42{
43 public:
45 {
46 }
47
62 bool begin(uint8_t address = kI2CAddress, TwoWire &wirePort = Wire)
63 {
64 // Initialize the Toolkit I2C bus with the given Wire port and address.
65 if (_theI2CBus.init(wirePort, address) != ksfTkErrOk)
66 return false;
67
68 // Confirm a device is actually responding at this address before we configure anything.
69 if (_theI2CBus.ping() != ksfTkErrOk)
70 return false;
71
72 // The base class begin() verifies the device identity, sets byte order, writes the
73 // optimized performance register, and applies default configuration.
74 return sfDevADE7953::begin(&_theI2CBus) == ksfTkErrOk;
75 }
76
77 private:
79 sfTkArdI2C _theI2CBus;
80};
Arduino I2C implementation for the ADE7953 energy meter.
Definition: SparkFun_ADE7953.h:42
bool begin(uint8_t address=kI2CAddress, TwoWire &wirePort=Wire)
Initializes the ADE7953 with I2C communication.
Definition: SparkFun_ADE7953.h:62
SfeADE7953ArdI2C()
Definition: SparkFun_ADE7953.h:44
Platform-independent driver for the ADE7953 energy metering IC.
Definition: sfDevADE7953.h:179
sfTkError_t begin(sfTkIBus *theBus=nullptr)
Initialize the device driver with the given bus.
Definition: sfDevADE7953.cpp:26
static const uint8_t kI2CAddress
7-bit I2C address for the ADE7953 (only address).
Definition: sfDevADE7953.h:692
Header file for the SparkFun ADE7953 Energy Meter Driver.