Skip to content

Commit e164329

Browse files
committed
Load config
1 parent 993ab4b commit e164329

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

include/CommonConfig.hpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#pragma once
22

3-
static_assert(__cplusplus >= 202302L,
4-
"C++23 standard or later required.");
3+
static_assert(__cplusplus >= 202302L, "C++23 standard or later required.");
54

65
// Imports
76
#include <cstdint>
@@ -39,4 +38,23 @@ namespace RUN {
3938
constexpr uint32_t SLEEP_TIME_SECS = SLEEP_TIME_MINS * CONSTS::SECS_PER_MIN;
4039
constexpr uint32_t SLEEP_TIME_MILLIS =
4140
SLEEP_TIME_SECS * CONSTS::MILLIS_PER_SEC;
42-
} // namespace RUN
41+
} // namespace RUN
42+
43+
namespace LOAD {
44+
constexpr uint8_t PINS_MASK = 0b0011'1111; // First six pins
45+
constexpr uint_fast8_t NUM_PINS = 6;
46+
constexpr etl::array<uint_fast16_t, NUM_PINS> PIN_VALUES_mOhms = {
47+
500, 1000, 2000, 3000, 5000, 10000}; // in mOhms, in series // TODO
48+
static_assert(PIN_VALUES_mOhms.size() == NUM_PINS,
49+
"PIN_VALUES size mismatch");
50+
static_assert(PIN_VALUES_mOhms.back() < UINT16_MAX,
51+
"PIN_VALUES value too large");
52+
53+
// Pin 6 is connected by default in hardware
54+
constexpr uint_fast8_t INVERTED_PIN_INDEX = 5;
55+
constexpr uint8_t INVERTED_PIN_MASK = (1 << INVERTED_PIN_INDEX);
56+
static_assert(INVERTED_PIN_MASK == 0b0010'0000,
57+
"INVERTED_PIN_MASK value incorrect");
58+
constexpr uint8_t DEFAULT_LOAD_STATE = INVERTED_PIN_MASK;
59+
60+
} // namespace LOAD

0 commit comments

Comments
 (0)