13#ifndef UTILS_DISPLAY_H
14#define UTILS_DISPLAY_H
70 LOW, HIGH, HIGH, HIGH,
73 HIGH, HIGH, HIGH, HIGH,
74 LOW, HIGH, HIGH, HIGH,
143 static uint8_t digitLocationThatIsActive = 0;
154 digitLocationThatIsActive = 0;
170 const auto& lineState{
digitValueMap[digitVal & 0x7F][line] };
189inline constexpr uint8_t
ON{ HIGH };
190inline constexpr uint8_t
OFF{ LOW };
287 static uint8_t digitLocationThatIsActive{ 0 };
295 digitLocationThatIsActive = 0;
304 const auto& segmentState{
segMap[digitVal & 0x7F][segment] };
413inline void configureValueForDisplay(
const bool _EDD_isActive,
const uint16_t _ValueToDisplay,
const bool _diversionEnabled =
false,
414 const bool _loadForced =
false)
429 if (!_diversionEnabled)
437 static uint8_t locationOfDot{ 0 };
455 const auto energyValueExceeds10kWh{ _ValueToDisplay > 9999u };
457 uint32_t tmpVal{ energyValueExceeds10kWh ?
divu10(_ValueToDisplay) : _ValueToDisplay };
465 if (energyValueExceeds10kWh)
502 static uint8_t displayTime_count{ 0 };
507 displayTime_count = 0;
void divmod10(uint32_t in, uint32_t &div, uint8_t &mod)
uint16_t divu10(uint16_t n)
Configuration values to be set by the end-user.
constexpr DisplayType TYPE_OF_DISPLAY
Basic configuration values to be set by the end-user.
constexpr uint32_t mainsCyclesPerHour
void initializeDisplay()
Initializes the display for hardware-driven 7-segment displays.
void initializeDisplaySW()
Initializes the display for software-driven 7-segment displays.
void configureValueForDisplay(const bool _EDD_isActive, const uint16_t _ValueToDisplay, const bool _diversionEnabled=false, const bool _loadForced=false)
Configures the value for display on a 7-segment display.
void displayForced()
Displays "FORC" on the 7-segment display for forced load override.
void update7SegmentSWDisplay()
Updates the 7-segment display for the next digit (software-driven).
void initializeDisplayHW()
Initializes the display for hardware-driven 7-segment displays.
void update7SegmentHWDisplay()
Updates the 7-segment display for the next digit (hardware-driven).
void refresh7SegDisplay()
Refreshes the display by updating the active digit and its segments.
void displayOff()
Displays "OFF" on the 7-segment display.
constexpr uint8_t noOfSegmentsPerDigit
constexpr uint8_t digitValueMap[noOfPossibleCharacters][noOfDigitSelectionLines]
constexpr uint8_t segMap[noOfPossibleCharacters][noOfSegmentsPerDigit - 1]
constexpr uint8_t decimalPointLine
constexpr uint8_t enableDisableLine
constexpr uint8_t UPDATE_PERIOD_FOR_DISPLAYED_DATA
constexpr uint8_t DRIVER_CHIP_DISABLED
constexpr uint8_t noOfDigitSelectionLines
constexpr uint8_t digitLocationLine[noOfDigitLocationLines]
constexpr uint8_t digitSelectionLine[noOfDigitSelectionLines]
constexpr uint8_t noOfDigitLocationLines
constexpr uint8_t digitSelectorPin[noOfDigitLocations]
uint8_t charsForDisplay[noOfDigitLocations]
constexpr uint8_t DPstatus_columnID
constexpr uint8_t noOfDigitLocations
constexpr uint8_t noOfPossibleCharacters
constexpr uint8_t digitLocationMap[noOfDigitLocations][noOfDigitLocationLines]
constexpr uint8_t DRIVER_CHIP_ENABLED
constexpr uint32_t displayShutdown_inMainsCycles
constexpr uint8_t DISPLAY_SHUTDOWN_IN_HOURS
constexpr uint8_t segmentDrivePin[noOfSegmentsPerDigit]
constexpr uint8_t MAX_DISPLAY_TIME_COUNT
constexpr void setPinState(const uint8_t pin, const bool bState)
Set the Pin state for the specified pin.