Commit Graph

344 Commits (v3.7.0)
 

Author SHA1 Message Date
M-A 039d8be022 ads1x15: style improvement (#315)
No functional change.

- Move private globals at the bottom of the file.
- Move ads1x15AnalogPin close to its methods.
- Stop using named return variable.
- Inline newADS1x15.
- Move gainConfig and gainVoltage as global variables.
- Wraps comments.
- Rename mutex to mu.
- Use -math.MaxInt16 instead of math.MinInt16 because of the voltage multiplier.
- Change error strings to start with a lower case.
8 years ago
bezineb5 a74c97c8cd ads1x15: Add continuous reading, quality bias. Fix min/max values. (#307) 8 years ago
David Sansome dcc7e03739 hx711: tidy up a few remaining PR comments: (#312)
- Remove ReadAveraged - it's not a good fit here.
- Use the proper datasheet URL.
- Remove some constants.
- Rename StopContinuousRead to Halt.
8 years ago
David Sansome efab755c33 hx711: add experimental driver. (#305)
HX711 is a 24-bit ADC commonly used for weigh scales.
8 years ago
Marc-Antoine Ruel 0f9300c793 gpioutil: move to experimental/conn/gpio/gpioutil
This mirrors the end location.
8 years ago
bezineb5 44ff30f2a3 ads1x15: add support for ADS1015 and ADS1115 (#304) 8 years ago
Vlad Korniev 540371861e mfrc522: make concurrent-safe (#299)
Moved low-level implementation to commands package.
Fixed example_test.
8 years ago
Alvaro Viebrantz 2a2fa553a3 epd: add ePaper display support (#295) 8 years ago
NeuralSpaz 2352b96bc1 as7262: Remove requirement for go1.7 (#301)
Refactor to remove context.Context
Remove usage of t.Run.
Adds test case for Sense for 100% coverage
Removed signal.Notify's as signals do not always get delivered.
Fix documentation copy paste error.
Add Band stringer test.
Add Spectrum stringer test
Add Gain stringer test.
Add Gain stringer.
Add Spectrum stringer.
Add Band stringer.
Add check for gain value.
Add more test for Halt() conditions.
Move done channel creation within cancel mutex.
8 years ago
Alvaro Viebrantz 80fb33f17d bh1750: Add support for ambient light sensor (#302) 8 years ago
Alvaro Viebrantz 28f7e8009b ht16k33: add support for LED alphanumeric display (#298)
Add support to rainbowhat which is a composite of multiple devices.
8 years ago
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