Avoid using strconv.Itoa
fmt.Sprintf() can format numbers directly using the "%d" format
specifier.
Call Dev.Init in example code
Without initializing the hardware nothing is shown on the display.
Add constants for commands
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>
- Use go1.17 for github actions.
- Use go mod edit instead of go get for testing other packages. There's two
benefits:
- This removes the round trip to pkg.go.dev and use the already present local
checkout.
- The go get periph.io/x/conn/v3@${GITHUB_SHA} command worked if a maintainer
push a branch, but fails for a PR. This is because the go get command does a
clone with all the branches, so it finds the commit even if it's not in main.
For a PR, one has to pull a specific refs/pull/ID/head ref that is not a
branch, thus go get cannot find it because git clone doesn't know about it.
The only way to work around is to git clone manually.
- Remove 'go version' and 'go env' since they are already run as part of
setup-go@v2.
- Fix a new check in go vet in example code.
This does result in a few awkward cases but in general it's worth
enforcing and most importantly will make my life as a code reviewer
easier.
It's mostly deletion of dead code.
* Added support for Inky pHAT v2
* Added support for detecting Inky board. Detect Inky board opts from eeprom, and detect new inky dev with sane default from opts
Calling LowLevel.Init() in selectCard() clears the device interrupt
as a side effect, but another interrupt will occur due to the
subsquent operations. This additional host interrupt must be cleared
before the next call to selectCard.
Fixes https://github.com/google/periph/issues/425
Whether or not CS (chip select) is used really depends on the way how
you wire things together, not on the device you're talking to.
Not using CS (and explicitly telling the SPI controller about that)
might keep some pins free on pin-constrained boards, but also, some
controllers (or Linux drivers) don't support disabling CS, and fail when
that flag is given.
On the other hand, even though nrzleds don't make use of CS by
themselves, you could very well have some circuit in front to do the
chip select, and then actually write to different nrzled devices
sequentially.
Long-term, the fact on whether to do chip select should be specified
while passing in the SPI port to be used, as it really depends on the
way it's wired together on the specific board, not on the type of
device.
This is done by changing the cache key.
go get tools currently fail with:
# cd /home/runner/go/src/golang.org/x/tools; git pull --ff-only
From https://go.googlesource.com/tools
+ 63754364...8b4aab62 master -> origin/master (forced update)
ab9934f0..f2d1c246 gopls-release-branch.0.6 -> origin/gopls-release-branch.0.6
* [new branch] internal-branch.issue43628 -> origin/internal-branch.issue43628
* [new tag] gopls/v0.6.2 -> gopls/v0.6.2
* [new tag] gopls/v0.6.3-pre.1 -> gopls/v0.6.3-pre.1
fatal: Not possible to fast-forward, aborting.
package golang.org/x/tools/go/analysis: exit status 128
See https://github.com/periph/devices/pull/2/checks?check_run_id=1693498363
This is supposed to be sent out in GRB order (and the comment below also
below claims it), but the code (and corresponding unit tests) did output
RGB order.
First I imported the commits from v3.6.6 with:
PKG=devices
git init $PKG
cd $PKG
git remote add origin https://github.com/google/periph
git fetch origin
git filter-repo \
--path AUTHORS \
--path CONTRIBUTING.md \
--path CONTRIBUTORS \
--path LICENSE \
--path README.md \
--path $PKG --path experimental/$PKG $@
git remote add origin git@github.com:periph/$PKG
git fetch origin
# Use the occasion to rename from master to main since we are starting from
# scratch.
git branch -m main
git push origin main
Then I fixed the layout to get rid of experimental with:
git rm experimental/devices/README.md
git mv experimental/devices/* .
git mv devices/* .
The import paths will be fixed in a follow up.