ESP8266 Arduino Core Documentation
Release 3.1.2-21-ga348833
Ivan Grokhotkov
Aug 29, 2023
4.5 SPI
SPI library supports the entire Arduino SPI API including transactions, including setting phase (CPHA). Setting the Clock polarity (CPOL) is not supported, yet (SPI_MODE2 and SPI_MODE3 not working).
There’s an extended mode where you can swap the normal pins to the SPI0 hardware pins. This is enabled by calling SPI.pins(6, 7, 8, 0) before the call to SPI.begin(). The pins would change to:
This mode shares the SPI pins with the controller that reads the program code from flash and is controlled by a hardware arbiter (the flash has always higher priority). For this mode the CS will be controlled by hardware as you can’t handle the CS line with a GPIO, you never actually know when the arbiter is going to grant you access to the bus so you must let it handle CS automatically
11.20 NodeMCU 1.0 (ESP-12E Module)
This module is sold under many names for around $6.50 on AliExpress and it’s one of the cheapest, fully integrated ESP8266 solutions. It’s an open hardware design with an ESP-12E core and 4 MB of SPI flash.
According to the manufacturer, “with a micro USB cable, you can connect NodeMCU devkit to your laptop and flash it without any trouble”. This is more or less true: the board comes with a CP2102 onboard USB to serial adapter which just works, well, the majority of the time. Sometimes flashing fails and you have to reset the board by holding down FLASH + RST, then releasing FLASH, then releasing RST. This forces the CP2102 device to power cycle and to be re-numbered by Linux.
The board also features a NCP1117 voltage regulator, a blue LED on GPIO16 and a 20k/100k Ohm voltage divider on the ADC input pin. The ESP-12E usually has a led connected on GPIO2.
Yah, clear as mud. Maybe the documentation should not even mention "extended mode where you swap the normal pins to the SPI0 hardware pins", since it seems you can't.
I have decided that the ESP8266 will not do what I need it to do (external serial port and SD card). I'm now looking at the ESP32.