Commit Graph

360 Commits (9ddc05227dde4891954613ab5506a0444b18e86e)
 

Author SHA1 Message Date
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
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
Marc-Antoine Ruel 2dfb12af03 tm1637: increase coverage to 100%
It's kind of cheating because a gpiotest.Playback is needed but not yet written.
9 years ago
Marc-Antoine Ruel 2e0e8d4ee9 Minor cleanups in ds18b20 and ds248x.
Breaking change: removed ds248x.Dev.Close() as it doesn't 'own' anything.
Wrap comments at 80 cols.
Call Playback.Close(), removed extraneous Ops.
Slightly increased coverage.
9 years ago
Marc-Antoine Ruel daad425c63 ssd1306: implement SPI and transparent differential update.
- Increase test coverage to 100%.
- Add ssd1306smoketest.
- Complete SPI 4-wire implementation.

Differential update reduces the amount of data sent over the I²C/SPI bus at the
(small) cost of slightly more CPU usage. On many platform, I²C default transfert
speed is only 100KHz so when only a small section of the display is updated,
this can lead to significant performance improvement.

For now only page based differential update is used, as column based offset
corrupt the display. This still results in large savings.
9 years ago
Marc-Antoine Ruel 722b0f8824 conntest: Change Playback default to panic
Make this optional for all of conntest, i2ctest, onewiretest and spitest.
Update tests accordingly.
9 years ago
Marc-Antoine Ruel a0e9236c75 image1bit: make it more like stdlib
- Rename Image to VerticalLSB, so that the 3 other encodings (vertical MSB,
  horizontal LSB and MSB) can be added at a later point if ever needed without
  breaking the API.
- Use .Pix, .Stride and .Rect so it is more similar to how stdlib image package
  does it.
- Export the color model properly as BitModel.
- Remove frivolous methods.
9 years ago
Marc-Antoine Ruel 94686e7f5d bme280: Fix SPI, add smoke test.
Increase coverage; only one line would need some math to figure out values that
would allow exceeding the threshold.
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
Marc-Antoine Ruel fd7cbfd4bf devices: Fix negative Milli 9 years ago
Marc-Antoine Ruel edc050f0a7 Add mascot 9 years ago
M-A c8b66ce778 Split registries into their own packages. (#122)
conn/gpio -> conn/gpio/gpioreg
conn/i2c -> conn/i2c/i2creg
conn/spi -> conn/spi/spireg
conn/pins -> conn/pin
host/headers -> conn/pin/pinreg
conn/reg -> conn/mmr
9 years ago
Marc-Antoine Ruel cbac673bcf s/OpenByName/Open/g and d/OpenByNumber/
This shortens OpenByName() to Open() and removes OpenByNumber(). The concept of
number is not removed, it's still possible to open a bus by number, but a base10
string representation of the number is now needed. In practice, I haven't found
a real use for OpenByNumber().

This simplify the API surface, less functions leads to simpler to understand
API.

This is a breaking change.
9 years ago
Marc-Antoine Ruel 9fe596f933 apa102: increase coverage to 100%
Make Write() handle when buffer is too long.
9 years ago
Marc-Antoine Ruel ce258e061b conntest: Add 100% coverage
- conntest: Small coherency fixes along the way.
- conntest: Add Discard. Useful for zero filled tests.
- reg: Improve testing.
- CONTRIBUTING.md: fix a typo.
9 years ago
M-A 6620acdaca spi: Rewrite similar to how i2c was refactored (#120)
Because of the way the SPI bus is exposed via sysfs, do not use the same pattern
as i2c. This may change as more OSes are supported.

Increase test coverage for spi and spitest to 100%.
9 years ago
Marc-Antoine Ruel 7464232a5f Remove io.Writer from spi.Conn
This was interface creep
9 years ago
M-A f14be69810 i2c: convert from "number only" to named buses plus aliases (#119)
This is a breaking change.

This is closer to how gpio behaves yet different in practice because of the
different challenges.

spi will be updated later to behave the same. Add support for aliases, which is
very useful, and it permits the CLI tools to accept a free form string to
specify the bus name.

- Increase test coverage of i2c and i2ctest to 100%.
- Add i2c.Pins implementation to i2ctest.Playback.
9 years ago
Marc-Antoine Ruel d7c75db11b Add CONTRIBUTING.md so there's a banner on the PR.
It just points to https://periph.io/project/contributing/
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 0c585b510a travis: Expose test failure, install missing packages
Add badges.
9 years ago
Marc-Antoine Ruel f1d8127e0b Rename sample to example.
See 96b661173e
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
Marc-Antoine Ruel 9031234a9b Fix actual link to SAMPLES 9 years ago
Marc-Antoine Ruel 82983adf33 Deep link to samples 9 years ago
Marc-Antoine Ruel a44f3ac129 Tidy up the docs. 9 years ago
Marc-Antoine Ruel 61b5ae730a Migrated documentation to github.com/periph/website 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 b52a4b9f1d Make markdown files more compatible (#111)
Certain parser requires empty line above the first list item to be recognized as
a list.

Update gohci URL.
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 adc0251b5a fix ssd1306 i2c commands (#107)
* fix ssd1306 i2c commands
* verified that scrolling works
* added comment that ssd1306 doesn't support SPI yet
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 77cb166f25 Fix the front page sample to be less cryptic. (#92)
The example made it look like the user had to use global variables, which may
cause a poor first time impression. Make it clear that there is multiple ways to
access a pin.
10 years ago
M-A b9bc3713f7 Improve documentation. (#90)
Add "Features"
Drastically shorten the sample on the home page.
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
M-A f7261fe4df doc: add more information about testing. (#69) 10 years ago
Marc-Antoine Ruel 8a8a4edc01 apa102: fix unit tests.
Changing the temperature calculation from float64 to lookup tables causes small
(<3 in value) changes in the recorded data.
10 years ago
M-A 8925bb0af7 apa102: remove remaining float64 use and dependency on maruel/temperature. (#67)
temperature.ToRGB() was implemented in floating point. OMG.

Fixes #22
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 495d261bae periph: Remove Type; gpio: improve pin registering (#48)
periph:
- Type was an approximation to enforce priority ordering. Remove the need for
  approximate ordering by improving gpio instead to support out-of-order pin
  registration. This has the side effect of increasing parallelism. This saved
  ~5ms on "gpio-list" runtime (out of 30ms) when run on a Raspberry Pi 3.

gpio:
- Redo RegisterAlias() to support out of order registration.
- Replace Functional() with Aliases(), which is much more generic.
- Unexport PinAlias, it is not necessary anymore.
- Improve error messages by wrapping the error, it helps legibility in case of
  errors.
- Remove Unregister(), it will be added back when there's an actual call site.
- Remove the (%d) number on sysfs-gpio and bcm283x since it wasn't useful.
- sysfs-gpio: Fix edge when switching output.
- consistently fix accumulated edged when calling sysfs.Pin.In().

lirc:
- Stop mapping IR_IN and IR_OUT when the pin is not mapped.

periph-smoketest:
- Fix to use host.Init(), otherwise drivers weren't correctly loaded.

Fixes #45
(I think)
10 years ago
M-A 508e7b6b50 Improve error messages. (#46) 10 years ago
M-A 01b45ab697 Add more examples, trim documentation. (#44) 10 years ago