Commit Graph

9 Commits

Author SHA1 Message Date
Damien George b932b2dd1f extmod/machine_spi: Use delay_half, not baudrate, for internal timing.
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.
2016-10-04 13:43:02 +11:00
Damien George d434ce3fca extmod/machine_spi: Factor out software SPI code from esp8266 to extmod. 2016-10-03 16:43:44 +11:00
Damien George 5bb28c7f10 extmod/machine_spi: Simplify SPI xfer function to only take one buf len.
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>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.
2016-10-03 12:39:31 +11:00
Damien George 5863e15a23 esp8266/modpybspi: Use generic SPI helper methods to implement SPI. 2016-09-01 16:39:42 +10:00
Radomir Dopieralski d076fae219 esp8266/modmachinespi: Add a factory method for SoftSPI/HSPI 2016-08-19 21:19:59 +03:00
Damien George 7e809b4baf esp8266/modpybspi: Configure pins when initialising an SPI object. 2016-05-26 15:42:44 +01:00
Damien George 4f2ba9fbdc esp8266: Convert to use new MP_Exxx errno symbols.
These symbols are still defined in terms of the system Exxx symbols, and
can be switched to internal numeric definitions at a later stage.

Note that extmod/modlwip still uses many system Exxx symbols.
2016-05-10 23:30:39 +01:00
Damien George b372156f74 esp8266: Change software SPI driver to use general pin HAL. 2016-04-22 10:44:06 +01:00
Damien George 82b95f625e esp8266: Implement software SPI class.
Supports speeds up to 500k baud, polarity=0/1, phase=0/1, and using any
pins.  Only supports MSB output at the moment.
2016-03-25 23:28:13 +02:00