Commit Graph

318 Commits (4f995754b0d8a559aa19cafd77fe12222074219f)
 

Author SHA1 Message Date
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
Marc-Antoine Ruel b8dde0ed43 Fix all gosec G104 warnings
This will be enforced in a follow up commit.
5 years ago
Lars Hoogestraat a86ea4f5ce st7567: Minor cleanup (#453)
* correct comment of CommonDirection
* do not allocate unnecessary memory
6 years ago
Marc-Antoine Ruel 2ac43be45e mcp23xxx: fix invalid value; add link to datasheet
See page 12, Table 3-1, and page 17 table 3-5 (bank select is zero on
reset).
6 years ago
Lars Hoogestraat cb7455c2ca st7567: add device driver for 128x64 dot matrix LCD (#451)
This adds experimental support for the st7567 LCD device which is used by the GFX HAT from Pimoroni.

The example just places some pixels on the device and iterates over the possible contrast values, going into power save mode and waking up.

The command line tool can take a PNG image and paints the black pixels onto the LCD.

Example and command line tool have been tested with a GFX Hat.
6 years ago
bezineb5 8a5f0035b2 Implement TLV493D hall effect sensor on I2C bus (#450) 6 years ago
xenOs76 99245bb350 cap1xxx.go: shift input statuses by d.inputStatuses array len (#449)
Co-authored-by: sante at os76.xyz <sante@os76.xyz>
6 years ago
Denis Luchkin-Zhou 8fe00338c0 Made column differential work for SSD1306 (#444) 6 years ago
Marc-Antoine Ruel 0fbde4244b Add GitHub actions
Take inspiration from the workflows used in gohci and bootstrap but
disable many checks because it's going to take a while to fix them all.

Update go generate to make it work without prerequisites preinstalled.

Remove the corresponding checks from .travis.yml. There are still checks
that haven't been transitioned, this will be done in a follow up.
6 years ago
Marc-Antoine Ruel 7682081ae0 Many staticcheck fixes
It now passes when run as:
  staticcheck -checks all,-U1000,-ST1003,-SA5002,-SA1019 ./...

The disabled checks will be enabled later since they are less trivial to
enable, as this is already a non-trivial number of modifications.
6 years ago
Marc-Antoine Ruel 18f5ca144b Rerun go generate ./...
Update the DO NOT EDIT line in
experimental/cmd/periph-web/static_prod.go to fit the regexp expected by
the go tool.
6 years ago
Balázs Grill 36bdd0caf4 pca9685: Added Full-on/off support, fixed scaling to 12 bits (#443)
* added sanity check to channel ID arguments
* Extracted init sequence in tests
* Fixed max duty constant
6 years ago
SystemGlitch 4f5701e9eb mfrc522: Add support for 7-bytes UUID (#442)
Add ReadUID example.
6 years ago
Marc-Antoine Ruel eff9c2ce8c travis: add go vet, addlicense checks; lower codecov threshold
- Temporarily disable caching of sources, it seems corrupted.
- Fix copyright on a few sources.
- Codecov is very aggressive about code coverage, reduce the
  expectations.
6 years ago
Marc-Antoine Ruel 6368ca5314 travis: rewrite the file; upgrade to Go 1.14.x
- Remove deprecated sudo:false
- Add missing os:linux and update to dist:bionic
- Update to go1.14.x
- Convert from matrix to jobs
- Reformat to try to make it slightly more readable

Fix a go formatting that crept in.
6 years ago
Marc-Antoine Ruel 816785ac40 Fix log silencing in tests
Tests were broken in Go 1.14.
6 years ago
Carl Henrik Lunde 8284066f76 epd/image2bit: e-paper 2 bit gray scale bit plane image format (#438)
Add image format with two bit planes as used by some waveshare e-Paper
devices.
6 years ago
Balázs Grill cadf2cf1f3 pca9685: added gpio pin API (#437) 6 years ago
Balázs Grill dffddf2e7e mcp23xxx: support for Microchip MCP23 family of IO extenders (#433)
Initial code for MCP23xxx support.
6 years ago
David Sansome 1f4a49516e inky: Minor cleanups: (#431)
* Use maxTxSize from conn.Limits
* Show an error instead of crashing on invalid pin names
6 years ago
David Sansome 189a8fc87a inky: Add wHAT support (#430)
* Fix white border color
* Add convenience functions DrawAll and SetModelColor
* Tidy up the initialisation code and apply bugfixes from the upstream
Python library
6 years ago
Marc-Antoine Ruel 71fdeecc9a hx711: implement pin.PinFunc
The interface pin.PinFunc will be merged into pin.Pin in v4.

Increase coverage to 84%.
7 years ago
Marc-Antoine Ruel 7c15fb5d1a ads1x15: implement pin.PinFunc
The interface pin.PinFunc will be merged into pin.Pin in v4.

Increase coverage to 85%.
7 years ago
Marc-Antoine Ruel 9bee0d93cb mpu9250: heavy doc cleaning.
No functional change but add a lot of TODOs.
7 years ago
Kevin Boulain 4439ce0673 pca9685: cleanup (#414)
Some nits from https://github.com/google/periph/pull/296.

The auto-increment capability of the device can simplify contiguous
writes.
7 years ago
Marc-Antoine Ruel d0a4be1156 travis: enable more of go vet shadow check
Now running:
  ! go vet -vettool=$(which shadow) ./... |& grep -v '"err"' | grep -e '^[^#]'

Which means that "err" aliasing is not checked, but others are. I may
enforce "err" aliasing later but it's more noisy so I'm not 100% sure
yet it's a good idea. Enforcing it for non-err variables looked like a
reasonable initial trade-off.
7 years ago
Marc-Antoine Ruel c01d9a6384 Reduce the number of golint comments.
Ran the following command:
    golint -min_confidence 0 ./... | grep -v ALL_CAPS | \
        grep -v underscores | grep -v 'another file'

and fixed the comments that made sense.
7 years ago
Marc-Antoine Ruel 6cd1bba854 travis: start using ineffassign
It actually found two bugs.
7 years ago
Marc-Antoine Ruel a50f826642 travis: start using misspell
- Otherwise typos continuously creep in.
- Fix misspellings found.
- Only run the binary check on 1.7.6, no need to run it everywhere.
7 years ago
Michael Traver ff89f66af2 mcp9808: Simplify bits to temperature conversions (#404)
- Converting the alert registers and the ambient temp register to a
  physic.Temperature can use the same procedure. Unify them and document
  why this is possible.
- Use != instead of > for bit checks
- Inline bitsToTemperature calls in SenseWithAlerts
7 years ago
Michael Traver e27c424b7b mcp9808: Fix conversions between temperature and bits (#403)
The datasheet (http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf)
says that negative temperatures are stored in two's complement. See
page 22 for alert registers and pages 24-25 for the ambient temperature
register.

However, the code currently assumes negative values are stored in a
sign-and-magnitude representation. Fix this to handle two's complement
values correctly.

For register bits to temperature conversion this implementation follows
the datasheet, but the code in the datasheet isn't quite right -- it
should be `temp - 256` instead of `256 - temp` -- but the fact that the
256 figure is in Microchip's code backs up the idea stated in the text
that negative values are in two's complement. Others seem to agree that
this is correct: https://electronics.stackexchange.com/a/244826

For temperature to bits conversion this implementation relies on the
fact that Go also uses two's complement. I've added a long comment in
the code about this.
7 years ago
Marc-Antoine Ruel cb7e526cec ccs811: update datasheet url
Add a product page, in case they break the PDF URL again.
7 years ago