Update to go1.17

Update dependencies
Update github actions
Ran gofmt
Fix one gosec warning
pull/54/head v3.7.0
Marc-Antoine Ruel 4 years ago
parent f454513a2a
commit eb0d2cc2b9

@ -3,18 +3,24 @@
# that can be found in the LICENSE file. # that can be found in the LICENSE file.
# References: # References:
# https://developer.github.com/webhooks/event-payloads/
# https://github.com/actions/cache
# https://github.com/actions/checkout # https://github.com/actions/checkout
# https://github.com/actions/setup-go # https://github.com/actions/setup-go
# https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#using-the-github_token-in-a-workflow # https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#using-the-github_token-in-a-workflow
# https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions/ # https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions/
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# https://docs.github.com/en/rest/commits/comments#create-a-commit-comment
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
# https://docs.github.com/en/actions/learn-github-actions/contexts
on: [push, pull_request] on: [push, pull_request]
name: Run tests name: Run tests
jobs: jobs:
test_all: # Runs go test both with code coverage sent to codecov, race detector and
# benchmarks. At the end do a quick check to ensure the tests to not leave
# files in the tree.
test:
name: "test: go${{matrix.gover}}.x/${{matrix.os}}"
runs-on: "${{matrix.os}}"
continue-on-error: true continue-on-error: true
defaults: defaults:
run: run:
@ -24,18 +30,89 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
# Do not forget to bump every 6 months! # Do not forget to bump every 6 months!
gover: ["1.17"] gover: ["1.19"]
runs-on: "${{matrix.os}}" env:
name: "go${{matrix.gover}}.x on ${{matrix.os}}" PYTHONDONTWRITEBYTECODE: x
steps: steps:
- name: Turn off git core.autocrlf
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-go@v3 - uses: actions/setup-go@v3
with: with:
go-version: "~${{matrix.gover}}.0" go-version: "~${{matrix.gover}}.0"
cache: true
- name: 'go install necessary tools'
if: always()
run: |
go install github.com/maruel/pat/cmd/ba@latest
- name: 'Check: go test -cover'
if: always()
run: go test -timeout=120s -covermode=count -coverprofile coverage.txt -bench=. -benchtime=1x ./...
# Don't send code coverage if anything failed to reduce spam.
- uses: codecov/codecov-action@v2
- name: 'Cleanup'
if: always()
run: rm coverage.txt
- name: 'Check: go test -race'
run: go test -timeout=120s -race -bench=. -benchtime=1x ./...
- name: 'Check: benchmark 📈'
run: ba -against HEAD~1
- name: 'Check: go test -short (CGO_ENABLED=0)'
env:
CGO_ENABLED: 0
run: go test -timeout=120s -short -bench=. -benchtime=1x ./...
- name: 'Check: go test -short (32 bits)'
if: matrix.os != 'macos-latest'
env:
GOARCH: 386
run: go test -timeout=120s -short -bench=. -benchtime=1x ./...
- name: "Check: tree is clean"
if: always()
run: |
# Nothing should have changed in the tree up to that point and no
# unsuspected file was created.
TOUCHED=$(git status --porcelain --ignored)
if ! test -z "$TOUCHED"; then
echo "Oops, something touched these files, please cleanup:"
echo "$TOUCHED"
git diff
false
fi
# Checkout and print debugging information.
# Run linters. This workflow can be merged with the test_all one if desired
# to cut on runtime, at the cost of latency. I dislike waiting for results
# so I prefer to run them in parallel.
lint:
name: "lint: go${{matrix.gover}}.x/${{matrix.os}}"
runs-on: "${{matrix.os}}"
continue-on-error: true
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
# You may want to run only on linux to save on cost. Projects with
# OS-specific code benefits from explicitly linting on macOS and
# Windows.
os: [ubuntu-latest, macos-latest, windows-latest]
# Do not forget to bump every 6 months!
gover: ["1.19"]
env:
PYTHONDONTWRITEBYTECODE: x
steps:
- name: Turn off git core.autocrlf - name: Turn off git core.autocrlf
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false run: git config --global core.autocrlf false
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "~${{matrix.gover}}.0"
cache: true
- name: "Debug" - name: "Debug"
run: | run: |
echo HOME = $HOME echo HOME = $HOME
@ -44,31 +121,23 @@ jobs:
echo "" echo ""
echo $ ls -l $HOME/go/bin echo $ ls -l $HOME/go/bin
ls -la $HOME/go/bin ls -la $HOME/go/bin
- name: 'Cache: ~/go'
uses: actions/cache@v2
with:
path: ~/go
key: "${{runner.os}}-gopkg-${{hashFiles('go.sum', '.github/workflows/*.yml')}}"
# Fetch the tools before checking out, so they don't modify go.mod/go.sum.
- name: 'go install necessary tools' - name: 'go install necessary tools'
if: always()
run: | run: |
go install -v github.com/gordonklaus/ineffassign@latest go install github.com/gordonklaus/ineffassign@latest
go install -v github.com/securego/gosec/cmd/gosec@latest go install github.com/securego/gosec/v2/cmd/gosec@latest
go install -v golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go install -v honnef.co/go/tools/cmd/staticcheck@latest go install honnef.co/go/tools/cmd/staticcheck@latest
- name: 'go install necessary tools (ubuntu)' - name: 'go install necessary tools (ubuntu)'
if: always() && matrix.os == 'ubuntu-latest' if: always() && matrix.os == 'ubuntu-latest'
run: | run: |
go install -v github.com/client9/misspell/cmd/misspell@latest go install github.com/client9/misspell/cmd/misspell@latest
go install -v github.com/google/addlicense@latest go install github.com/google/addlicense@latest
# Now run proper checks.
- name: 'Check: go vet' - name: 'Check: go vet'
if: always() if: always()
run: go vet ./... run: go vet -unsafeptr=false ./...
- name: 'Check: go vet shadow; shadowed variables' - name: 'Check: go vet shadow; shadowed variables'
if: always()
run: | run: |
SHADOW_TOOL="$(which shadow)" SHADOW_TOOL="$(which shadow)"
if [ -f "${SHADOW_TOOL}.exe" ]; then if [ -f "${SHADOW_TOOL}.exe" ]; then
@ -80,19 +149,23 @@ jobs:
run: ineffassign ./... run: ineffassign ./...
- name: 'Check: staticcheck' - name: 'Check: staticcheck'
if: always() if: always()
# SA1019: Foo is deprecated
run: staticcheck -checks inherit,-SA1019 ./... run: staticcheck -checks inherit,-SA1019 ./...
- name: 'Check: gosec (only G104)' - name: 'Check: gosec'
run: gosec -include=G104 -fmt=golint -quiet ./... if: always()
run: gosec -fmt=golint -quiet ./...
# The following checks are not dependent on the OS or go build tags. Only # The following checks are not dependent on the OS or go build tags. Only
# run them on ubuntu-latest since it's the fastest one. # run them on ubuntu-latest since it's the fastest one.
- name: 'Check: no executable was committed (ubuntu)' - name: 'Check: no executable was committed (ubuntu)'
if: always() && matrix.os == 'ubuntu-latest' if: always() && matrix.os == 'ubuntu-latest'
run: | run: |
if find . -path '*.sh' -prune -o -path ./.git -prune -o -type f -executable -print | grep -e . ; then if find . -path ./.git -prune -o -type f -executable -print | grep -e . ; then
echo 'Do not commit executables beside shell scripts' echo 'Do not commit executables'
false false
fi fi
- name: 'Check: addlicense; all sources have a license header (ubuntu)'
if: always() && matrix.os == 'ubuntu-latest'
run: addlicense -check .
- name: 'Check: gofmt; code is well formatted (ubuntu)' - name: 'Check: gofmt; code is well formatted (ubuntu)'
if: always() && matrix.os == 'ubuntu-latest' if: always() && matrix.os == 'ubuntu-latest'
run: | run: |
@ -104,67 +177,54 @@ jobs:
echo "- ${FILE}" >> _gofmt.txt echo "- ${FILE}" >> _gofmt.txt
done done
cat _gofmt.txt cat _gofmt.txt
echo "## ⚠ gofmt Failed" >> _comments.txt echo "## ⚠ gofmt Failed" >> ../_comments.txt
echo "" >> _comments.txt echo "" >> ../_comments.txt
cat _gofmt.txt >> _comments.txt cat _gofmt.txt >> ../_comments.txt
echo "" >> _comments.txt echo "" >> ../_comments.txt
false false
fi fi
- name: 'Check: addlicense; all sources have a license header (ubuntu)'
if: always() && matrix.os == 'ubuntu-latest'
run: addlicense -check .
- name: "Check: misspelling; code doesn't contain misspelling (ubuntu)" - name: "Check: misspelling; code doesn't contain misspelling (ubuntu)"
if: always() && matrix.os == 'ubuntu-latest' if: always() && matrix.os == 'ubuntu-latest'
run: | run: |
ERR=$(misspell .) ERR=$(misspell .)
if ! test -z "$ERR"; then if ! test -z "$ERR"; then
echo "$ERR" echo "$ERR"
echo "## ⚠ misspell Failed" >> _comments.txt echo "## ⚠ misspell Failed" >> ../_comments.txt
echo "" >> _comments.txt echo "" >> ../_comments.txt
echo "$ERR" >> _comments.txt echo "$ERR" >> ../_comments.txt
echo "" >> _comments.txt echo "" >> ../_comments.txt
false false
fi fi
- name: 'Send comments'
# Run tests last since it's potentially the slowest step. if: failure()
- name: 'Check: go test -cover'
run: go test -timeout=40s -covermode=count -coverprofile coverage.txt ./...
# Don't send code coverage if anything failed to reduce spam.
- uses: codecov/codecov-action@v2
- name: 'Cleanup'
run: rm coverage.txt
# Don't run go test -race if anything failed, to speed up the results.
- name: 'Check: go test -race'
run: go test -timeout=60s -race ./...
- name: 'Check: go test -bench .'
run: go test -timeout=40s -bench . -benchtime=100ms -cpu=1 ./...
- name: 'Check: CGO_ENABLED=0 go test -short'
run: CGO_ENABLED=0 go test -timeout=40s -short ./...
- name: "Check: tree is clean"
run: | run: |
# Nothing should have changed in the tree up to that point and no if [ -f ../_comments.txt ]; then
# unsuspected file was created. URL="${{github.event.issue.pull_request.url}}"
TOUCHED=$(git status --porcelain --ignored) if test -z "$URL"; then
if ! test -z "$TOUCHED"; then URL="${{github.api_url}}/repos/${{github.repository}}/commits/${{github.sha}}/comments"
echo "Oops, something touched these files, please cleanup:" fi
echo "$TOUCHED" echo "Sending $(cat ../_comments.txt|wc -l) lines of comments to ${URL}"
git diff curl -sS --request POST \
false --header "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" \
--header "Content-Type: application/json" \
--data "$(cat ../_comments.txt | jq -R --slurp '{body: .}')" \
"${URL}" > /dev/null
rm ../_comments.txt
fi fi
- name: "Check: go generate doesn't modify files" - name: "Check: go generate doesn't modify files"
if: always()
run: | run: |
go generate ./... go generate ./...
# Also test for untracked files. # Also test for untracked files. go generate should not generate ignored
# files either.
TOUCHED=$(git status --porcelain --ignored) TOUCHED=$(git status --porcelain --ignored)
if ! test -z "$TOUCHED"; then if ! test -z "$TOUCHED"; then
echo "go generate created these files, please fix:" echo "go generate created these files, please fix:"
echo "$TOUCHED" echo "$TOUCHED"
false false
fi fi
- name: "Check: go mod tidy doesn't modify files" - name: "Check: go mod tidy doesn't modify files"
if: always()
run: | run: |
go mod tidy go mod tidy
TOUCHED=$(git status --porcelain --ignored) TOUCHED=$(git status --porcelain --ignored)
@ -173,7 +233,6 @@ jobs:
git diff git diff
false false
fi fi
- name: 'Test on periph.io/x/cmd' - name: 'Test on periph.io/x/cmd'
# Force an upgrade to test cmd with tip of tree devices. # Force an upgrade to test cmd with tip of tree devices.
run: | run: |
@ -184,32 +243,60 @@ jobs:
go get -t ./... go get -t ./...
go test -short ./... go test -short ./...
- name: 'Send comments'
if: failure() && github.event_name == 'pull_request'
run: |
if [ -f _comments.txt ]; then
URL=$(cat ${GITHUB_EVENT_PATH} | jq -r .pull_request.comments_url)
echo "Sending $(cat _comments.txt|wc -l) lines of comments to ${URL}"
PAYLOAD=$(echo '{}' | jq --arg body "$(cat _comments.txt)" '.body = $body')
curl -sS --request POST \
--header "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" \
--header "Content-Type: application/json" \
--data "${PAYLOAD}" "${URL}" > /dev/null
fi
test_short: # Ensure tests pass on oldest supported Go version.
old:
name: "test: go${{matrix.gover}}/${{matrix.os}}"
runs-on: "${{matrix.os}}"
continue-on-error: true continue-on-error: true
defaults:
run:
shell: bash
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
gover: ['1.14.15'] # https://github.com/golang/go/issues/55078
runs-on: "${{matrix.os}}" # golang.org/x/sys/unix broke on Go versions before 1.17. Not worth
name: "go${{matrix.gover}} on ${{matrix.os}} (quick)" # fixing.
gover: ['1.17.13']
env:
PYTHONDONTWRITEBYTECODE: x
steps: steps:
- uses: actions/setup-go@v2 - name: Turn off git core.autocrlf
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with: with:
go-version: "${{matrix.gover}}" go-version: "=${{matrix.gover}}"
- uses: actions/checkout@v2
- name: 'Check: go test' - name: 'Check: go test'
run: go test -timeout=40s ./... run: go test -timeout=120s -bench=. -benchtime=1x ./...
codeql:
name: "codeql: go${{matrix.gover}}.x/${{matrix.os}}"
runs-on: "${{matrix.os}}"
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# Do not forget to bump every 6 months!
gover: ["1.19"]
permissions:
security-events: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "~${{matrix.gover}}.0"
cache: true
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

