mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-14 07:21:30 +10:00
* Add Elecrow ThinkNode M8 variant scaffold (thinknode_m8) nRF52840 + SX1262 + 2.4" e-paper + ATGM336H-5NR32 GPS. All pins resolved from ThinkNode_M8_V0.3.sch; cross-checked against meshtastic/firmware#9181 (Elecrow V0.1 reference). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add Elecrow ThinkNode M8 board support (nRF52840/SX1262, 1.54in e-ink, ATGM336H GNSS, SC7A20, EC04 encoder) * Address review: keep the stored backlight level out of blanking, match only the SC7A20 WHO_AM_I byte, and transfer detents atomically * Use std::atomic for the press-and-turn detent counter so native builds compile * Drop the ThinkNode M8 LED_BUILTIN redefinition that warned on every translation unit --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
47 lines
937 B
C++
47 lines
937 B
C++
#pragma once
|
|
|
|
#include "configuration.h"
|
|
|
|
// PWM backlight control. A variant opts in by defining PIN_PWM_BACKLIGHT, optionally with
|
|
// PWM_BACKLIGHT_DEFAULT, _MIN, _MAX and _STEP. Levels are 0..255 in uiconfig.screen_brightness.
|
|
|
|
#if defined(PIN_PWM_BACKLIGHT)
|
|
#define HAS_PWM_BACKLIGHT 1
|
|
#else
|
|
#define HAS_PWM_BACKLIGHT 0
|
|
#endif
|
|
|
|
#if HAS_PWM_BACKLIGHT
|
|
|
|
#ifndef PWM_BACKLIGHT_DEFAULT
|
|
#define PWM_BACKLIGHT_DEFAULT 128
|
|
#endif
|
|
#ifndef PWM_BACKLIGHT_MIN
|
|
#define PWM_BACKLIGHT_MIN 8
|
|
#endif
|
|
#ifndef PWM_BACKLIGHT_MAX
|
|
#define PWM_BACKLIGHT_MAX 248
|
|
#endif
|
|
#ifndef PWM_BACKLIGHT_STEP
|
|
#define PWM_BACKLIGHT_STEP 20
|
|
#endif
|
|
|
|
namespace graphics
|
|
{
|
|
void backlightSet(uint8_t level);
|
|
|
|
uint8_t backlightGet();
|
|
|
|
void backlightOn(); // drive the stored level
|
|
|
|
void backlightOff(); // drive 0, leaving the stored level alone
|
|
|
|
void backlightToggle();
|
|
|
|
void backlightStepUp();
|
|
|
|
void backlightStepDown();
|
|
} // namespace graphics
|
|
|
|
#endif // HAS_PWM_BACKLIGHT
|