|
MycilaJSY 13.0.0
Arduino / ESP32 library for the JSY1031, JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333 families single-phase and three-phase AC bidirectional meters from Shenzhen Jiansiyan Technologies Co, Ltd.
|
DFRobot DFR1071/DFR1073/DFR0971 I2C controlled 0-10V/0-5V dimmer implementation for voltage regulators controlled by a 0-10V/0-5V analog signal. More...
#include <MycilaDimmerDFRobot.h>


Public Types | |
| enum class | SKU { UNKNOWN , DFR1071_GP8211S , DFR1073_GP8413 , DFR0971_GP8403 } |
| enum class | Output { RANGE_0_5V , RANGE_0_10V } |
Public Member Functions | |
| void | setWire (TwoWire &wire) |
| TwoWire & | getWire () const |
| void | setSKU (SKU sku) |
| SKU | getSKU () const |
| void | setOutput (Output output) |
| Set output mode of the device: 0-5V or 0-10V. | |
| Output | getOutput () const |
| void | setDeviceAddress (uint8_t deviceAddress) |
| I2C address of the device. | |
| uint8_t | getDeviceAddress () const |
| void | setChannel (uint8_t channel) |
| Set channel number. | |
| uint8_t | getChannel () const |
| uint8_t | getResolution () const |
| Get the PWM resolution in bits. | |
| void | begin () override |
| Enable a dimmer on a specific GPIO pin. | |
| void | end () override |
| Disable the dimmer. | |
| const char * | type () const override |
| bool | calculateMetrics (Metrics &metrics, float gridVoltage, float loadResistance) const override |
| Public Member Functions inherited from Mycila::Dimmer | |
| void | setDutyCycleLimit (float limit) |
| Set the power duty cycle limit of the dimmer. The duty cycle will be clamped to this limit. | |
| void | setDutyCycleMin (float min) |
| Duty remapping (equivalent to Shelly Dimmer remapping feature). Useful to calibrate the dimmer when using for example a PWM signal to 0-10V analog convertor connected to a voltage regulator which is only working in a specific voltage range like 1-8V. | |
| void | setDutyCycleMax (float max) |
| Duty remapping (equivalent to Shelly Dimmer remapping feature). Useful to calibrate the dimmer when using for example a PWM signal to 0-10V analog convertor connected to a voltage regulator which is only working in a specific voltage range like 1-8V. | |
| float | getDutyCycleLimit () const |
| Get the power duty cycle limit of the dimmer. | |
| float | getDutyCycleMin () const |
| Get the remapped "0" of the dimmer duty cycle. | |
| float | getDutyCycleMax () const |
| Get the remapped "1" of the dimmer duty cycle. | |
| void | enablePowerLUT (bool enable, uint16_t semiPeriod=0) |
| Enable or disable the use of power LUT for dimmer curve The power LUT provides a non-linear dimming curve that is more aligned with human perception of brightness. If disabled, a linear dimming curve will be used. | |
| bool | isPowerLUTEnabled () const |
| Check if the power LUT is enabled. | |
| uint16_t | getPowerLUTSemiPeriod () const |
| Get the semi-period in us used for the power LUT calculations. If LUT is disabled, returns 0. | |
| bool | isEnabled () const |
| Check if the dimmer is enabled (if it was able to initialize correctly). | |
| bool | isOnline () const |
| Returns true if the dimmer is marked online. | |
| void | setOnline (bool online) |
| Set the online status of the dimmer. | |
| void | on () |
| Turn on the dimmer at full power. | |
| void | off () |
| Turn off the dimmer. | |
| bool | isOff () const |
| Check if the dimmer is off. | |
| bool | isOn () const |
| Check if the dimmer is on. | |
| bool | isOnAtFullPower () const |
| Check if the dimmer is on at full power. | |
| bool | setDutyCycle (float dutyCycle) |
| Set the power duty. | |
| float | getDutyCycle () const |
| Get the power duty cycle configured for the dimmer by teh user. | |
| float | getDutyCycleMapped () const |
| Get the remapped power duty cycle from the currently user set duty cycle. | |
| float | getDutyCycleFire () const |
| Get the real firing duty cycle (conduction duty cycle) applied to the dimmer in the range [0, 1]. | |
| bool | calculateHarmonics (float *array, size_t n) const |
Protected Member Functions | |
| bool | _apply () override |
| bool | _calculateHarmonics (float *array, size_t n) const override |
Additional Inherited Members | |
| Static Protected Member Functions inherited from Mycila::Dimmer | |
| static uint16_t | _lookupFiringDelay (float dutyCycle, uint16_t semiPeriod) |
| static float | _contrain (float amt, float low, float high) |
| static bool | _calculatePhaseControlHarmonics (float dutyCycleFire, float *array, size_t n) |
| static bool | _calculatePhaseControlMetrics (Metrics &metrics, float dutyCycleFire, float gridVoltage, float loadResistance) |
| Protected Attributes inherited from Mycila::Dimmer | |
| bool | _enabled = false |
| bool | _online = false |
| float | _dutyCycle = 0.0f |
| float | _dutyCycleFire = 0.0f |
| float | _dutyCycleLimit = 1.0f |
| float | _dutyCycleMin = 0.0f |
| float | _dutyCycleMax = 1.0f |
| bool | _powerLUTEnabled = false |
| uint16_t | _semiPeriod = 0 |
DFRobot DFR1071/DFR1073/DFR0971 I2C controlled 0-10V/0-5V dimmer implementation for voltage regulators controlled by a 0-10V/0-5V analog signal.
Definition at line 15 of file MycilaDimmerDFRobot.h.
|
strong |
Definition at line 27 of file MycilaDimmerDFRobot.h.
|
strong |
Definition at line 17 of file MycilaDimmerDFRobot.h.
|
inlinevirtual |
Definition at line 32 of file MycilaDimmerDFRobot.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Mycila::Dimmer.
Definition at line 120 of file MycilaDimmerDFRobot.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Mycila::Dimmer.
Definition at line 128 of file MycilaDimmerDFRobot.h.
|
overridevirtual |
Enable a dimmer on a specific GPIO pin.
Reimplemented from Mycila::Dimmer.
Definition at line 12 of file MycilaDimmerDFRobot.cpp.
|
inlineoverridevirtual |
Reimplemented from Mycila::Dimmer.
Definition at line 97 of file MycilaDimmerDFRobot.h.
|
overridevirtual |
Disable the dimmer.
Reimplemented from Mycila::Dimmer.
Definition at line 83 of file MycilaDimmerDFRobot.cpp.
|
inline |
Definition at line 62 of file MycilaDimmerDFRobot.h.
|
inline |
Definition at line 52 of file MycilaDimmerDFRobot.h.
|
inline |
Definition at line 45 of file MycilaDimmerDFRobot.h.
|
inline |
Get the PWM resolution in bits.
Definition at line 67 of file MycilaDimmerDFRobot.h.
|
inline |
Definition at line 38 of file MycilaDimmerDFRobot.h.
|
inline |
Definition at line 35 of file MycilaDimmerDFRobot.h.
|
inline |
Set channel number.
| channel | output channel 0: Channel 0 (valid when PWM0 output is configured) 1: Channel 1 (valid when PWM1 output is configured) 2: All channels (valid when configuring dual channel output) |
Definition at line 61 of file MycilaDimmerDFRobot.h.
|
inline |
I2C address of the device.
| deviceAddress | I2C address |
Definition at line 51 of file MycilaDimmerDFRobot.h.
|
inline |
Set output mode of the device: 0-5V or 0-10V.
| output | output mode |
Definition at line 44 of file MycilaDimmerDFRobot.h.
|
inline |
Definition at line 37 of file MycilaDimmerDFRobot.h.
|
inline |
Definition at line 34 of file MycilaDimmerDFRobot.h.
|
inlineoverridevirtual |
Reimplemented from Mycila::Dimmer.
Definition at line 95 of file MycilaDimmerDFRobot.h.