@ -5,7 +5,7 @@
// Package ads1x15 controls ADS1015/ADS1115 Analog-Digital Converters (ADC) via // Package ads1x15 controls ADS1015/ADS1115 Analog-Digital Converters (ADC) via
// I²C interface. // I²C interface.
// //
// Datasheet // # Datasheet
// //
// ADS1015: http://www.ti.com/product/ADS1015 // ADS1015: http://www.ti.com/product/ADS1015
// //

@ -11,11 +11,11 @@
// This driver handles color intensity and temperature correction and uses the // This driver handles color intensity and temperature correction and uses the
// full near 8000:1 dynamic range as supported by the device. // full near 8000:1 dynamic range as supported by the device.
// //
// More details // # More details
// //
// See https://periph.io/device/apa102/ for more details about the device. // See https://periph.io/device/apa102/ for more details about the device.
// //
// Datasheet // # Datasheet
// //
// https://cpldcpu.files.wordpress.com/2014/08/apa-102c-super-led-specifications-2014-en.pdf // https://cpldcpu.files.wordpress.com/2014/08/apa-102c-super-led-specifications-2014-en.pdf
package apa102 package apa102

@ -85,17 +85,17 @@ func (s Spectrum) String() string {
// Band has two types of measurement of relative spectral flux density. // Band has two types of measurement of relative spectral flux density.
// //
// Value // # Value
// //
// Value are the calibrated readings. The accuracy of the channel counts/μW/cm2 // Value are the calibrated readings. The accuracy of the channel counts/μW/cm2
// is ±12%. // is ±12%.
// //
// Counts // # Counts
// //
// Counts are the raw readings, there are approximately 45 counts/μW/cm2 with a // Counts are the raw readings, there are approximately 45 counts/μW/cm2 with a
// gain of 16 (Gx16). // gain of 16 (Gx16).
// //
// Wavelength // # Wavelength
// //
// Wavelength is the nominal center of a band, with a ±40nm bandwidth around the // Wavelength is the nominal center of a band, with a ±40nm bandwidth around the
// center. Wavelengths for the as7262 are: 450nm, 500nm, 550nm, 570nm, 600nm and // center. Wavelengths for the as7262 are: 450nm, 500nm, 550nm, 570nm, 600nm and
@ -114,13 +114,13 @@ func (b Band) String() string {
// Sense preforms a reading of relative spectral radiance of all the sensor // Sense preforms a reading of relative spectral radiance of all the sensor
// bands. // bands.
// //
// Led Drive Current // # Led Drive Current
// //
// The AS7262 provides a current-limited integrated led drive circuit. Valid // The AS7262 provides a current-limited integrated led drive circuit. Valid
// limits for the drive current are 0mA, 12.5mA, 25mA, 50mA and 100mA. If non // limits for the drive current are 0mA, 12.5mA, 25mA, 50mA and 100mA. If non
// valid values are given the next lowest valid value is used. // valid values are given the next lowest valid value is used.
// //
// Resolution // # Resolution
// //
// For best resolution it is recommended that for a specific led drive // For best resolution it is recommended that for a specific led drive
// current that the senseTime or gain is increased until at least one of the // current that the senseTime or gain is increased until at least one of the

@ -6,7 +6,7 @@
// interface. The as7262 features 6 spectral channels spaced at 450, 500, 550, // interface. The as7262 features 6 spectral channels spaced at 450, 500, 550,
// 570, 600, 650 nm and includes 2 integrated LED drivers. // 570, 600, 650 nm and includes 2 integrated LED drivers.
// //
// Datasheet // # Datasheet
// //
// https://ams.com/documents/20143/36005/AS7262_DS000486_2-00.pdf // https://ams.com/documents/20143/36005/AS7262_DS000486_2-00.pdf
package as7262 package as7262

@ -4,7 +4,7 @@
// Package bh1750 controls a ROHM BH1750 ambient light sensor, over an i2c bus. // Package bh1750 controls a ROHM BH1750 ambient light sensor, over an i2c bus.
// //
// Datasheet // # Datasheet
// //
// http://cpre.kmutnb.ac.th/esl/learning/bh1750-light-sensor/bh1750fvi-e_datasheet.pdf // http://cpre.kmutnb.ac.th/esl/learning/bh1750-light-sensor/bh1750fvi-e_datasheet.pdf
package bh1750 package bh1750

@ -5,11 +5,11 @@
// Package bmxx80 controls a Bosch BMP180/BME280/BMP280 device over I²C, or SPI // Package bmxx80 controls a Bosch BMP180/BME280/BMP280 device over I²C, or SPI
// for the BMx280. // for the BMx280.
// //
// More details // # More details
// //
// See https://periph.io/device/bmxx80/ for more details about the device. // See https://periph.io/device/bmxx80/ for more details about the device.
// //
// Datasheets // # Datasheets
// //
// The URLs tend to rot, visit https://www.bosch-sensortec.com if they become // The URLs tend to rot, visit https://www.bosch-sensortec.com if they become
// invalid. // invalid.
@ -28,7 +28,7 @@
// //
// https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf // https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf
// //
// Notes on the BMP180 datasheet // # Notes on the BMP180 datasheet
// //
// The results of the calculations in the algorithm on page 15 are partly // The results of the calculations in the algorithm on page 15 are partly
// wrong. It looks like the original authors used non-integer calculations and // wrong. It looks like the original authors used non-integer calculations and

@ -9,7 +9,7 @@
// The cap1xxx devices are a 3/5/6/8/14 channel capacitive touch sensor with // The cap1xxx devices are a 3/5/6/8/14 channel capacitive touch sensor with
// 2/3/6/8/11 LED drivers. // 2/3/6/8/11 LED drivers.
// //
// Datasheet // # Datasheet
// //
// 3 sensors, 3 LEDs: // 3 sensors, 3 LEDs:
// http://ww1.microchip.com/downloads/en/DeviceDoc/CAP1133.pdf // http://ww1.microchip.com/downloads/en/DeviceDoc/CAP1133.pdf

@ -294,6 +294,7 @@ func (d *Dev) SetBaseline(baseline []byte) error {
// Sensing resistor's current is between 0-63uA, and voltage 0-1.65V. // Sensing resistor's current is between 0-63uA, and voltage 0-1.65V.
// //
// Status represents sensor's status register. // Status represents sensor's status register.
//
// 1001 0110 // 1001 0110
// ||||||||| // |||||||||
// ||||||| \- 1 = There is an error. // ||||||| \- 1 = There is an error.

@ -5,11 +5,11 @@
// Package ccs811 controls CCS811 Volatile Organic Compounds sensor via // Package ccs811 controls CCS811 Volatile Organic Compounds sensor via
// I²C interface. // I²C interface.
// //
// Product page // # Product page
// //
// https://ams.com/ccs811 // https://ams.com/ccs811
// //
// Datasheet // # Datasheet
// //
// https://ams.com/documents/20143/36005/CCS811_DS000459_7-00.pdf // https://ams.com/documents/20143/36005/CCS811_DS000459_7-00.pdf
package ccs811 package ccs811

@ -14,11 +14,11 @@
// The DS18B20/DS18S20 alarm functionality and reading/writing the 2 alarm // The DS18B20/DS18S20 alarm functionality and reading/writing the 2 alarm
// bytes in the EEPROM are not supported. // bytes in the EEPROM are not supported.
// //
// More details // # More details
// //
// See https://periph.io/device/ds18b20/ for more details about the device. // See https://periph.io/device/ds18b20/ for more details about the device.
// //
// Datasheets // # Datasheets
// //
// https://datasheets.maximintegrated.com/en/ds/DS18B20-PAR.pdf // https://datasheets.maximintegrated.com/en/ds/DS18B20-PAR.pdf
// //

@ -5,11 +5,11 @@
// Package ds248x controls a Maxim DS2483 or DS2482-100 1-wire interface chip // Package ds248x controls a Maxim DS2483 or DS2482-100 1-wire interface chip
// over I²C. // over I²C.
// //
// More details // # More details
// //
// See https://periph.io/device/ds248x/ for more details about the device. // See https://periph.io/device/ds248x/ for more details about the device.
// //
// Datasheets // # Datasheets
// //
// https://www.maximintegrated.com/en/products/digital/one-wire/DS2483.html // https://www.maximintegrated.com/en/products/digital/one-wire/DS2483.html
// //

@ -4,9 +4,9 @@
// Package epd controls Waveshare e-paper series displays. // Package epd controls Waveshare e-paper series displays.
// //
// More details // # More details
// //
// Datasheets // # Datasheets
// //
// https://www.waveshare.com/w/upload/e/e6/2.13inch_e-Paper_Datasheet.pdf // https://www.waveshare.com/w/upload/e/e6/2.13inch_e-Paper_Datasheet.pdf
// //

@ -4,14 +4,19 @@
module periph.io/x/devices/v3 module periph.io/x/devices/v3
go 1.14 go 1.17
require ( require (
github.com/google/go-cmp v0.5.6 github.com/google/go-cmp v0.5.9
github.com/maruel/ansi256 v1.0.2 github.com/maruel/ansi256 v1.0.2
github.com/mattn/go-colorable v0.1.12 github.com/mattn/go-colorable v0.1.13
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 golang.org/x/image v0.1.0
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect periph.io/x/conn/v3 v3.7.0
periph.io/x/conn/v3 v3.6.10 periph.io/x/host/v3 v3.8.0
periph.io/x/host/v3 v3.7.2 )
require (
github.com/jonboulle/clockwork v0.3.0 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
golang.org/x/sys v0.1.0 // indirect
) )

@ -1,25 +1,44 @@
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg=
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
github.com/maruel/ansi256 v1.0.2 h1:AE5gYrrZ5vQaFTTwy5vxva8Bak7p7wID3Uqu3t1j3No= github.com/maruel/ansi256 v1.0.2 h1:AE5gYrrZ5vQaFTTwy5vxva8Bak7p7wID3Uqu3t1j3No=
github.com/maruel/ansi256 v1.0.2/go.mod h1:x7uow2KFkUgjdzvYHyfZuMEOTGKvCYLyVUHIVg1vYic= github.com/maruel/ansi256 v1.0.2/go.mod h1:x7uow2KFkUgjdzvYHyfZuMEOTGKvCYLyVUHIVg1vYic=
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/image v0.1.0 h1:r8Oj8ZA2Xy12/b5KZYj3tuv7NG/fBz3TwQVvpJ9l8Rk=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk= golang.org/x/image v0.1.0/go.mod h1:iyPr49SD/G/TBxYVB/9RRtGUT5eNbo2u4NamWeQcD5c=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
periph.io/x/conn/v3 v3.6.10 h1:gwU4ssmZkq1D/uz8hU91i/COo2c9DrRaS4PJZBbCd+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
periph.io/x/conn/v3 v3.6.10/go.mod h1:UqWNaPMosWmNCwtufoTSTTYhB2wXWsMRAJyo1PlxO4Q= periph.io/x/conn/v3 v3.7.0 h1:f1EXLn4pkf7AEWwkol2gilCNZ0ElY+bxS4WE2PQXfrA=
periph.io/x/d2xx v0.0.4/go.mod h1:38Euaaj+s6l0faIRHh32a+PrjXvxFTFkPBEQI0TKg34= periph.io/x/conn/v3 v3.7.0/go.mod h1:ypY7UVxgDbP9PJGwFSVelRRagxyXYfttVh7hJZUHEhg=
periph.io/x/host/v3 v3.7.2 h1:rCAUxkzy2xrzh18HP2AoVwTL/fEKqmcJ1icsZQGM58Q= periph.io/x/d2xx v0.1.0/go.mod h1:OflHQcWZ4LDP/2opGYbdXSP/yvWSnHVFO90KRoyobWY=
periph.io/x/host/v3 v3.7.2/go.mod h1:nHMlzkPwmnHyP9Tn0I8FV+e0N3K7TjFXLZkIWzAicog= periph.io/x/host/v3 v3.8.0 h1:T5ojZ2wvnZHGPS4h95N2ZpcCyHnsvH3YRZ1UUUiv5CQ=
periph.io/x/host/v3 v3.8.0/go.mod h1:rzOLH+2g9bhc6pWZrkCrmytD4igwQ2vxFw6Wn6ZOlLY=

@ -4,7 +4,7 @@
// Package hd44780 controls the Hitachi LCD display chipset HD-44780 // Package hd44780 controls the Hitachi LCD display chipset HD-44780
// //
// Datasheet // # Datasheet
// //
// https://www.sparkfun.com/datasheets/LCD/HD44780.pdf // https://www.sparkfun.com/datasheets/LCD/HD44780.pdf
package hd44780 package hd44780
@ -33,6 +33,7 @@ type Dev struct {
} }
// New creates and initializes the LCD device // New creates and initializes the LCD device
//
// data - references to data pins // data - references to data pins
// rs - rs pin // rs - rs pin
// e - strobe pin // e - strobe pin
@ -88,6 +89,7 @@ func (r *Dev) Halt() error {
} }
// SetCursor positions the cursor // SetCursor positions the cursor
//
// line - screen line, 0-based // line - screen line, 0-based
// column - column, 0-based // column - column, 0-based
func (r *Dev) SetCursor(line uint8, column uint8) error { func (r *Dev) SetCursor(line uint8, column uint8) error {
@ -95,6 +97,7 @@ func (r *Dev) SetCursor(line uint8, column uint8) error {
} }
// Print the data string // Print the data string
//
// data string to display // data string to display
func (r *Dev) Print(data string) error { func (r *Dev) Print(data string) error {
for _, v := range []byte(data) { for _, v := range []byte(data) {
@ -106,6 +109,7 @@ func (r *Dev) Print(data string) error {
} }
// WriteChar writes a single byte (character) at the cursor position. // WriteChar writes a single byte (character) at the cursor position.
//
// data - character code // data - character code
func (r *Dev) WriteChar(data uint8) error { func (r *Dev) WriteChar(data uint8) error {
if err := r.sendData(); err != nil { if err := r.sendData(); err != nil {

@ -4,13 +4,13 @@
// Package ht16k33 implements interfacing code to Holtek HT16K33 Alphanumeric 16x8 LED driver. // Package ht16k33 implements interfacing code to Holtek HT16K33 Alphanumeric 16x8 LED driver.
// //
// More Details // # More Details
// //
// Datasheets // # Datasheets
// //
// http://www.holtek.com/documents/10179/116711/HT16K33v120.pdf // http://www.holtek.com/documents/10179/116711/HT16K33v120.pdf
// //
// Product Page // # Product Page
// //
// http://www.holtek.com/productdetail/-/vg/HT16K33 // http://www.holtek.com/productdetail/-/vg/HT16K33
package ht16k33 package ht16k33

@ -5,7 +5,7 @@
// Package hx711 implements an interface to the 24-bits HX711 analog to digital // Package hx711 implements an interface to the 24-bits HX711 analog to digital
// converter. // converter.
// //
// Datasheet // # Datasheet
// //
// http://www.aviaic.com/Download/hx711F_EN.pdf.pdf // http://www.aviaic.com/Download/hx711F_EN.pdf.pdf
package hx711 package hx711

@ -5,13 +5,13 @@
// Package ina219 controls a Texas Instruments ina219 high side current, // Package ina219 controls a Texas Instruments ina219 high side current,
// voltage and power monitor IC over an i2c bus. // voltage and power monitor IC over an i2c bus.
// //
// Calibration // # Calibration
// //
// Calibration is recommended for accurate current and power measurements. // Calibration is recommended for accurate current and power measurements.
// Voltage measurements do not require sensor calibration. To calibrate, measure // Voltage measurements do not require sensor calibration. To calibrate, measure
// the actual value of the shunt resistor. // the actual value of the shunt resistor.
// //
// Datasheet // # Datasheet
// //
// http://www.ti.com/lit/ds/symlink/ina219.pdf // http://www.ti.com/lit/ds/symlink/ina219.pdf
package ina219 package ina219

@ -17,7 +17,7 @@ import (
// Opts holds the configuration options. // Opts holds the configuration options.
// //
// Slave Address // # Slave Address
// //
// Depending which pins the A1, A0 pins are connected to will change the slave // Depending which pins the A1, A0 pins are connected to will change the slave
// address. Default configuration is address 0x40 (both pins to GND). For a full // address. Default configuration is address 0x40 (both pins to GND). For a full

@ -4,7 +4,7 @@
// Package inky drives an Inky pHAT, pHAT v2 or wHAT E ink display. // Package inky drives an Inky pHAT, pHAT v2 or wHAT E ink display.
// //
// Datasheet // # Datasheet
// //
// Inky lacks a true datasheet, so the code here is derived from the reference // Inky lacks a true datasheet, so the code here is derived from the reference
// implementation by Pimoroni: // implementation by Pimoroni:

@ -148,7 +148,6 @@ func New(i i2c.Bus) (*Dev, error) {
// Dev is the Lepton specific Command and Control Interface (CCI). // Dev is the Lepton specific Command and Control Interface (CCI).
// //
//
// Dev can safely accessed concurrently via multiple goroutines. // Dev can safely accessed concurrently via multiple goroutines.
// //
// This interface is accessed via I²C and provides access to view and modify // This interface is accessed via I²C and provides access to view and modify

@ -8,7 +8,7 @@
// This protocol controls and queries the camera but is not used to read the // This protocol controls and queries the camera but is not used to read the
// images. // images.
// //
// Datasheet // # Datasheet
// //
// https://www.flir.com/globalassets/imported-assets/document/flir-lepton-software-interface-description-document.pdf // https://www.flir.com/globalassets/imported-assets/document/flir-lepton-software-interface-description-document.pdf
package cci package cci

@ -4,11 +4,11 @@
// Package lepton drives a FLIR Lepton Infra Red (IR) camera. // Package lepton drives a FLIR Lepton Infra Red (IR) camera.
// //
// More details // # More details
// //
// See https://periph.io/device/lepton/ for more details about the device. // See https://periph.io/device/lepton/ for more details about the device.
// //
// Datasheet // # Datasheet
// //
// https://www.flir.com/globalassets/imported-assets/document/lepton-engineering-datasheet---with-radiometry.pdf // https://www.flir.com/globalassets/imported-assets/document/lepton-engineering-datasheet---with-radiometry.pdf
package lepton package lepton

@ -5,7 +5,7 @@
// Package lirc implements InfraRed receiver support through native linux app // Package lirc implements InfraRed receiver support through native linux app
// lirc. // lirc.
// //
// More details // # More details
// //
// See https://periph.io/device/ir/ for more details about the driver, as it // See https://periph.io/device/ir/ for more details about the driver, as it
// requires host configuration. // requires host configuration.

@ -4,7 +4,7 @@
// Package mcp23xxx provides driver for the MCP23 family of IO extenders // Package mcp23xxx provides driver for the MCP23 family of IO extenders
// //
// Datasheet // # Datasheet
// //
// https://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf // https://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf
package mcp23xxx package mcp23xxx

@ -4,7 +4,7 @@
// Package mcp9808 controls a Microchip MCP9808 digital I²C temperature sensor. // Package mcp9808 controls a Microchip MCP9808 digital I²C temperature sensor.
// //
// Features // # Features
// //
// -40°C and +125°C Operating Range. // -40°C and +125°C Operating Range.
// //
@ -12,7 +12,7 @@
// //
// User-Programmable Temperature Alerts. // User-Programmable Temperature Alerts.
// //
// Datasheet // # Datasheet
// //
// http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf // http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf
package mcp9808 package mcp9808

@ -18,7 +18,7 @@ import (
// Opts holds the configuration options. // Opts holds the configuration options.
// //
// Slave Address // # Slave Address
// //
// Depending which pins the A0, A1 and A2 pins are connected to will change the // Depending which pins the A0, A1 and A2 pins are connected to will change the
// slave address. Default configuration is address 0x18 (Ax pins to GND). For a // slave address. Default configuration is address 0x18 (Ax pins to GND). For a

@ -4,7 +4,7 @@
// Package mfrc522 controls a Mifare RFID card reader. // Package mfrc522 controls a Mifare RFID card reader.
// //
// Datasheet // # Datasheet
// //
// https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf // https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
package mfrc522 package mfrc522

@ -4,7 +4,7 @@
// Package mfrc522 controls a Mifare RFID card reader. // Package mfrc522 controls a Mifare RFID card reader.
// //
// Datasheet // # Datasheet
// //
// https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf // https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
package mfrc522 package mfrc522

@ -22,6 +22,7 @@ func fromBitString(t *testing.T, s string) (res byte) {
/* /*
C1 C2 C3 C1 C2 C3
3 : 1 0 0 3 : 1 0 0
2 : 0 0 1 2 : 0 0 1
1 : 1 0 1 1 : 1 0 1
@ -78,12 +79,12 @@ func TestBitCalc(t *testing.T) {
/* /*
C1 C2 C3 C1 C2 C3
3 : 0 0 1 3 : 0 0 1
2 : 0 0 0 2 : 0 0 0
1 : 0 0 0 1 : 0 0 0
0 : 0 0 0 0 : 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1
1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0

@ -4,7 +4,7 @@
// Package mpu9250 MPU-9250 is a 9-axis MotionTracking device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer and a Digital Motion Processor™ (DMP) // Package mpu9250 MPU-9250 is a 9-axis MotionTracking device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer and a Digital Motion Processor™ (DMP)
// //
// Datasheet // # Datasheet
// //
// https://www.invensense.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf // https://www.invensense.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf
// https://www.invensense.com/wp-content/uploads/2015/02/MPU-9250-Register-Map.pdf // https://www.invensense.com/wp-content/uploads/2015/02/MPU-9250-Register-Map.pdf

@ -18,14 +18,14 @@
// You may also need to increase your SPI buffer size to 12*num_pixels+3, or just max it out // You may also need to increase your SPI buffer size to 12*num_pixels+3, or just max it out
// with `spidev.bufsize=65536`. That should allopw you to buffer over 5400 Neopixels. // with `spidev.bufsize=65536`. That should allopw you to buffer over 5400 Neopixels.
// //
// Datasheet // # Datasheet
// //
// This directory contains datasheets for ws2812, ws2812b, ucs190x and various // This directory contains datasheets for ws2812, ws2812b, ucs190x and various
// sk6812. // sk6812.
// //
// https://github.com/cpldcpu/light_ws2812/tree/master/Datasheets // https://github.com/cpldcpu/light_ws2812/tree/master/Datasheets
// //
// UCS1903 datasheet // # UCS1903 datasheet
// //
// http://www.bestlightingbuy.com/pdf/UCS1903%20datasheet.pdf // http://www.bestlightingbuy.com/pdf/UCS1903%20datasheet.pdf
// //

@ -6,14 +6,12 @@
// from multiple vendors. The main features of this multiplexer is that its has // from multiple vendors. The main features of this multiplexer is that its has
// 8 channels and is capable of voltage level translation. // 8 channels and is capable of voltage level translation.
// //
// // # Adjusting the Bus CLK
// Adjusting the Bus CLK
// //
// The bus clock is slaved to the master bus clock, different clock for each // The bus clock is slaved to the master bus clock, different clock for each
// port is currently not supported. The Maximum clock for this device is 400kHz. // port is currently not supported. The Maximum clock for this device is 400kHz.
// //
// // # Datasheet
// Datasheet
// //
// https://www.nxp.com/docs/en/data-sheet/PCA9548A.pdf // https://www.nxp.com/docs/en/data-sheet/PCA9548A.pdf
package pca9548 package pca9548

@ -4,9 +4,9 @@
// Package pca9685 includes utilities to controls pca9685 module and servo motors. // Package pca9685 includes utilities to controls pca9685 module and servo motors.
// //
// More details // # More details
// //
// Datasheet // # Datasheet
// //
// https://www.nxp.com/docs/en/data-sheet/PCA9685.pdf // https://www.nxp.com/docs/en/data-sheet/PCA9685.pdf
// //

@ -10,7 +10,7 @@
// TODO(maruel): "dtoverlay=pwm" or "dtoverlay=pwm-2chan" works without having // TODO(maruel): "dtoverlay=pwm" or "dtoverlay=pwm-2chan" works without having
// to install anything, albeit with less pins supported. // to install anything, albeit with less pins supported.
// //
// Warning // # Warning
// //
// piblaster doesn't report what pins is controls so it is easy to misuse this // piblaster doesn't report what pins is controls so it is easy to misuse this
// library. // library.
@ -56,7 +56,7 @@ var piblasterHandle io.WriteCloser
func openPiblaster() error { func openPiblaster() error {
if piblasterHandle == nil { if piblasterHandle == nil {
f, err := os.OpenFile("/dev/pi-blaster", os.O_WRONLY|os.O_APPEND, 0644) f, err := os.OpenFile("/dev/pi-blaster", os.O_WRONLY|os.O_APPEND, 0600)
if err != nil { if err != nil {
return err return err
} }

@ -20,9 +20,9 @@
// //
// Servo header (PWM) // Servo header (PWM)
// //
// More details // # More details
// //
// Product Page // # Product Page
// //
// https://shop.pimoroni.com/products/rainbow-hat-for-android-things // https://shop.pimoroni.com/products/rainbow-hat-for-android-things
package rainbowhat package rainbowhat

@ -4,7 +4,7 @@
// Package sn3218 controls a SN3218 LED driver with 18 LEDs over an i2c bus. // Package sn3218 controls a SN3218 LED driver with 18 LEDs over an i2c bus.
// //
// Datasheet // # Datasheet
// //
// http://www.si-en.com/uploadpdf/s2011517171720.pdf // http://www.si-en.com/uploadpdf/s2011517171720.pdf
package sn3218 package sn3218

@ -18,11 +18,11 @@
// High. When set to Low (Ground), it enables the reset circuitry. It can be // High. When set to Low (Ground), it enables the reset circuitry. It can be
// used externally to this driver, if used, the driver must be reinstantiated. // used externally to this driver, if used, the driver must be reinstantiated.
// //
// More details // # More details
// //
// See https://periph.io/device/ssd1306/ for more details about the device. // See https://periph.io/device/ssd1306/ for more details about the device.
// //
// Datasheets // # Datasheets
// //
// Product page: // Product page:
// http://www.solomon-systech.com/en/product/display-ic/oled-driver-controller/ssd1306/ // http://www.solomon-systech.com/en/product/display-ic/oled-driver-controller/ssd1306/

@ -113,7 +113,7 @@ type Opts struct {
// The SSD1306 can operate at up to 3.3Mhz, which is much higher than I²C. This // The SSD1306 can operate at up to 3.3Mhz, which is much higher than I²C. This
// permits higher refresh rates. // permits higher refresh rates.
// //
// Wiring // # Wiring
// //
// Connect SDA to SPI_MOSI, SCK to SPI_CLK, CS to SPI_CS. // Connect SDA to SPI_MOSI, SCK to SPI_CLK, CS to SPI_CS.
// //

@ -4,7 +4,7 @@
// Package st7567 implements an interface to the single-chip dot matrix LCD // Package st7567 implements an interface to the single-chip dot matrix LCD
// //
// Datasheet // # Datasheet
// //
// https://www.newhavendisplay.com/appnotes/datasheets/LCDs/ST7567.pdf // https://www.newhavendisplay.com/appnotes/datasheets/LCDs/ST7567.pdf
package st7567 package st7567

@ -5,6 +5,7 @@
// Package tlv493d implements interfacing code to the Infineon TLV493D haff effect sensor. // Package tlv493d implements interfacing code to the Infineon TLV493D haff effect sensor.
// //
// Features of the device: // Features of the device:
//
// 3-dimensional hall effect sensor, measures up to +/-130 mT magnetic flux. // 3-dimensional hall effect sensor, measures up to +/-130 mT magnetic flux.
// temperature sensor // temperature sensor
// i2c interface // i2c interface
@ -12,6 +13,7 @@
// low power consumption // low power consumption
// //
// Features of the driver: // Features of the driver:
//
// Implemented all options of the device // Implemented all options of the device
// Power modes described in the documentation are defined as constants // Power modes described in the documentation are defined as constants
// 2 precisions: high precision (12 bits), where all registers are read or low precision, which saves 50% of I2C bandwidth, but without temperature and only 8-bit resolution // 2 precisions: high precision (12 bits), where all registers are read or low precision, which saves 50% of I2C bandwidth, but without temperature and only 8-bit resolution
@ -19,5 +21,4 @@
// //
// Datasheet and application notes: // Datasheet and application notes:
// https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/3d-magnetics/tlv493d-a1b6/ // https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/3d-magnetics/tlv493d-a1b6/
//
package tlv493d package tlv493d

@ -4,11 +4,11 @@
// Package tm1637 controls a TM1637 device over GPIO pins. // Package tm1637 controls a TM1637 device over GPIO pins.
// //
// More details // # More details
// //
// See https://periph.io/device/tm1637/ for more details about the device. // See https://periph.io/device/tm1637/ for more details about the device.
// //
// Datasheet // # Datasheet
// //
// http://olimex.cl/website_MCI/static/documents/Datasheet_TM1637.pdf // http://olimex.cl/website_MCI/static/documents/Datasheet_TM1637.pdf
package tm1637 package tm1637

Loading…
Cancel
Save