80 Commits

Author SHA1 Message Date
Dave Jones
401f3a4437 Fix attribute link 2017-07-14 21:44:40 +01:00
Dave Jones
b462b5f84a Remove all the remaining pin.address stuff
... again?
2017-07-14 16:11:40 +01:00
Dave Jones
a0d784082d Fix #565
Add mock pins docs and tidy up some other bits of the pins docs
2017-07-14 15:11:59 +01:00
Dave Jones
49d3bbc1da Consistency in factory references 2017-07-14 14:01:39 +01:00
Dave Jones
eafae5c31a Fix #568
Update examples in pin factory docs so they work correctly.
2017-07-14 13:51:29 +01:00
Dave Jones
1ca017fc6d Make mock constructor consistent 2017-07-05 20:17:57 +01:00
Dave Jones
c820636fcb Fix #279 once and for all (ha! ;)
This implements the proposal discussed in the re-opened #279 to add a
pin_factory argument at the device level and remove the ability to
specify a pin instance to device constructors (they now only accept a
pin specification).

Note: there's still a couple of bits to tidy up (tests on "real" Pis,
and pin_factory.release_all needs refinement) but the test suite is now
at least capable of passing on a PC.
2017-07-04 00:26:41 +01:00
Dave Jones
67ead55d74 Change default mock revision to Pi3B 2017-06-23 19:19:52 +01:00
Dave Jones
a99e0746c3 Fix #279
Permit replacement of pin_factory without closing old factory. However,
continue closing devices associated with extant pin factory at script
termination.
2017-06-22 22:45:00 +01:00
Dave Jones
ffe12362f5 Fix #521
Rename pigpiod module to pigpio
2017-06-21 15:39:50 +01:00
Dave Jones
1022b0b0de Close #465
Factor out hardware SPI pin numbers; this is a effectively a rebase (and
minor modification) of @lurch's original patch which conflicted after
the merge of the remote-spi branch.
2017-06-20 23:16:59 +01:00
Dave Jones
bcc94354ea Fix #553
Ensure SourceMixin descendents shut down the source prior to closing.
Furthermore, make sure devices are closed before pin factory shuts down,
and that pins have a strong reference to their owning factory (to
prevent losing the factory before the pins).
2017-06-20 11:24:17 +01:00
Dave Jones
6017e7d01d Missing import... 2017-06-16 13:28:55 +01:00
Dave Jones
5487124f74 Fix pigpiod SPI conflicts
Wrong classname in the software implementation and for some reason I'd
reverted a change on spi_flags somewhere... Also removed the clause
skipping remote pigpiod tests

Tested this commit with hardware and software SPI remotely - working
nicely
2017-06-16 13:28:55 +01:00
Dave Jones
e5336c38ce Run all tests on all platforms
Also renamed GPIOZERO_INPUT_PIN to GPIOZERO_TEST_INPUT_PIN, and fixed up
the pigpio factory so it actually raises an exception if the connection
fails and we don't try and control the daemon anymore.
2017-06-16 13:28:55 +01:00
Dave Jones
945bea4e54 Added keyword args to MockFactory.pin
And a few other last minute fixes
2017-06-16 13:28:55 +01:00
Dave Jones
f09b5c5c18 Remove some redundant testing bits 2017-06-16 13:28:55 +01:00
Dave Jones
2495939603 Fix real pin tests ... and some other bits
The real pin tests were broken by the new factory stuff. This commit
fixes them up, and fixes up a few other bits besides (like why the
pigpio PWM tests were failing, why RPi.GPIO sometimes segfaulted on PWM
tests, etc.)

It also causes the real pin tests to run against MockPin (thanks to
@lurch for the suggestion!). This required some tweaks to MockPin to
make it emulate physically pulled up pins itself (which in turn
necessitated changing quite a few pin numbers in the main test suite
because we were using 2 and 3 everywhere), and to allow one MockPin to
drive another. Anyway, everything's working now including all the tests
on a Pi (haven't tried RPIO yet, but only because I'm on a Pi3 -
everything else works with overall coverage of 88% :).
2017-06-16 13:28:55 +01:00
Dave Jones
d3c55d25a4 Tidying up...
Dunno how many commits this PR is now!
2017-06-16 13:28:55 +01:00
Dave Jones
73c0516a28 Try and import the right compat...
And remove all the nonsense you re-factored into PiPin...
2017-06-16 13:28:55 +01:00
Dave Jones
cab6cc8086 Rework when_changed attribute to use weakrefs
Some fairly major changes to ensure that the Pin.when_changed property
doesn't keep references to the objects owning the callbacks that are
assigned. This is vaguely tricky given that ordinary weakref's can't be
used with bound methods (which are ephemeral), so I've back-ported
weakref.WeakMethod from Py3.4.

