65#if defined(__DOXYGEN__)
79inline void processStartUp(uint8_t phase) __attribute__((always_inline));
83inline
void processVoltage(uint8_t phase) __attribute__((always_inline));
84inline
void processPolarity(uint8_t phase, int16_t rawSample) __attribute__((always_inline));
85inline
void confirmPolarity(uint8_t phase) __attribute__((always_inline));
container for datalogging
constexpr auto get_size() const
Get the number of sensors.
Configuration values to be set by the end-user.
constexpr TemperatureSensing temperatureSensing
constexpr uint8_t NO_OF_DUMPLOADS
constexpr uint8_t NO_OF_PHASES
void updatePhysicalLoadStates()
This function provides the link between the logical and physical loads.
void processLatestContribution(uint8_t phase)
Process the latest contribution after each phase specific new cycle additional processing is performe...
void processStartUp(uint8_t phase)
Process the startup period for the router.
void processStartNewCycle()
This code is executed once per 20mS, shortly after the start of each new mains cycle on phase 0.
void processMinusHalfCycle(uint8_t phase)
Process the start of a new -ve half cycle, for this phase, just after the zero-crossing point.
void processVoltageRawSample(uint8_t phase, int16_t rawSample)
Process the current voltage raw sample for the specific phase.
void proceedLowEnergyLevel()
Process the case of low energy level, some action may be required.
void processPolarity(uint8_t phase, int16_t rawSample)
Process with the polarity for the actual voltage sample for the specific phase.
void processRawSamples(uint8_t phase)
This routine is called by the ISR when a pair of V & I sample becomes available.
uint8_t nextLogicalLoadToBeAdded()
Retrieve the next load that could be added (be aware of the order)
void processPlusHalfCycle(uint8_t phase)
Process the start of a new +ve half cycle, for this phase, just after the zero-crossing point.
void processDataLogging()
Process with data logging.
uint8_t nextLogicalLoadToBeRemoved()
Retrieve the next load that could be removed (be aware of the reverse-order)
void confirmPolarity(uint8_t phase)
This routine prevents a zero-crossing point from being declared until a certain number of consecutive...
void processVoltage(uint8_t phase)
Process the calculation for the current voltage sample for the specific phase.
void proceedHighEnergyLevel()
Process the case of high energy level, some action may be required.
void processCurrentRawSample(uint8_t phase, int16_t rawSample)
Process the calculation for the actual current raw sample for the specific phase.
volatile uint8_t copyOf_lowestNoOfSampleSetsPerMainsCycle
constexpr uint16_t startUpPeriod
constexpr uint8_t PERSISTENCE_FOR_POLARITY_CHANGE
void updatePortsStates()
update the control ports for each of the physical loads
uint8_t loadPrioritiesAndState[NO_OF_DUMPLOADS]
volatile bool b_reOrderLoads
void initializeOptionalPins()
Initializes the optional pins.
constexpr uint8_t sensorV[NO_OF_PHASES]
constexpr uint8_t sensorI[NO_OF_PHASES]
volatile float copyOf_energyInBucket_main
volatile int32_t copyOf_sumP_atSupplyPoint[NO_OF_PHASES]
volatile int32_t copyOf_sum_Vsquared[NO_OF_PHASES]
volatile uint16_t copyOf_sampleSetsDuringThisDatalogPeriod
volatile bool b_overrideLoadOn[NO_OF_DUMPLOADS]
void printParamsForSelectedOutputMode()
Print the settings used for the selected output mode.
volatile bool b_newMainsCycle
volatile bool b_datalogEventPending
volatile uint32_t absenceOfDivertedEnergyCount
volatile bool b_diversionOff
constexpr uint16_t initialDelay
PayloadTx_struct< NO_OF_PHASES > tx_data
void initializeProcessing()
Initializes the ports and load states for processing.
volatile uint16_t copyOf_countLoadON[NO_OF_DUMPLOADS]