3-phase PV router
Loading...
Searching...
No Matches
TempSchedule Namespace Reference

Classes

struct  Action
 The transaction to run, and the sensor it reads (ADDRESS, READ, CLOSE). More...
 
class  Scheduler
 The round of the sensors, one transaction per mains cycle. More...
 

Enumerations

enum class  Step : uint8_t {
  NONE , CONVERT , ADDRESS , READ ,
  CLOSE
}
 The 1-Wire transaction of a mains cycle. More...
 

Functions

constexpr uint16_t conversionCycles (const uint8_t supplyFrequency)
 The mains cycles from the conversion to the first read.
 
constexpr bool fitsInPeriod (const uint8_t noOfSensors, const uint8_t supplyFrequency, const uint16_t periodCycles)
 Whether a round ends within its datalog period.
 
constexpr uint16_t roundCycles (const uint8_t noOfSensors, const uint8_t supplyFrequency)
 The mains cycles of a round on time: from the conversion to the last CLOSE.
 

Variables

constexpr uint16_t CONVERSION_MS { 750 }
 
constexpr uint8_t STEPS_PER_SENSOR { 3 }
 

Enumeration Type Documentation

◆ Step

enum class TempSchedule::Step : uint8_t
strong

The 1-Wire transaction of a mains cycle.

Enumerator
NONE 

no bus I/O on this cycle

CONVERT 

reset, Skip ROM, Convert T: every sensor converts

ADDRESS 

reset, Match ROM, the first half of the sensor's ROM code

READ 

the second half of its ROM code, Read Scratchpad, the 9 bytes

CLOSE 

reset (the sensor still there?), the reading decoded

Definition at line 56 of file temp_schedule.h.

Function Documentation

◆ conversionCycles()

uint16_t TempSchedule::conversionCycles ( const uint8_t supplyFrequency)
constexpr

The mains cycles from the conversion to the first read.

750 ms rounded up to whole cycles, plus one: a transaction may start up to a little after its cycle began (39 cycles at 50 Hz, 780 ms; 46 at 60 Hz, 767 ms).

Parameters
supplyFrequencySUPPLY_FREQUENCY

Definition at line 84 of file temp_schedule.h.

Here is the caller graph for this function:

◆ fitsInPeriod()

bool TempSchedule::fitsInPeriod ( const uint8_t noOfSensors,
const uint8_t supplyFrequency,
const uint16_t periodCycles )
constexpr

Whether a round ends within its datalog period.

The round starts at the first cycle of the period, or the next one if the first is late; one cycle per second of the round may be late; and it must be over before the last cycle of the period, whose datalog copies run in the ADC interrupt at L1's crossing, before the new cycle is flagged.

Parameters
noOfSensorsThe number of sensors
supplyFrequencySUPPLY_FREQUENCY
periodCyclesDATALOG_PERIOD_IN_MAINS_CYCLES

Definition at line 112 of file temp_schedule.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ roundCycles()

uint16_t TempSchedule::roundCycles ( const uint8_t noOfSensors,
const uint8_t supplyFrequency )
constexpr

The mains cycles of a round on time: from the conversion to the last CLOSE.

Parameters
noOfSensorsThe number of sensors
supplyFrequencySUPPLY_FREQUENCY

Definition at line 95 of file temp_schedule.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CONVERSION_MS

uint16_t TempSchedule::CONVERSION_MS { 750 }
inlineconstexpr

the longest conversion of a DS18B20, at 12 bits

Definition at line 74 of file temp_schedule.h.

◆ STEPS_PER_SENSOR

uint8_t TempSchedule::STEPS_PER_SENSOR { 3 }
inlineconstexpr

ADDRESS, READ, CLOSE

Definition at line 72 of file temp_schedule.h.