tds3p-rsvp-reader/include/Config.h

49 lines
1.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <Arduino.h>
namespace config {
// Pins from LilyGO's T-Display-S3-Pro utilities.h.
constexpr uint8_t kSpiMiso = 8;
constexpr uint8_t kSpiMosi = 17;
constexpr uint8_t kSpiSck = 18;
constexpr uint8_t kTftCs = 39;
constexpr uint8_t kTftDc = 9;
constexpr uint8_t kTftReset = 47;
constexpr uint8_t kBacklight = 48;
constexpr uint8_t kSdCs = 14;
constexpr uint8_t kI2cSda = 5;
constexpr uint8_t kI2cScl = 6;
constexpr uint8_t kTouchReset = 13;
constexpr uint8_t kTouchInterrupt = 21;
constexpr uint8_t kButtonPlayPause = 0; // BOOT; never hold while pressing RESET.
constexpr uint8_t kButtonPrevious = 12;
constexpr uint8_t kButtonNext = 16;
constexpr char kBooksDirectory[] = "/books";
// Source sections and their optional RSVP sidecars are loaded into memory.
constexpr size_t kMaxSectionBytes = 1024 * 1024;
// A single token can be a long URL or identifier, but should never consume a
// material fraction of the reader's working memory.
constexpr uint32_t kMaxTokenBytes = 256 * 1024;
constexpr uint16_t kDefaultWpm = 300;
constexpr uint16_t kMinimumWpm = 100;
constexpr uint16_t kMaximumWpm = 800;
constexpr uint16_t kWpmStep = 50;
constexpr uint32_t kDimAfterMs = 20UL * 1000UL;
constexpr uint32_t kDisplayOffAfterMs = 60UL * 1000UL;
constexpr uint32_t kDeepSleepAfterMs = 10UL * 60UL * 1000UL;
constexpr uint8_t kNormalBrightness = 5; // 1–16 on v1.1 boards.
constexpr uint8_t kDimBrightness = 1;
constexpr uint8_t kDefaultFontStyle = 0; // Sans, Serif, Mono.
// Tenths: 10, 15, 20, 25, 30, 35, and 40 display as 1 through 4.
constexpr uint8_t kDefaultFontSize = 20;
constexpr uint8_t kMinimumFontSize = 10;
constexpr uint8_t kMaximumFontSize = 40;
constexpr uint8_t kFontSizeStep = 5;
} // namespace config