This solves a whole pile of things like Button instances not
disappearing when they're deleted, and makes composite devices
containing Buttons much easier to construct as we don't need to worry
about partially constructed things not getting deleted.
2017-06-16 13:28:55 +01:00
Dave Jones
08076e8d0e Inline the SPI hardware args (neater code) 2017-06-16 13:28:55 +01:00
Dave Jones
cbff81f3a1 Simplify SPI bit-banging implementation
And add some comments to make stuff clearer
2017-06-16 13:28:55 +01:00
Dave Jones
a9f9aa4a3e Catch SPI conflicts properly
Also handle SPI flags in pigpio implementation more elegantly (just
store the flags and manipulate them instead of keeping separate fields)
2017-06-16 13:28:55 +01:00
Dave Jones
ba1a7e6497 Add configuration of mock factory via env-vars
Also tidied up some docs
2017-06-16 13:28:55 +01:00
Dave Jones
b0c807da19 More tidying up
Ensure LEDCollection cleans up upon construction failure, rename some
internals to be a bit more obvious, rename PinGPIOUnsupported to
PinUnsupported, and some other stuff I've forgotten!
2017-06-16 13:28:55 +01:00
Dave Jones
c570b8f09b Clean up repeated string substitutions 2017-06-16 13:28:55 +01:00
Dave Jones
4d79dc74db Removed redundant weakref references
Also tweaked a couple of minor bits (SPI bus init mask) and unused
_get_address override
2017-06-16 13:28:55 +01:00
Dave Jones
ce6217c14f Fix #459 - properly support remote SPI with pigpio
Sorry! Dave's messing around with the pin implementations again.
Hopefully the last time. The pin_factory is now really a factory object
which can be asked to produce individual pins or pin-based interfaces
like SPI (which can be supported properly via pigpio).
2017-06-16 13:28:55 +01:00
Dave Jones
4e62990917 Merge remote-tracking branch 'upstream/lenient_revision_parser'
Conflicts:
	gpiozero/pins/data.py
2017-06-13 18:19:02 +01:00
Dave Jones
97ffabe764 Fix up missing board stuff
Also ensure the Zero W gets represented properly on board output and
tidy up some spacing
2017-06-13 16:02:07 +01:00
Dave Jones
900affbf7f Merge remote-tracking branch 'upstream/1.3.2-updates'
Conflicts:
	docs/changelog.rst
	gpiozero/pins/data.py
2017-06-13 15:48:02 +01:00
Ben Nuttall
f5f827c0ec Add missing quote 2017-03-03 13:11:49 +00:00
Andrew Scheller
5b91e55e96 Add details for Chinese Pi Zero (on top of v1.3.1.post1) 2017-03-03 12:55:18 +00:00
Andrew Scheller
82050d3d5a Add details for 512MB Pi A+ (on top of v1.3.1.post1) 2017-03-03 12:55:07 +00:00
Andrew Scheller
71fed0e851 Add BCM2837-based Pi2B details (on top of v1.3.1.post1) 2017-03-03 12:54:53 +00:00
Andrew Scheller
8c7bd5f51f Add Pi Zero W details (on top of v1.3.1.post1) 2017-03-03 12:54:42 +00:00
Andrew Scheller
dc0c119cbb Add Sony Japan manufactured Pi 3B details (on top of v1.3.1.post1) 2017-03-03 12:54:29 +00:00
Andrew Scheller
4e2798dcd0 Add Compute Module 3 details (on top of v1.3.1.post1) 2017-03-03 12:54:14 +00:00
Andrew Scheller
1b2415a4c2 Supply 'default' values for some of the pi-revision fields, where appropriate 2017-01-22 17:10:32 +00:00
Andrew Scheller
17024c9ba3 Separate out the revision-code parsing and decoding 2017-01-22 16:51:42 +00:00
Andrew Scheller
f3ccaf891c Update for rev 1.0 2B 2016-09-22 23:19:20 +01:00
Ben Nuttall
69aaa627fc Correct B+/2B release date change 2016-09-22 16:41:39 +01:00
Ben Nuttall
2046af7454 Add release date for new BCM2837-based Pi 2B
I think this is all that's needed to make pi_info accurate
2016-09-22 15:25:27 +01:00
Andrew Scheller
4e66c0fcd3 Default to 'full' content in __format__
...when no explicit content argument is given
2016-09-13 23:50:19 +01:00
Dave Jones
27c0703043 Fix #354
Actually, "fix" doesn't really do this justice. This is closer to "nukes
from orbit" ...
2016-09-13 17:37:17 +01:00
Dave Jones
737a739cd6 Fix #421
Added SPI tests, simplified the shared SPI software bus implementation,
and fixed several protocol errors in our MCP3xxx classes (the x2 and x1
protocols were wrong)
2016-09-08 22:24:06 +01:00
Dave Jones
6f67a973cf Fix all the stuff you broke last night...
In particular the `pi_revision` thing in PiGPIOPin, all the stuff @lurch
picked up in `pins/data.py` (thank goodness *someone's* watching!), and
make all those links pointing to "Notes" point somewhere useful like
"Pin Numbering"...
2016-08-30 15:43:57 +01:00
Dave Jones
6cc308e44a Fix #354, fix #389
Overhaul the pi_info system:

Pin factories are now capable of generating pi_info themselves (although
currently they all just look up the revision and call pi_info with a
specific one).

PiGPIOPin will now return pi_info for the remote pi which can be
specified by parameter or implicitly by the environment vars.

Overvolted Pis should work properly no matter what (some argument over
whether the revision 7 or 8 chars in this case; both should work). Added
some minor tweaks for the new camera-capable Pi Zero

Finally, added a bunch of tests for pins.data
2016-08-29 11:48:23 +01:00
Andrew Scheller
37b91ced74 Correct number of ComputeModule USB ports (part 2)
Correct associated documentation
2016-08-18 00:22:07 +01:00