<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/extmod/machine_spi.c, branch 2.x</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.x</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.x'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-02-06T03:38:33+00:00</updated>
<entry>
<title>extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func.</title>
<updated>2017-02-06T03:38:33+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-06T03:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dee47949cc8782c2d565de6d6b7e5c1339000061'/>
<id>urn:sha1:dee47949cc8782c2d565de6d6b7e5c1339000061</id>
<content type='text'>
SPI needs to be fast, and calling the EVENT_POLL_HOOK every byte makes it
unusable for ports that need to do non-trivial work in the EVENT_POLL_HOOK
call.  And individual SPI transfers should be short enough in time that
EVENT_POLL_HOOK doesn't need to be called.

If something like this proves to be needed in practice then we will need
to introduce separate event hook macros, one for "slow" loops (eg
select/poll) and one for "fast" loops (eg software I2C, SPI).
</content>
</entry>
<entry>
<title>extmod/machine_spi: Provide reusable software SPI class.</title>
<updated>2016-12-08T02:47:01+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-08T02:47:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1eb3c66e9136b5934fc306408f00f11a07dea584'/>
<id>urn:sha1:1eb3c66e9136b5934fc306408f00f11a07dea584</id>
<content type='text'>
So long as a port defines relevant mp_hal_pin_xxx functions (and delay) it
can make use of this software SPI class without the need for additional
code.
</content>
</entry>
<entry>
<title>extmod/machine_spi: Add optional support for fast software SPI.</title>
<updated>2016-10-04T02:46:40+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-04T02:46:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b0eb0d6153d63cf823065792db35d2858fbb9406'/>
<id>urn:sha1:b0eb0d6153d63cf823065792db35d2858fbb9406</id>
<content type='text'>
If a port defines MICROPY_PY_MACHINE_SPI_MIN_DELAY then it can use a
faster software SPI loop that does not make calls to the delay_us
function.
</content>
</entry>
<entry>
<title>extmod/machine_spi: Use delay_half, not baudrate, for internal timing.</title>
<updated>2016-10-04T02:43:02+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-04T02:43:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b932b2dd1faaf3091b13af7d213041a737e40fac'/>
<id>urn:sha1:b932b2dd1faaf3091b13af7d213041a737e40fac</id>
<content type='text'>
The delay_half parameter must be specified by the port to set up the
timing of the software SPI.  This allows the port to adjust the timing
value to better suit its timing characteristics, as well as provide a
more accurate printing of the baudrate.
</content>
</entry>
<entry>
<title>extmod/machine_spi: Factor out software SPI code from esp8266 to extmod.</title>
<updated>2016-10-03T05:43:44+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-03T05:43:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d434ce3fca088959c4a4bf525b9d730ec9bdb7b4'/>
<id>urn:sha1:d434ce3fca088959c4a4bf525b9d730ec9bdb7b4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>extmod/machine_spi: Simplify SPI xfer function to only take one buf len.</title>
<updated>2016-10-03T01:39:31+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-03T01:39:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5bb28c7f10ebd1036302cf7ac0b24a7a233de2aa'/>
<id>urn:sha1:5bb28c7f10ebd1036302cf7ac0b24a7a233de2aa</id>
<content type='text'>
There is no need to take src_len and dest_len arguments.  The case of
reading-only with a single output byte (originally src_len=1, dest_len&gt;1)
is now handled by using the output buffer as the input buffer, and using
memset to fill the output byte into this buffer.  This simplifies the
implementations of the spi_transfer protocol function.
</content>
</entry>
<entry>
<title>extmod: Add machine_spi with generic SPI C-protocol and helper methods.</title>
<updated>2016-09-01T05:07:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-01T05:07:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0823c1baf864f2e8fd60e49a5e42a958fd89ff43'/>
<id>urn:sha1:0823c1baf864f2e8fd60e49a5e42a958fd89ff43</id>
<content type='text'>
The idea is that all ports can use these helper methods and only need to
provide initialisation of the SPI bus, as well as a single transfer
function.  The coding pattern follows the stream protocol and helper
methods.
</content>
</entry>
</feed>
