public class STPM32_W6 extends STPM3x
Modifier and Type | Field and Description |
---|---|
static double |
ENERGY_LSB |
static int |
TB_PIN_SEL_DISABLE |
static int |
TB_PIN_SEL_ENABLE |
debug, DFE_CR1_0, DFE_CR1_1, DFE_CR2_0, DFE_CR2_1, DSP_CR10, DSP_CR11, DSP_CR12, DSP_CR3_0, DSP_CR3_1, DSP_CR4, DSP_CR5, DSP_CR6, DSP_CR7, DSP_CR8, DSP_CR9, DSP_REG1, DSP_REG14, DSP_REG15, DSP_REG16, DSP_REG17, DSP_REG18, DSP_REG19, DSP_SR1, DSP_SR2, DUMMY, firstReadEnergy, FRAME_LENGTH_WITH_CRC, MD_CURRENT, MD_VOLTAGE, NULL, OFFSET_POWER, overflowCounter, PH1_REG1, PH1_REG5, PH2_REG1, PH2_REG5, POWER_REGISTER, RET_KO, RET_OK, spi, SPI_DEFAULT_FREQUENCY, SPI_DEFAULT_MODE, SPI_DEFAULT_TIMEOUT, SPI_DEFAULT_USE_CS, totalEnergy
Constructor and Description |
---|
STPM32_W6(Spi spi,
byte cspin,
byte synpin)
Creates a new STPM32 instance with default Spi settings
|
Modifier and Type | Method and Description |
---|---|
float |
calcCurrent(int value)
Returns current in A.
|
double |
calcEnergy(double value)
Returns Energy in Ws.
|
float |
calcPower(int value)
Returns power in W.
|
float |
calcVoltage(int value)
Returns voltage in V.
|
void |
resetSequence()
Default reset sequence of the STPM3x sensor.
|
void |
resetW6() |
void |
setChipSelectState(boolean enabled) |
void |
setEnableState(boolean enabled) |
void |
setSynchroState(boolean enabled) |
calculateAndPutCRC, calibration, debugLog, extendSign, getCurrent, getEnergy, getPeriod, getPhase, getPower, getVoltage, initSequence, readRegister, reset, sendFrame, setCalibration, startPowerAcquisition, writeRegister16, writeRegister32
public static final int TB_PIN_SEL_ENABLE
public static final int TB_PIN_SEL_DISABLE
public static final double ENERGY_LSB
public STPM32_W6(Spi spi, byte cspin, byte synpin)
spi
- public void resetSequence()
STPM3x
resetSequence
in class STPM3x
public void resetW6()
public void setEnableState(boolean enabled)
setEnableState
in class STPM3x
public void setChipSelectState(boolean enabled)
setChipSelectState
in class STPM3x
public void setSynchroState(boolean enabled)
setSynchroState
in class STPM3x
public float calcPower(int value)
STPM3x
public double calcEnergy(double value)
STPM3x
calcEnergy
in class STPM3x
value
- raw data from the STPM3xcalcPower
public float calcCurrent(int value)
STPM3x
calcCurrent
in class STPM3x
value
- raw data from the STPM3xpublic float calcVoltage(int value)
STPM3x
calcVoltage
in class STPM3x
value
- raw data from the STPM3x