23 Commits
Author SHA1 Message Date
Justin MitchellandGitHub 7d86603ad2 fix: raises back button adc to fix press detection on x3 (#34)
User reported their back button didn't work on crosspoint but did work
on stock. I had them run a few tests with logging and it turns out their
back button reports 3832 which is above the 3800 threshold we detect for
back button presses. This fixes the issue while still being within an
acceptable range to not have any regressions on other buttons. This fix
was verified by the user, and has been tested on an non problematic x3,
and an x4.
2026-04-25 13:14:39 -07:00
JustinianandGitHub a64a3c29be feat: X3 grayscale LUTs and fast diff BB reinforcement (#32)
## Summary
Adds dedicated X3 grayscale LUTs and improves fast differential refresh
for better antialiased text rendering on the Xteink X3 display.

## Changes
- Dedicated grayscale LUTs (lut_x3_*_gray): Single-phase waveforms with
tuned VDL drive for dark gray (2 units) and light gray (3 units), with
active GND hold on non-gray transitions to prevent crosstalk
- Tight scan timing: TP2/TP3 reduced from 6 to 1 to minimize idle
gate-on time (17 to 7 units per row), reducing parasitic charge leakage
that causes white lines through letter strokes
- BB reinforcement: Added mild VDH pulse (VS=0x10) to lut_x3_bb_full so
black pixels get actively reinforced during fast differential refreshes,
clearing gray residue/ghosting
- displayGrayBuffer() updated to use the dedicated gray LUT bank instead
of full refresh LUTs

Companion to crosspoint-reader/crosspoint-reader#1607

## AI Disclosure
Yes, AI was used to assist with the development of these changes.
2026-04-07 17:12:58 -07:00
Justin MitchellandGitHub 157d724d7a feat: Adds support for the xteink x3 (#19)
## Summary

  Adds X3-aware display support and policy in
  `EInkDisplay`, while preserving non-X3 behavior.

  This PR centralizes X3 panel handling in SDK so app code can
  keep using the normal display API (`FULL/HALF/FAST`) without
  panel-specific command logic spread across activities.

  ### 1) X3 mode and runtime geometry support
  - Added runtime mode/state for X3:
    - `_x3Mode`
    - runtime width/height/bytes/buffer sizing support
    - previous-frame tracking for stable differential updates
  (`_x3PrevFrame`, `_x3PrevFrameValid`)

  ### 2) X3 refresh policy in `displayBuffer()`
  - Added X3-specific fast/full routing:
    - diff-based partial vs full promotion
    - forced one-shot full sync path for transition cleanup
  - Added X3 command/LUT sequencing policy:
    - partial window updates (`0x91/0x90/.../0x92`)
    - full two-plane writes (`0x13` + `0x10`)
    - `0x50` mode selection and conditional `0x04` usage
    - `0x12` trigger and busy wait handling

  ### 3) Transition resync API
  - Added:
    - `requestResync(uint8_t settlePasses = 0)`
  - Enables app to request one-shot transition cleanup:
    - full sync
    - optional limited settle passes
    - no persistent mode flip

  ## Compatibility

  - X3 behavior is strictly gated by `_x3Mode`.
  - Non-X3 path remains unchanged.
2026-04-02 23:18:46 -07:00
9f76376a5c feat: Update BatteryMonitor for Arduino ESP32 Core 3.x compatibility (#21)
Migrating to Arduino ESP32 Core 3.x (ESP-IDF 5.x). The esp_adc_cal_* API
was removed in ESP-IDF 5.x - replaced with analogReadMilliVolts() which
handles ADC calibration internally.

---------

Co-authored-by: Dave Allie <dave@daveallie.com>
2026-02-22 20:13:36 +11:00
CaptainFritoandGitHub 91e7e2bef7 feat: Draw transparent image for icons (#18)
Adding a method to the display renderer to support drawing images
without coloring the white pixels, essentially drawing transparent
images for icons in the Lyra Icons PR
https://github.com/crosspoint-reader/crosspoint-reader/pull/725
2026-02-10 19:33:42 +11:00
Maik AllgöwerandGitHub c8ce3949b3 feat: Allow for sunlight fading fix (#15)
See crosspoint-reader/crosspoint-reader#561 for details.

This PR contains necessary changes to be able to implement a fix for the
sunlight fading issue present on the XTEINK X4.

Basically, I'm making sure for all necessary functions to have a
parameter turnOffScreen and to pass it through to displayBuffer() .

displayBuffer() then won't do a HALF_REFRESH if if turnOffScreen is true
and also pass it down to refreshDisplay().
2026-02-02 00:36:37 +11:00
Jonas DiemerandGitHub c39f253a7d Only do serial output if Serial is valid (#13) 2026-01-21 21:28:00 +11:00
Yaroslav NychkaloandGitHub fe766f15cb add SdManager rename method (#11)
This is going to be used in Rename/Move files and folders functionality
(on web)
2026-01-02 17:50:38 +11:00
0589632f17 fix: add missing #include <string> to SDCardManager.h (#12)
The SDCardManager.h header uses std::string in function signatures but
doesn't include the <string> header, causing build failures.

Co-authored-by: ratedcounsel <hello@ratedcounsel.com>
2026-01-02 17:50:17 +11:00
Dave AllieandGitHub bd4e670750 [SDCardManager] Use SdFat for exFAT support (#10)
- Migrate over to SdFat for exFAT support
- Add new utilities:
  - `openFileForWrite`
  - `openFileForRead`
  - `removeDir`
- Sets up a singleton and macro to access it (`SdMan`)
2025-12-30 16:02:18 +11:00
Dave AllieandGitHub 98a5aa1f89 [EInkDisplay] Add basic implementation for displayWindow (#9)
Adds a basic implementation of `displayWindow` which displays a subset
of the current frame buffer to the screen. It is significantly less
performant than a full screen reload, so it shouldn't be used unless the
underlying content is hard to get/rerender.

I've also spotted a little bit of ghosting, but it's not fully clear as
to why that is. My only thought it the LUT and grayscale mode isn't
fully disengaged or the RED RAM buffer isn't correctly setup (but afaict
it should be populated correctly).

Going to merge this to continue testing this feature out in the wild,
but consider it experimental.
2025-12-17 00:01:47 +11:00
Dave AllieandGitHub fba62200e2 [EInkDisplay] Ensure buffer is swapped in dual buffer mode (#8)
Bug introduced in https://github.com/open-x4-epaper/community-sdk/pull/7
2025-12-16 23:00:59 +11:00
Dave AllieandGitHub af965a074b [EInkDisplay] Single buffer mode (#7)
* Cleanup EInkDisplay

* Add EINK_DISPLAY_SINGLE_BUFFER_MODE build flag and allow for single buffer rendering

* Add SSD1677 E-Ink Display Driver Guide

Copied verbatium from https://github.com/CidVonHighwind/microreader/blob/main/doc/SSD1677_GUIDE.md

* Add a few details in the readme and update the SSD1677_GUIDE
2025-12-16 22:43:29 +11:00
Dave AllieandGitHub 4d0dcd5ff8 [EInkDisplay] Fix incorrect power off sequence when calling deepSleep() (#6) 2025-12-15 22:24:58 +11:00
Dave Allie 7e0dce9167 [EInkDisplay] Noop grayscaleRevert if not in grayscale mode 2025-12-13 16:01:17 +11:00
Dave AllieandGitHub a126d4b0bf Add initial implementation of EInkDisplay from CidVonHighwind (#4) 2025-12-08 19:41:27 +11:00
Dave Allie 06b4cf0c71 Update InputManager to record any button hold time 2025-12-06 11:32:45 +11:00
Dave AllieandGitHub 9b7d94f06e Merge pull request #2 from open-x4-epaper/feature/input-manager
Input Manager from microreader
2025-12-06 04:16:26 +11:00
CaptainFrito ed787691d9 Input Manager 2025-12-04 19:34:29 +07:00
CaptainFrito 11b112da6f SD card manager from microreader 2025-12-04 19:20:21 +07:00
Dave Allie d52cab5735 Fix imports in BatteryMonitor 2025-12-02 22:36:53 +11:00
Dave Allie 4e89230e5a Add BatteryMonitor lib
Authored by @CrazyCoder in https://github.com/CidVonHighwind/xteink-x4-sample/pull/4
Pulled into community-sdk
2025-12-02 22:26:44 +11:00
Dave Allie fd8b341335 Initial community-sdk structure 2025-12-02 19:16:50 +11:00