Commit Graph

399 Commits (b4f2e163f953b1ea4bc4dcd82e09ba7c2739d156)
 

Author SHA1 Message Date
hansmi 5b35a3fb05
waveshare2in13v2: Deduplicate and simplify logic for sending data (#33)
Dev.Clear: Avoid writing one beyond the end of the line. Also build the
row data only once before sending it for each line.

Dev.Draw, Dev.DrawPartial: Deduplicate logic for iterating over pixels
and simplify it such that a whole row of bits is built before sending
them in one go.

Tested using a Waveshare e-Paper 2.13in V2 display.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
4 years ago
hansmi 37f977f749
videosink: Add options for JPEG and PNG encoders (#30)
Expose the quality settings for the JPEG encoder and the compression
level of the PNG encoder via the Options structure.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
4 years ago
hansmi 58303fd4d6
videosink: Add missing comment on Display structure (#31) 4 years ago
hansmi 42ee8553ed
Add videosink display driver (#27)
The videosink package provides a display driver implementing an HTTP
request handler. Client requests get an initial snapshot of the graphics
buffer and are updated further on every change.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
4 years ago
hansmi 02831f4a67
Bump Go version in go.mod and for quick tests to 1.14 (#29)
Go 1.13 was released in September 2019, more than two years ago.
Updating to one later release should be fine.

The primary reason for doing this is the introduction of
"testing".T.Cleanup in Go 1.14 (https://pkg.go.dev/testing#T.Cleanup).

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
5 years ago
hansmi d09d487465
Remove dependencies on fogleman/gg and golang/freetype (#28)
The waveshare2in13v2 example was evidently copied from the epd example,
but didn't comment out the code pulling in additional dependencies.
5 years ago
hansmi d92a4ed45d
waveshare2in13v2: Add constants, add missing init to example (#25)
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>
5 years ago
Bracken 7836991f22
mfrc522: The default should be not bogus (#24) 5 years ago
Bracken 00ed90382f
mfrc522 - Fix 4-byte tag UIDs (#22)
4-byte UIDs incorrectly included a 5th csum byte. 7-byte UIDs were unaffected.
5 years ago
Marc-Antoine Ruel 47f3fec45d go.mod: update dependencies 5 years ago
Marc-Antoine Ruel cfbbeedbcb README: update badge 5 years ago
Marc-Antoine Ruel ecaf62d235 gohci and github actions: improve testing 5 years ago
Benjamin Böhmke 3b2961221d
ds18b20: fixed conversion time for DS18S20 + cleanup (#19)
* proper handle DS18S20 conversion time

* cleanup and docu fix for ds18b20
5 years ago
Benjamin Böhmke ddb2231182
Support for DS18S20 (#18) 5 years ago
Marc-Antoine Ruel b5024d6816 github actions: skip unnecessary checks
No need to test 1.14.7, 1.13.15 is already sufficient.
No need to test in GOPATH mode.
5 years ago
Marc-Antoine Ruel 97998e315b github action: update for go1.17 and fix checks for PRs
- 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.
5 years ago
Marc-Antoine Ruel 440ba6e652 Fix ineffassign check 5 years ago
Marc-Antoine Ruel 0b81efc55a Roll dependencies 5 years ago
Marc-Antoine Ruel 287b18d411 Add gohci forward tests
Test with cmd with the current devices commit.
5 years ago
Marc-Antoine Ruel 823eae07fd staticcheck: enforce
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.
5 years ago
Marc-Antoine Ruel a27238ec6e enforce no shadowed variable
Convert a few wrapped error from %v to %w.

This does result in a few awkward cases but the value outweighs the
downsides.
5 years ago
Marc-Antoine Ruel 31cac53e0a github: test on cmd in advance 5 years ago
Marc-Antoine Ruel 9d89bbe62d Update issue and PR github templates 5 years ago
Audrius Paskevicius 764682acfd
ds248x: add support for DS2482-800 in addition to DS2482-100 (#13) 5 years ago
Ohad Lutzky 8249b953cd
ssd1306: Add SetDisplayStartLine (#14) 5 years ago
Thereatra 765957cae1
[Inky] autodetect board opts and pHAT v2 support (#12)
* 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
5 years ago
Marc-Antoine Ruel c53a2960d0 Add unnamed private struct
Forces the use of named values
5 years ago
Marc-Antoine Ruel 4d2d9a5ccb Bump go to 1.16 5 years ago
Marc-Antoine Ruel 94908ff801 screen1d: import from periph/extra
Tweak it a bit to expose the palette as an option.
Uses the same license.
This is the first commit that causes a dependency on golang.org/x/sys.
5 years ago
bezineb5 fa6bf2a91f
[TLV493D] Method to calibrate temperature offset (#10) 5 years ago
bezineb5 0900f2cbf4
[TLV493D] Method to calibrate temperature offset (#9) 5 years ago
Dan Kortschak 960e8d343b
waveshare2in13v2: add example (#8) 5 years ago
Bracken 7cccb95509
Prevent WaitForEdge() returning early after first call to selectCard() (#7)
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
5 years ago
Carlos Cardoso ff2252c545
added support for EP0099 (#5)
EP0099 is a stackable 4-channel relay hat that communicates with
platforms via i2c interface.

Manufacturer: 52pi
Wiki page: https://wiki.52pi.com/index.php/DockerPi_4_Channel_Relay_SKU:_EP-0099
5 years ago
Marc-Antoine Ruel 4b2f290e0a README.md: move links above the mascot
Otherwise they don't show up on pkg.go.dev.
5 years ago
Florian Klink fe248193e0
nrzled: Don't set NoCS (#4)
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.
5 years ago
Sönke Brightside 296894bc24
Separate waveshare2in13v2 driver (#2)
Adds support for EPD2in13v2
5 years ago
Marc-Antoine Ruel 21ad53b7b5 as7262: disable racy test 5 years ago
Marc-Antoine Ruel 16652c725e github actions: purge the cache
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
5 years ago
Sönke Brightside 9edd3f443e
added support for EPD2in13v2 (#1) 5 years ago
Marc-Antoine Ruel 2dc230abd8 go.mod: update for v3.6.7 5 years ago
Marc-Antoine Ruel 402bbcc930 Migrate to devices/v3
Ran:
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/conn#periph.io/x/conn/v3#g'
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/host#periph.io/x/host/v3#g'
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/devices#periph.io/x/devices/v3#g'
  go test ./...
  go mod tidy
5 years ago
Marc-Antoine Ruel 50dea9a963 go.mod: update host with fixes 5 years ago
Florian Klink 51e659fc71 nrzled/rasterSPI: fix ordering
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.
5 years ago
Marc-Antoine Ruel ca5540146f tlv493d: disable test TestTLV493D_ReadContinous
It fails on CI with:
  panic: i2ctest: expected playback to be empty: I/O count 8; expected 9
5 years ago
Marc-Antoine Ruel af14a1f7d2 go.mod: update conn and host for driverreg 5 years ago
Marc-Antoine Ruel dbc4b06abe Add a few things
- Update README.md to point at the right place.
- Add github actions.
- Add codecov.yml because the codecov.io defaults are not great.
5 years ago
Marc-Antoine Ruel 655d1cef69 Update import path to what devices will be
Also update imports to conn and host.

Ran (roughly):
  # Update the references.
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/conn#x/conn#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/conn#x/conn#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/host#x/host#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/host#x/host#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/devices#x/devices#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/devices#x/devices#g'

  # Initialize the go module:
  go mod init periph.io/x/devices

  # Edited it to require go 1.13:
  vi go.mod

  # Reorder imports.
  goimports -w .
5 years ago
Marc-Antoine Ruel 1de83694a1 Migrate layout to the destination layout
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.
5 years ago
Marc-Antoine Ruel 3e859ec96e Fix more gosec G104 warnings
I have a hard time running it locally, so testing in prod.
5 years ago