1-phase PV router
Loading...
Searching...
No Matches
processing.h
Go to the documentation of this file.
1
11
12#ifndef PROCESSING_H
13#define PROCESSING_H
14
15#include "shared_var.h"
16
23
24#if defined(__DOXYGEN__)
25inline void processStartUp();
26inline void processStartNewCycle();
27inline void processPlusHalfCycle();
28inline void processMinusHalfCycle();
29inline void processVoltageRawSample(int16_t rawSample);
30inline void processRawSamples();
31inline void processVoltage();
32inline void processPolarity(int16_t rawSample);
33inline void confirmPolarity();
34inline void processGridCurrentRawSample(int16_t rawSample);
35inline void processDivertedCurrentRawSample(int16_t rawSample);
36inline void proceedLowEnergyLevel();
37inline void proceedHighEnergyLevel();
38inline uint8_t nextLogicalLoadToBeAdded();
39inline uint8_t nextLogicalLoadToBeRemoved();
40inline void processLatestContribution();
41inline void processDataLogging();
42#else
43inline void processStartUp() __attribute__((always_inline));
44inline void processStartNewCycle() __attribute__((always_inline));
45inline void processPlusHalfCycle() __attribute__((always_inline));
46inline void processMinusHalfCycle() __attribute__((always_inline));
47inline void processVoltageRawSample(int16_t rawSample) __attribute__((always_inline));
48inline void processRawSamples() __attribute__((always_inline));
49inline void processVoltage() __attribute__((always_inline));
50inline void processPolarity(int16_t rawSample) __attribute__((always_inline));
51inline void confirmPolarity() __attribute__((always_inline));
52inline void processGridCurrentRawSample(int16_t rawSample) __attribute__((always_inline));
53inline void processDivertedCurrentRawSample(int16_t rawSample) __attribute__((always_inline));
54inline void proceedLowEnergyLevel() __attribute__((always_inline));
55inline void proceedHighEnergyLevel() __attribute__((always_inline));
56inline uint8_t nextLogicalLoadToBeAdded() __attribute__((always_inline, optimize("-O3")));
57inline uint8_t nextLogicalLoadToBeRemoved() __attribute__((always_inline, optimize("-O3")));
58inline void processLatestContribution() __attribute__((always_inline));
59inline void processDataLogging() __attribute__((always_inline, optimize("-O3")));
60
61void handlePerSecondTasks(bool& bOffPeak, int16_t iTemperature_x100) __attribute__((always_inline));
62#endif
63
64#endif /* PROCESSING_H */
void logLoadPriorities()
Prints the load priorities to the Serial output.
void initializeProcessing()
Initializes the processing engine, including ports, load states, and ADC setup.
void initializeOldPCBPins()
Initializes optional pins for the old PCB configuration.
void processGridCurrentRawSample(int16_t rawSample)
Processes the raw current sample for the grid connection point.
void confirmPolarity()
Confirms the polarity of the current voltage sample.
void processRawSamples()
This routine is called by the ISR when a pair of V & I samples becomes available.
void updatePhysicalLoadStates()
This function provides the link between the logical and physical loads.
void processDivertedCurrentRawSample(int16_t rawSample)
Processes the raw current sample for the diverted connection point.
void updatePortsStates()
Updates the control ports for each of the physical loads.
void processMinusHalfCycle()
Process the start of a new -ve half cycle, just after the zero-crossing point.
void processStartNewCycle()
This code is executed once per 20ms, shortly after the start of each new mains cycle on phase 0.
void processPolarity(int16_t rawSample)
Processes the polarity of the current voltage sample.
void proceedLowEnergyLevel()
Process the case of low energy level, some action may be required.
uint8_t nextLogicalLoadToBeAdded()
Retrieve the next load that could be removed (be aware of the reverse-order).
void processVoltage()
Process the calculation for the current voltage sample.
void processDataLogging()
Process with data logging.
void processPlusHalfCycle()
Process the start of a new +ve half cycle, just after the zero-crossing point.
uint8_t nextLogicalLoadToBeRemoved()
Process with data logging.
void processLatestContribution()
Process the latest contribution after each new cycle.
void processVoltageRawSample(int16_t rawSample)
Process the current voltage raw sample.
void processStartUp()
Process the startup period for the router.
void proceedHighEnergyLevel()
Process the case of high energy level, some action may be required.
void handlePerSecondTasks(bool &bOffPeak, int16_t iTemperature_x100)
Handles tasks that need to be executed every second.
Definition main.cpp:441
void printParamsForSelectedOutputMode()
Print the settings used for the selected output mode.