Commit Graph

306 Commits (49c84dc6bb393f742e1077434f7ba8c312e0452e)
 

Author SHA1 Message Date
Eugene 1bd781af86 Hitachi HD44780U Dot Matrix Liquid Crystal Display (#223)
Signed-off-by: Eugene Dzhurinsky <jdevelop@gmail.com>
8 years ago
Marc-Antoine Ruel 124fa6f98b I was so happy with recent Example refactors, did it for all packages
This creates an example_test.go for each package with at least one
Example, and move all examples in it. Make the example_test.go file live
into a separate package 'foo_test' so it can call host.Init() and thus
can be copied as-is.
8 years ago
Eugene 46011cfcbf MFRC522: Code review follow-up (#221)
Catch errors
Update formatting

Signed-off-by: Eugene Dzhurinsky <jdevelop@gmail.com>
8 years ago
Eugene ddf7ca2519 Initial support for the Mifare MFRC522 RFID Reader (#220)
Signed-off-by: Eugene Dzhurinsky <jdevelop@gmail.com>
8 years ago
Marc-Antoine Ruel 1f328237e7 README.md: add slack, remove gitter
The gitter channel is not used much.

Add a title for the example to state what it does, since it may not be obvious
for everyone.
8 years ago
Cássio Botaro 6287555122 Add Cássio Botaro as contributor (#216) 8 years ago
Cássio Botaro eccbfb4b4d removing redundant code (#213) 8 years ago
M-A 2f8171ed6c cap1188: refactor a bit. (#203)
- Make errors consistents.
- Standardize comments.
- Make unit test much faster by not sleeping.
- Reduce the number of properties of Dev.
  - Do not export Opts.
- Commented out I/O for unused data.
- Slightly reduce memory usage.
- Comment out NewSPI() since it is not implemented.
- Remove verbosity by default.
8 years ago
M-A b46e37feba Remove all time.Sleep calls during tests (#204)
It slows down tests, nobody wants that.
9 years ago
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
Marc-Antoine Ruel f015c64bb3 lepton: fix go test on go1.10beta1 9 years ago
Marc-Antoine Ruel e95c422e15 periph-smoketest: various usability improvements
This makes the tool more pleasant to use for newcomers and this makes flag
parsing more coherent.

- Print help on error.
- Consistently use NewFlagSet() everywhere with Usage() that prints nicer help
  page.
- Move code around for the ones that were not layed out in the same way as the
  rest.

This is a breaking change for gpiosmoketest, since it is switched from
undocumented positional arguments to flags.
9 years ago
Marc-Antoine Ruel dd32a7900e devices: move units code to units.go
No functional change.

I plan to add more units, and eventually this could make sense to split it off
into its own package. For now split it into its own source file.
9 years ago
Marc-Antoine Ruel 9e66c6ec1b Make the smoke tests more consistent
- Use the test name for the flag set.
- Assert that no extra argument on the command line is silently ignored
9 years ago
simokawa ff89fa64cc Make hardware PWM work. (#171)
* Fix PWM Address Map: add missing paddings.
* Set PWM rng/dat correctly.
* Clear ctl bits before set.

Fixes #168
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 7dc1026c65 conn: Add Resource, superseds devices.Device (#162)
In practice I want to be able for gpioreg.Register() to eventually enforce that
Halt() is implemented on gpio.Pin, so that three's a consistent way to stop
gpiostream operations or PWM() output. This requires the interface to live in
conn, not in devices.

Do not use go1.9 type alias to not break compatibility with older Go version
yet.
9 years ago
M-A 3d1aec5647 apa102: minor tweaks (#158)
- Disallow writing a buffer longer than the number used. Silently
  dropping data is always annoying to debug. Clear failure is better.
- Rename private variables and document them better.
- Replace 'lights' by 'pixels'. This is more precise.
9 years ago
Marc-Antoine Ruel e6e8b5e2b3 bmxx80: clarify NewSPI documentation
The doc stated that NewSPI could be used for BME280. It can also be used for BMP280.
9 years ago
Marc-Antoine Ruel 14f6450ea7 sysfs: Improve coverage for thermal
- Correct minor typos.
- Improve sysfs-thermal error wrapping.
- No significant functional change.
9 years ago
M-A 5e39729535 bmxx80: Merge bmp180 and bme280 and add support for bmp280 (#156)
- cmd/bmxx80 now can read any of these 3 devices.
- Rewrite the driver to support all 3 devices. More devices of the family (like
  the bme680) could be easily added.
- Add -ia to bmx280smoketest

Fix #155
9 years ago
Marc-Antoine Ruel bbed3b44f7 Fix negative RelativeHumidity.String() 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 e235d09bc8 gpioreg: Remove ByNumber() (#153)
It is still possible to get a pin by its logical number using the string
representation, but the function is not exported anymore.

This simplifies the interface, one less way to do the same thing.
9 years ago
Marc-Antoine Ruel 128c086c75 Fix various golint errors.
Trim "\n" from errors.
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
Marc-Antoine Ruel 1c4e51fe0c ssd1306: Remove dependency on golang.org/x/image/...
- Inline golang.org/x/image/font/basicfont in cmd/ssd1306.
- Inline a text rendering in ssd1306smoketest.
- Update ssd1306 example to be a comment, so golang.org/x/image is not imported
  even in the test.

Done as part of #146.
9 years ago
Marc-Antoine Ruel 502fbee137 Remove the warning in README.md about versioning.
Now that v1.0.0 is being released and will use a proper versioning mechanism,
there's no need for this warning.

Clients will be able to use http://github.com/golang/dep to version this
library.
9 years ago
Marc-Antoine Ruel 0947092379 bme280: Remove stale TODO for NewSPI
The code is functional and tested.
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
Max Ekman 77af758e41 Set version of RPi for all known revisions (#138)
Improve support for RPi 1, 2, 3, add support for Zero, Zero Wireless and the Compute Modules.

Removes rpi.Version since it doesn't make much sense anymore, as it more closely related to
the CPU than the actual board.

Fixes #139
9 years ago
M-A f33f0732fb spi: Refactor Conn and ConnCloser into Conn, Port and PortCloser (#131)
This clarifies the difference on ownership and makes it clear that DevParams()
is essentially a 'connection factory'.

The flow is:
  Bus -> Port -> Conn

Doing this caught inconsistencies in the unit tests. Made the structs in spitest
enforce the fact that DevParams() can only be called once.

In a follow up, I'll rename a lot of 'bus' to 'port' to be more consistent but
punting to not make this change unreviewable.
9 years ago
Alexander Neumann 61c1b2c139 Add driver for Bosch BMP180 temp/pressure sensor (#132) 9 years ago
quinte17 b5aa4c03f3 use a newCalibration func like in bmp180 (#134) 9 years ago
Marc-Antoine Ruel 27f14e663b bme280: fix Halt references 9 years ago
Marc-Antoine Ruel 3af6409eeb README.md: add warning about breaking changes 9 years ago
Matias Insaurralde 2d01ba7dbe Simplifying code (#129)
* host: follow gosimple suggestions

* conn: follow gosimple suggestions

* devices: follow gosimple suggestions

* Update CONTRIBUTORS
9 years ago
Marc-Antoine Ruel 9dfa0dc52f Update link 9 years ago
Marc-Antoine Ruel 8c668af634 small typos 9 years ago
Marc-Antoine Ruel e5127f7abf devices: despise Fahrenheit a bit more 9 years ago
Marc-Antoine Ruel debd177aa5 lepton: device driver for the FLIR Lepton
Include CLI tool to query the camera, grab a single frame and trigger a
calibration.
9 years ago
Marc-Antoine Ruel 2853fb49f6 gpioreg: Switch aliases to be to names instead of numbers.
This makes it much more generic and extensible. This will enable addressing
issue #125.

Refuse registering an high and low priority pins with different numbers but same
name and reverse.
9 years ago
Marc-Antoine Ruel bdefda99fb Add gitter.im chat room badge 9 years ago
Marc-Antoine Ruel 2f70f83e86 Make conntest output copy-pastable; fix go vet issues 9 years ago
Marc-Antoine Ruel fbf842d637 devices: Add devices.Device and Halt() for all device drivers
This starts a semblance of coherence for drivers. In particular Halt() marks a
clear difference from Close (connection) and is the term used by gobot.
9 years ago
Marc-Antoine Ruel 860d4aa457 For all IO, rename Write to W and Read to R
Fix Tx() for the Record objects (conntest, i2ctest, onewiretest and spitest) to
guard against write buffer corruption.
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