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 constants, add missing init to example #25

Merged
merged 3 commits into from
Nov 26, 2021
Merged

waveshare2in13v2: Add constants, add missing init to example #25

merged 3 commits into from
Nov 26, 2021

Conversation

hansmi
Copy link
Contributor

@hansmi hansmi commented Nov 25, 2021

Translate magic numbers to named constants based on datasheet and add missing calls to dev.Init in example code.

fmt.Sprintf() can format numbers directly using the "%d" format
specifier.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
log.Fatalf("Failed to initialize driver: %v", err)
}

if err := dev.Init(false); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please unshadow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

setDummyLinePeriod byte = 0x3A
setGateTime byte = 0x3B
borderWaveformControl byte = 0x3C
unknownCommand37 byte = 0x37
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it listed in the datasheet or not?

Copy link
Contributor Author

@hansmi hansmi Nov 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this was a leftover from an earlier revision. No, this particular command isn't documented anywhree. I removed the constant again.

Without initializing the hardware nothing is shown on the display.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Translate the command names from the datasheet into constant names,
similar to `epd/epd.go`. These names make it easier to understand what
the driver does.

One command, 0x37, is not documented in any of the datasheets available
(Waveshare 2.13inch e-Paper, Good Display GDEH0213B72).

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2021

Codecov Report

Merging #25 (1da7077) into main (7836991) will increase coverage by 0.0%.
The diff coverage is 0.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main     #25   +/-   ##
=====================================
  Coverage   60.3%   60.3%           
=====================================
  Files         48      48           
  Lines       6454    6453    -1     
=====================================
  Hits        3893    3893           
+ Misses      2426    2425    -1     
  Partials     135     135           
Impacted Files Coverage Δ
waveshare2in13v2/waveshare213v2.go 0.0% <0.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 7836991...1da7077. Read the comment docs.

@maruel
Copy link
Member

maruel commented Nov 26, 2021

Thanks!

@maruel maruel merged commit d92a4ed into periph:main Nov 26, 2021
@hansmi hansmi deleted the ws2in13dev branch December 11, 2021 17:53
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