Hardware Connection Of Spi Overlap Mode; Api Description Of Spi Overlap Mode - Espressif ESP8266 Technical Reference

Hide thumbs Also See for ESP8266:
Table of Contents

Advertisement

!
Please refer to Chapter 4 EPS8266 SPI Communication User Guide for more
information about the application method of Host SPI Module. The configuration method of
Overlap mode is discussed in detail below.

5.2. Hardware Connection of SPI Overlap Mode

Pins including SD_CLK, SD_DATA0, and SD_DATA1 correspond to pins SCLK, MISO and
MOSI in two SPI modes, while pins SD_CMD, U0TXD, and GPIO0 correspond to chip
selection (CS) signals CS0, CS1, and CS2 respectively. Generally, SD_CMD connects to
the CS signal of an external Flash, while U0TXD and GPIO0 can be connect with the CS
signals of two slave devices. It can connect to the CS signal of two salve devices. Besides,
HSPI can read and write Flash data through enabled CS0, independent of SPI (e.g. Read
some pre-stored user data).
If more SPI devices are needed, device can be selected via other GPIOs, while CS0, CS1,
and CS2 are blocked by the configuration register.

5.3. API Description of SPI Overlap Mode

1. void hapi_overlap_init(void)
Function:
After SPI Overlap mode has been initialized, and SPI and HSPI interfaces are invoked,
interfaces including CLK, MOSI, and MISO can be shared with SPI and HSPI interfaces to
communicate with different devices. By default, CS2 is the CS signal of HSPI interface.
Please be careful when switching CS signals during communication.
Location:
\app\user\user_main.c in the DEMO.
2. SELECT_OLED(),SELECT_TFT()
Function:
Switch the CS pin of HSPI and OLED in DEMO connects to CS2. TFTLCD connects to
CS1. Before the start of HSPI communication, macro needs to be called. The macro
definition is as follows:
#define SELECT_OLED()
SPI_CS2_DIS);\
SET_PERI_REG_MASK(SPI_PIN(HSPI), SPI_CS0_DIS |SPI_CS1_DIS)
#define SELECT_TFT()
SPI_CS1_DIS);\
SET_PERI_REG_MASK(SPI_PIN(HSPI), SPI_CS0_DIS |SPI_CS2_DIS)
Therefore, users can change the macro definition. For example, the following macro can be
defined if HSPI is used to the operate Flash:
#define SELECT_FLASH()
SPI_CS0_DIS);\
Espressif
CLEAR_PERI_REG_MASK(SPI_PIN(HSPI),
CLEAR_PERI_REG_MASK(SPI_PIN(HSPI),
CLEAR_PERI_REG_MASK(SPI_PIN(HSPI),
29 86
!
/!
5. SPI Overlap & Display Application Guide
2016.05

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP8266 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF