From 8e7dfea803f618beaa2ad976dff0b196e449d5d9 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Tue, 7 Jun 2016 21:40:56 +0200 Subject: esp8266/modpybhspi: Add a HSPI module for hardware SPI support This module uses ESP8266's SPI hardware, which allows much higher speeds. It uses a library from https://github.com/MetalPhreak/ESP8266_SPI_Driver --- docs/esp8266/quickref.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs') diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst index 48543dfab..be58f9332 100644 --- a/docs/esp8266/quickref.rst +++ b/docs/esp8266/quickref.rst @@ -189,6 +189,20 @@ The SPI driver is implemented in software and works on all pins:: spi.write_readinto(b'1234', buf) # write to MOSI and read from MISO into the buffer spi.write_readinto(buf, buf) # write buf to MOSI and read MISO back into buf + +Hardware SPI +------------ + +The hardware SPI is faster (up to 80Mhz), but only works on following pins: +``MISO`` is gpio2, ``MOSI`` is gpio13, and ``SCK`` is gpio14. It has the same +methods as SPI, except for the pin parameters for the constructor and init +(as those are fixed). + + from machine import Pin, HSPI + + hspi = HSPI(baudrate=800000000, polarity=0, phase=0) + + I2C bus ------- -- cgit v1.2.3