Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

waveshare2in13v2: Add function for deep sleep, update both buffers on clear #42

Merged
merged 5 commits into from
Dec 27, 2021
Merged

waveshare2in13v2: Add function for deep sleep, update both buffers on clear #42

merged 5 commits into from
Dec 27, 2021

Conversation

hansmi
Copy link
Contributor

@hansmi hansmi commented Dec 25, 2021

Add a named constant for the previously unknown 0x37 command, tweak when hardware is enabled, add a function to put display to sleep and clear both buffers.

The datasheets of the comparable SSD1680, SSD1675B and GDEH0213B73
controllers describe this command as "Write register for display
option".

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Enable the clock and analog parts when configuring the mode. In probably
all use cases a drawing operation is following soon after anyway.
Putting the device to sleep disables these hardware parts again.
Move the logic applying display content changes to both buffers to the
"drawImage" function.
With the introduction of the shadow buffer in commit 4f99575 there's
always a sufficiently large memory buffer to keep the bytes to send for
clearing and the dedicated code using a smaller buffer is no longer
needed. This also has the advantage of automatically updating both
on-device buffers.
@codecov-commenter
Copy link

codecov-commenter commented Dec 25, 2021

Codecov Report

Merging #42 (8d6bc97) into main (3650bc7) will decrease coverage by 0.1%.
The diff coverage is 55.6%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main     #42     +/-   ##
=======================================
- Coverage   63.6%   63.5%   -0.1%     
=======================================
  Files         56      56             
  Lines       6727    6706     -21     
=======================================
- Hits        4279    4260     -19     
+ Misses      2307    2304      -3     
- Partials     141     142      +1     
Impacted Files Coverage Δ
waveshare2in13v2/waveshare213v2.go 0.0% <0.0%> (ø)
waveshare2in13v2/drawing.go 96.3% <82.4%> (-3.7%) ⬇️
waveshare2in13v2/controller.go 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3650bc7...8d6bc97. Read the comment docs.

@maruel maruel merged commit 1b1970b into periph:main Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants