Commit Graph

383 Commits (b509627b7a0f116761d4d72251e0f20725ee7024)
 

Author SHA1 Message Date
NeuralSpaz 38804e4864 as7262: initial experimental support for AMS AS7262 Spectral ID i2c sensor (#300)
Add initial support for AMS 6 visible colour spectral ID sensor.
8 years ago
Marc-Antoine Ruel fb97d9d25d testing.T.Run was introduced in Go 1.7, not Go 1.8
Make tests that were locked on 1.8 to run on Go 1.7.

Fix ina219 tests to only compile on Go 1.7 since it uses testing.t.Run().
8 years ago
Marc-Antoine Ruel 7bc669b0cf experimental: fix gofmt for two packages
Travis was broken so I hadn't caught these regressions.
8 years ago
Will Meitzler 7f2de9c07f nrzled: Add SPI driver for Neopixel LEDs (#291)
Add support and tests for WS2812B Neopixel LEDs.
This commit has been tested with a strip of 50 LEDs.
8 years ago
Alvaro Viebrantz b2ab8ea899 pca9685: Add support for pwm module (#296) 8 years ago
Vlad Korniev 93d2236e21 mfrc522: improvements to gain and wait (#297)
- Antenna Gain
- Terminating Wait if Halt received
- Renamed SetOperationtimeout to SetOperationTimeout
8 years ago
Marc-Antoine Ruel d3144fa1d2 gpioutil: fix a race condition in TestDebounce_WaitForEdge_Got 8 years ago
Marc-Antoine Ruel 717ef921fa gpioutil: add PollEdge for polling based edge detection.
This function returns a gpio.PinIO implementing edge detection via polling.
8 years ago
Marc-Antoine Ruel 6853591d2a gpioutil: add minimal Deboune implementation.
No algorithm yet.
8 years ago
NeuralSpaz f54b53f207 ina219: add i2c driver for high side current and voltage sensor (#292) 8 years ago
David Sansome 5d01024987 ssd1306: add options to customize the hardware pin layout (#282)
Fixes #166
8 years ago
Seán C. McCord 97f5f4fe5d bitbang/spi: move pin init to Connect() from NewSPI() (#278)
Move pin init to Connect() from NewSPI()

Fixes #277
8 years ago
Seán C. McCord cd27930fe4 bitbang/spi: disable CS before manipulating CLK (#276)
Fixed #275
8 years ago
Marc-Antoine Ruel f325631d2a Bring back compatibility with go1.4.2
- apa102 benchmark used image.CMYK, which was added in go 1.5. This has the side
  effect of making benchmark BenchmarkDrawSlowpath a bit faster.
- mpu9250 used type aliasing by accident, which was added in go1.9.
- periph-web used http.Server.Shutdown(), which was added in go1.8.
8 years ago
Marc-Antoine Ruel 6e81933d56 Start standardizing function names
This is important to enable portability across platforms.

- UART_TX, UART_RX, UART_RTS, UART_CTS
- SPI_MISO, SPI_MOSI, SPI_CLK

This could break users who were depending on the previous wording but that would
be highly surprising.
8 years ago
Marc-Antoine Ruel ccd14fb9e1 Fine tune fmt usage
- Replace fmt.Printf("%s\n", x) with fmt.Println(x)
- Replace fmt.Printf(".. %s ..", hex.EncodeToString(x)) with fmt.Printf(".. %x ..", x)
8 years ago
Marc-Antoine Ruel e8b2fc3174 switch from fmt.Stringer to conn.Resource
- conn.Resource is a superset of fmt.Stringer.
- lirc: implement conn.Resource.
8 years ago
Seán C. McCord 34b6d1d3d2 bitbang/spi cleanup (#268)
- precalculate clock idle polarity and remove clockOn()/clockOff()
 - check for higher (unknown) modes and reject them
 - move internal functions down, to be grouped together
- idle clock on Connect
8 years ago
Seán C. McCord d2f71ca23c bitbang/spi: improve mode handling (#267)
- Handles clock-related Mode options for bitbanging SPI.
- Adds error handling for each errorable operation in spiConn.Tx
- Adds support for NoCS mode option
- Re-adds early catch for unhandled modes, now just HalfDuplex and
  LSBFirst

Fixes #266
8 years ago
Marc-Antoine Ruel 5b5d0de02f Explicitly ignore error at many call sites for clarity
Used the following:
  go get github.com/kisielk/errcheck
  errcheck -ignore 'Close|rintf' ./...

While some are irrelevant, there were some genuine issues so this is worth
enforcing, hence a few innocuous places were 'fixed' so that the list could go
down to zero.

Do not enforce this in travis yet, but should be done soon.
8 years ago
Marc-Antoine Ruel 161a9035d2 bmxx80: fix humidity sensing
It regressed in e9544992d9. :( This is due to
integer overflow. Tested against the executable compiled from periph v2.

Refactor the tests to make the error messages clearer.

Fixes #256
8 years ago
Eugene 206686751e MPU9250 experimental driver, largely inspired by https://github.com/kriswiner/MPU9250/ (#265)
Provides some basic functionality for initialization, self-test,
calibrarion and reading the gyroscope and accelerometer data.

Uses SPI interface, I2C is yet to be implemented via the separate
transport.

Signed-off-by: Eugene Dzhurinsky <jdevelop@gmail.com>
8 years ago
M-A 8e1f781a4d apa102: change from RawColors to DisableGlobalPWM (#261)
The rationale is that both intensity limiting and temperature correction can
still be used with 8 bits resolution, but perceptual mapping can't.

Make the documentation clearer about the implications. Add global PassThruOpts
to make its clear for users.

Add example for ToRGB() using PassThruOpts.

Add unit tests.

Add flag -g to cmd/apa102.

Extracts a condition from the inner raster loop, increasing performance by up to
25%.

Fix bug in dst overrun.
8 years ago
Ben Lazarus bbc377d76a apa102: Add RawColors option (#260)
This adds a new option to bypass the perceptual remapping code and
directly write the RGB values to the APA102.
8 years ago
Ben Lazarus 70adef3f63 apa102: refactor raster functions (#254)
- rasterImg() now calls raster() instead of duplicating it
- Add a fast path for RGBA
- Add tests for Draw()s called with src and dst offsets supplied
8 years ago
Ben Lazarus e2aca639ef apa102: add new benchmarks for raster refactor (#259) 8 years ago
Ben Lazarus 82d2ba2f9b apa102: simplify Draw() benchmark (#253) 8 years ago
Ben Lazarus a90b2edbb3 apa102: refactor benchmarks (#252) 8 years ago
Ben Lazarus a948b6ab2e apa102: Refactor tests (#251)
- Convert existing tests to table-driven
- Make reading []byte diffs easier by aligning lines
- Should be a no-op in terms of what's being tested and with what data
8 years ago
Jorge D. Ortiz Fuentes afdedaf59d UnicornHD driver implementation (#250)
- Unicorn HD (https://shop.pimoroni.com/products/unicorn-hat-hd) driver.
- Implements display.Drawer.
- Test for partial update as required in the interface.
8 years ago
Marc-Antoine Ruel 0e0bb7e7dc bitbang: fix SPI with the new v3.0.0 spi interfaces
I had forgot to update it in time, resulting in a completely broken
implementation.

It's still broken, but it was even more broken.
8 years ago
Marc-Antoine Ruel cbaeada391 cap1xxx: move out of experimental 8 years ago
Marc-Antoine Ruel 98e2118731 devices: overhaul documentation
- Standardize package documentation into doc.go
- Link back to the web site in a standardized way
- Update datasheet links for lepton
8 years ago
Marc-Antoine Ruel f7ddfe8f13 cap1xxx: generalize cap1188 to support more devices
cap1166 can be found in Display-O-Tron HAT by Pimoroni.
8 years ago
Marc-Antoine Ruel c0f73d6f9a Use timeTicker instead of Sleep
This encourages cleaner implementation
8 years ago
Marc-Antoine Ruel d0b2e0937c bmxx80: update datasheet URLs 8 years ago
Marc-Antoine Ruel e634bc9fab Fix a ton of golint messages.
The remainder is ALL_CAPS, underscores and golint confusion when multiple
exported variables are defined on a single line.

No functional change except one error string tweaked.
8 years ago
Marc-Antoine Ruel 501558c627 conn/display: simplify Drawer
display: move devices.Display as display.Drawer

This removes the last interface from devices, which was misplaced due to
historical accident. The new package display will also be the location for an
interface for text output only devices.

Remove io.Writer from this interface. While it's a good performance optimization
for some drivers, it shouldn't be required.

Change Draw():
- Return an error, so that communication erorr can be surfaced correctly,
  instead of an adhoc driver specific Err() method.
8 years ago
Marc-Antoine Ruel f7d0d4e3d5 travis: run on 1.5.4
- Move go1.8+ test code using t.Run() into separate file conditionally compiled
  on go1.8+. It's not a big deal to partially lose test coverage on <1.8 as long
  as the main code runs fine.
- Run coverage before race checker to help get results faster.
- Fix typo.
- No need to run travis on recent versions, they are handed by gohci workers and
  they are faster. :)
8 years ago
Marc-Antoine Ruel 6f8bd69f03 Consistently cache display device Bounds()
Improve Draw() performance.
8 years ago
Marc-Antoine Ruel 0a22d3193e nrzled: change to Opts pattern
This makes it coherent with other drivers.
8 years ago
Marc-Antoine Ruel 8fa8a276a6 apa102: fix typo, use DefaultOpts in cmd
Reduce the number of constants by having cmd/apa102 uses the values from
apa102.DefaultOpts. This increases the default intensity from 127 to 255.
8 years ago
Marc-Antoine Ruel dfd55c438e Tweak package doc for many executables 8 years ago
M-A 10ef55d6b0 cap1188: tweaks in the device driver (#244)
- Change DefaultOpts to be a struct instead of a function. This makes the godoc
  much more descriptive.
- Change InputStatus() to accept a slice, so that the driver will be able to
  eventually support the flavors cap1155 and cap1166.
8 years ago
Marc-Antoine Ruel e1decce7e5 gpiostream: replace Resolution with Frequency
It's easier for people to think in term of frequency when working with bitstream
than with the clock cycle duration in µs.
8 years ago
Marc-Antoine Ruel 332037c25e Update use of frequency to use physic.Frequency
This is borderline pedantic but enables 30*physic.MegaHertz which I think is
more readable than 30000000, reducing the risk of typos.

Do not change Stream.Resolution() gpiostream yet, but I'll likely change it too
to match in a follow up.
8 years ago
Marc-Antoine Ruel 0b285a6cb6 cci: make Dev implement physic.SenseEnv
Remove unnecessary Sprintf() call.
8 years ago
Marc-Antoine Ruel 79423600fb ds18b20: change Dev to implement physic.SenseEnv; tweak String()
This removes the Temperature() function for coherency with the other drivers.

This removes the dependency on package fmt.
8 years ago
Marc-Antoine Ruel ecfe99ea32 physic: Add Precision to SenseEnv
Implement for bme280 and sysfs
8 years ago
Marc-Antoine Ruel e9544992d9 physic: increase RelativeHumidity precision by 10x
MicroRH comment are incorrect.

It's actually too low for BME280's sensitivity.
8 years ago