Commit Graph

30 Commits (b46e37febaa562d9175a161972c7c59dc3ec61a0)

Author SHA1 Message Date
Marc-Antoine Ruel 089b8dccab Reduce number of errcheck lint messages from 117 to 2.
- Ran github.com/kisielk/errcheck on the code base, and either trapped errors or
  marked them as ignored explicitly. The stats was calculated via:
    errcheck ./... | grep -v defer | wc -l
- Stop registering gpio.INVALID, it can't be registered.
- Fix a go vet issue in cap1188.
9 years ago
Matt Aimonetti 68f531c751 cap1188 experimental device (#192)
This driver was tested against a adafruit version of the cap1188
https://learn.adafruit.com/adafruit-cap1188-breakout/overview and the
pimoroni drumhat:
https://shop.pimoroni.com/collections/raspberry-pi/products/drum-hat
(which has its LED reversed and uses a different i2c address).
9 years ago
M-A 11522179a3 gpiostream: Implement LSB and MSB variations. (#188)
Make the encoding clear via examples.

Comment that the non-marked version is deprecated and will be removed in the
next major version.
9 years ago
M-A 0b05c62a9e nrzled: add support for ws281x and clones (#165)
- Includes driver and CLI. Completely untested.
9 years ago
M-A 70fd9082bb bmp180: promote to stable; fix bug in bme280 (#152)
- bme280: fix hang in Halt() if SenseContinuous() listener is hung.
- bmp180: Add unit tests; increase test coverage to 96%.
- bmp180: Remove Reset(). There's no known use case.
- bmp180: Implement SenseContinuous().
- Consistently wrap errors in both packages.
- Various typos.
9 years ago
M-A ea63dac2c6 devices: Add Environmental.SenseContinuous(); implement for bme280 (#150)
- devices: Add SenseContinuous() to Environmental.
- devices: Add Device to Display and Environmental.
- devices: Remove fmt.Stringer from Device.
- devices: Add more type assertions to variaous devices and corresponding unit test.
- bme280: Unexport the Standby parameter.
- bme280: Have SenseContinuous accept time.Duration period instead.
- bme280: Do not enable automatic sensing upon initialization.
- bme280: Use forced mode by default.
- bme280smoketest: improved.
9 years ago
M-A 24ef228ca1 spi: Rename Port.DevParams to Connect (#149)
It better conveys the purpose of the function, which is to create a Conn over a
Port.
9 years ago
M-A e1b4eec42a spi: rename variables 'bus' to 'port' where applicable (#143)
As people like to copy paste code, make sure that the semantic of the variable
names is always relevant w.r.t. the object they refer to. In particular, do not
use 'bus' to refer to an spi.Port or spi.PortCloser, as this is blur the
distinction.

Also rename a few fooName to fooID.
9 years ago
Alexander Neumann 61c1b2c139 Add driver for Bosch BMP180 temp/pressure sensor (#132) 9 years ago
Marc-Antoine Ruel b61c90429c spi: Add first version of TxPackets + NoCS, HalfDuplex, LSBFirst.
- This enables more complex use case like write-then-read, 3-wire SPI and when
  the number of bits per word changes accross packets.
- Remove the transparent Tx() buffer cutting, the Raspberry Pi 3 spi_bcm2835
  driver asserts the CS line even if csChange = 0 on the last packet. This broke
  some use case (like FLIR Lepton).

spi-io: improve with more use cases. Used for adhoc testing of the SPI bus and
looking at the results over an oscilloscope.
9 years ago
Marc-Antoine Ruel aff3ae8a77 i2c and spi: clarify with SetSpeed vs LimitSpeed.
Otherwise when reading code is it very unclear if it may be slower or not.

Yet another breaking change.
9 years ago
M-A 7faec2c2d3 spi: Update spi.Conn to separate app and device configuration. (#123)
- Allow both app and device drive set max bus speed.
- Make DevParams callable only exactly once.
- sysfs-spi: make SPI implement io.Reader.
- sysfs-spi: Fix Tx() with write only or read only.
9 years ago
M-A c15fd0bfa5 Add conn.Conn.Duplex() (#118)
Now each connection can report if the underlying communication channel is
half-duplex or full-duplex.

This information is leveraged by some clients, like memory mapped registers
helper struct, to change their behavior or deny use on certain kind of
communication channel.
9 years ago
M-A 56aad834ae Promote onewire, ds18b20 and ds248x to stable. (#117)
It works and it is tested.
9 years ago
Marc-Antoine Ruel 39aa0b9373 Update links without /doc/
See cdf3755696
9 years ago
Marc-Antoine Ruel c9298db3b0 Fix issues found by misspell, gofmt -s -w, golint and go vet; add badges
- There were several typos
- Simplified a few simplified statements
- Added doc for a few exported symbols
- Fix incorrect printf usage
9 years ago
M-A aa4d58cb95 Fix paths and rename all markdown files to README.md (#112)
This simplify the parsing by hugo.

Replace all '*' by '-' because my editor hates stars as list and it's a bad
idea after all.
9 years ago
M-A bbcd750d5b Replace github.com/google with periph.io/x (#110)
This makes periph.io/x/periph as the repository root so it is not tied to the
Google organisation anymore.
9 years ago
Thorsten von Eicken a76f663ae2 Add onewire smoke test (#104)
* set SPI speed and mode in spi smoketest
* add one-wire smoke test
10 years ago
M-A 2d5524c4cb gpio: Rename Edge constants. (#103)
This is to make the value more readable at the call site.
10 years ago
M-A 3368c35ef7 gpio: Rename Up and Down to PullUp and PullDown. (#93)
This should make it more approachable for first time users.
10 years ago
M-A 0075d9e849 Increase polish. (#75)
- Make error more consistent and more helpful. Not all errors are wrapped yet
  but a fair part is now.
- Remove the 'first' pattern in i2c, spi, uart and make it work.
- Add allwinner.Pin.wrap() for coherence with PinPL and bcm283x.Pin.
- headers.All() return a copy.
10 years ago
M-A 5cddc1641d host: migrate functions to subpackage cpu. (#63)
Otherwise this would cause some drivers to import host, which would import
drivers that the user may not desire.

This commit fixes this import loop.
10 years ago
Thorsten von Eicken 3bb6afb0ac Add support for DS248x i2c to onewire interface chip, and DS18B20 temp sensors (#59) 10 years ago
M-A 508e7b6b50 Improve error messages. (#46) 10 years ago
M-A 8bca85318d conn: Simplify Conn, rename i2c.Conn to i2c.Bus. (#40)
- Remove fmt.Stringer and io.Writer from conn.Conn. This makes it compatible
  with exp/io.
- Rename i2c.Conn to i2c.Bus since this was confusion. This clarifies the
  distinction between a point-to-point connection and a bus.
- Add these to bus specific interfaces, i2c.Bus, spi.Conn, uart.Conn.

Fixes #15.
10 years ago
M-A ae8f618573 Rename pio to periph. (#27)
Ran:
    git sed 's/pio/periph/g
    git sed 's/gperiph/gpio/g'
    git sed 's/Gperiph/Gpio/g'
    git sed 's/PIO/Periph/g'
    git sed 's/GPeriph/GPIO/g'
    git mv pio.go periph.go
    git mv pio_test.go periph_test.go
    cd cmd
    git mv pio-info periph-info
    git mv pio-setup periph-setup

where 'git sed' is an alias to run sed over all files in git ls-files.

Fixes #11.
10 years ago
M-A 5fce5c83f9 Rename lock to mu. (#16)
Rename lock to mu everywhere.
10 years ago
M-A 6c4287b4da Change copyright from Google Inc to The PIO Authors. (#3)
The PIO Authors is a superset of Google Inc. It includes Google and any
additional contributors that are listed in AUTHORS.
10 years ago
Marc-Antoine Ruel eb384b9d0c Initial commit of pio.
This was extracted from github.com/maruel/dlibox/go/pio @ f51102b.
This code was written by Marc-Antoine Ruel.
10 years ago