Commit Graph

57 Commits

Author SHA1 Message Date
deadprogram a128e466dd sysfs: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-06-15 14:04:08 +02:00
Erik Agsjö 44dec6d800 Updated Tinkerboard and sysfs tests to updated PWM polarity contract
Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
2017-06-15 14:04:08 +02:00
Erik Agsjö dcd861ed6e Fixed PWM duty cycle calculation for C.H.I.P ServoWrite
Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
2017-06-15 14:04:08 +02:00
deadprogram 1bb25d3a05 sysfs: proper handling of busy state vs. other errors
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-05-03 10:35:03 +02:00
deadprogram ea371766fb sysfs: define DigitalPinnerProvider and PWMPinnerProvider interfaces
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-05-01 09:23:15 +02:00
deadprogram 7429a159f4 sysfs: export DigitalPin to make it more like PWMPin
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-28 12:50:36 +02:00
deadprogram 54228b39e2 chip: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-27 11:22:15 +02:00
deadprogram df11a4e6af sysfs: add file read/write testing for failure conditions
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-27 08:41:34 +02:00
deadprogram eefe547d25 sysfs: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-25 12:41:57 +02:00
deadprogram 56285df3d3 sysfs: make PWMPinner interface more consistent
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-25 10:43:58 +02:00
deadprogram 1aff614827 sysfs: increase test coverage for PWMPin
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-22 12:30:59 +02:00
deadprogram 471c5260fc sysfs: return sensible result when no valid data read
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-22 10:42:58 +02:00
deadprogram 0eff347997 sysfs: refactor interface for better match with actual interface
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-21 23:06:45 +02:00
deadprogram 0d1362bef1 sysfs: changes needed to allow use of PWMPin from Adaptors
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-21 19:50:17 +02:00
deadprogram 05aeaf7d79 sysfs: add Chip to be able to change pwmchip, and some related refactoring
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-21 19:29:55 +02:00
deadprogram 79288f837b sysfs: small reordering to file
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-21 12:55:00 +02:00
deadprogram 73a85aecdf sysfs: increase test coverage for pwm pin
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-21 10:05:59 +02:00
deadprogram 11c55dcc60 sysfs: shared pwm pin implementation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-21 09:41:11 +02:00
deadprogram fd55da83a1 sysfs: no need for else, just return
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-17 09:30:41 +02:00
deadprogram 2300ef79e1 sysfs: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-09 12:09:52 +02:00
deadprogram faf506dbcd sysfs: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-09 12:00:14 +02:00
deadprogram 13782c99e2 sysfs: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-09 11:04:41 +02:00
deadprogram cce653522c sysfs: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-09 09:32:55 +02:00
deadprogram 92a7419d3f sysfs: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-09 09:29:28 +02:00
deadprogram a21abad5a9 sysfs: minor type corrections and increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-09 09:15:09 +02:00
deadprogram 2366f35c24 sysfs: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-07 19:59:55 +02:00
deadprogram 62ebd67dea sysfs: address race condition from udev rules when exporting GPIO pins
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-04-01 22:07:47 +02:00
Erik Agsjö 5a5f6eb52b Added tests for mocked Stat implementation
Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
2017-03-14 00:32:53 +01:00
Erik Agsjö 13c3c111d5 Added more tests for PWM
Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
2017-03-14 00:11:06 +01:00
Erik Agsjö ea93b203bd Added more capabilities checks for I2C
Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
2017-02-27 23:40:14 +01:00
Erik Agsjö f0873adea6 Removed smbus block operations
Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
2017-02-27 20:53:01 +01:00
Erik Agsjö 543a246916 Updated all i2c drivers to new interface
Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>

Fixed I2C interface bugs

Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
2017-02-06 15:06:00 +01:00
Erik Agsjö 0626b3b3a2 Added word sized i2c write operation
Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>
2017-02-06 14:57:36 +01:00
Erik Agsjö f41021c17a Change to make I2C support more than one bus, and use
other access methods than block operations.

Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>

Added ReadWordData to i2c connection

Signed-off-by: Erik Agsjö <erik.agsjo@gmail.com>

Code cleanup
2017-02-06 14:57:19 +01:00
deadprogram fa9f6aefc3 sysfs: some additional cleanup suggested by golint
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-01-02 19:32:04 +01:00
deadprogram c432f50ae0 sysfs: Should fix #272 by using first byte of data as command register for I2C reads
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-01-02 15:13:22 +01:00
deadprogram 75847b8f0c core: use canonical import path for sysfs package
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-12-21 10:57:23 +01:00
deadprogram 953c3254e7 core: use canonical import domain of gobot.io for all code
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-12-08 13:24:03 +01:00
Ron Evans 5442e0bd8b Merge pull request #308 from jfinken/dev
Adafruit Motor HAT driver support
2016-09-17 01:34:05 +02:00
Erich Cordoba 5d156f9a6c Remove debug message from i2c_device.go
Signed-off-by: Erich Cordoba <erich.cm@yandex.com>
2016-09-03 23:21:03 -05:00
Josh Finken c3f142f4d7 Initial commit of driver code, with accompanying example, for the Adafruit_MotorHat. 2016-08-01 19:08:54 -06:00
gmarik e494b9fb99 Refactor to use `gobottest` test helpers 2016-02-22 00:33:58 -05:00
Brian Stengaard 642ab409c1 Use Seek to speed up read/write in sysfs
This maintains `direction` and `value` `File`s for each DigitalPin
implementation. Instead of Open/Read/Close we now only do Seek/Read,
this speeds up Read/Write operations a bit.

A silly benchmark on the mock FS gives:

benchmark                  old ns/op     new ns/op     delta
BenchmarkDigitalRead-8     647           7.36          -98.86%

benchmark                  old allocs     new allocs     delta
BenchmarkDigitalRead-8     5              0              -100.00%

benchmark                  old bytes     new bytes     delta
BenchmarkDigitalRead-8     96            0             -100.00%
2016-02-18 21:18:45 +01:00
Hrishikesh Tapaswi 42475e479d Get I2C functionality before doing SMBus block I/O
In the sysfs i2cDevice implementation, use an ioctl to get the adapter
functionality mask. Prefer SMBus block I/O but if it's not available,
perform read/write calls directly on the file descriptor.

Improve Wiichuck error handling. Add a 1 ms delay between I/O operations
to the Wiichuck; this dramatically improves reliability.

Signed-off-by: Hrishikesh Tapaswi <hrishikesh195@yahoo.com>
2016-02-17 12:25:15 -08:00
Adrian Zankich fe6df92974 Refactor sysfs I2C implementation and add Address parameter to I2C interface functions 2015-07-03 18:57:29 -07:00
Adrian Zankich 22b84cc6ef go lint and documentation tweaks for the sysfs package 2014-12-31 06:12:25 -08:00
Adrian Zankich 67cdddb7ec Correctly pass os.PathError from fs mock Openfile function) 2014-12-23 12:59:59 -08:00
Adrian Zankich 25919240c2 Account for already exported pins and unexportable pins 2014-12-23 12:43:55 -08:00
Adrian Zankich cb2d101b6d Improve error message 2014-11-07 18:38:52 -08:00
Adrian Zankich ece9aa16f9 Add syscall mock 2014-11-07 16:56:13 -08:00