esp8266-technical_reference_en.pdf

(3674 KB) Pobierz
ESP8266
Technical Reference
Version 1.3
Copyright © 2017
About This Guide
This document provides introduction to the interfaces integrated on ESP8266. Functional
overview, parameter configuration, function description, application demos and other
information is included.
The document is structured as below.
Chapter
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Overview
GPIO
SPI Compatibility Mode
User Guide
SPI Communication User
Guide
SPI Overlap & Display
Application Guide
SPI Wi-Fi Passthrough 1-
Interrupt Mode
SPI Wi-Fi Passthrough 2-
Interrupt Mode
HSPI Host Multi-device
API
I2C User Guide
I2S Module Description
Title
Subject
Overall introduction to the interfaces.
Description of GPIO functions, registers and parameter
configuration.
Description of functions, DEMO solution, ESP8266 software
instruction and STM32 software solution.
Description of SPI functions, master/slave protocol format and API
functions.
Description of SPI functions, hardware connection of SPI overlap
mode, API description and display screen console program demo.
Description of SPI functions, SPI slave protocol format, slave status
and line breakage and API functions.
Description of SPI functions, SPI slave protocol format, data flow
control line and API functions.
Description of HSPI functions, hardware connection and API
functions.
Description of I2C functions, master interface and demo.
Description of I2S functions, system configuration and API
functions.
Description of UART functions, hardware resources, parameter
configuration, interrupt configuration, example of interrupt handler
process and abandon serial output during booting.
Description of PWM functions PWM, detailed on
pwm.h,
and
custom channels.
Introduction on infrared transmission, parameter configuration and
functions of sample codes.
Introduction on Sniffer, application scenarios, phone App and IOT-
device firmware.
GPIO registers, SPI registers, UART registers, Timer registers.
Chapter 11
UART Introduction
Chapter 12
Chapter 13
Chapter 14
Appendix
PWM Interface
IR Remote Control User
Guide
Sniffer Introduction
Appendix
Release Notes
Date
2016.05
Version
V1.0
First release.
Release notes
Date
2016.06
2016.08
2017.05
Version
V1.1
V1.2
V1.3
Release notes
Added
Section 4.5 Interface Description.
Updated
Section 14.1 Sniffer Introduction.
Updated
Section 4.1.2 SPI Features.
Table of Contents
1. Overview .................................................................................................................................1
1.1. General Purpose Input/Output Interface (GPIO) ........................................................................1
1.2. Secure Digital Input/Output Interface (SDIO) .............................................................................1
1.3. Serial Peripheral Interface (SPI/HSPI) ........................................................................................1
1.3.1.
1.3.2.
General SPI (Master/Slave) ...........................................................................................2
HSPI (Slave) .................................................................................................................. 2
1.4. I2C Interface ...............................................................................................................................2
1.5. I2S Interface ...............................................................................................................................3
1.6. Universal Asynchronous Receiver Transmitter (UART) .............................................................. 3
1.7. Pulse-Width Modulation (PWM) .................................................................................................4
1.8. IR Remote Control
......................................................................................................................4
1.9. Sniffer .........................................................................................................................................5
2. GPIO .......................................................................................................................................6
2.1. Functional Overview
...................................................................................................................6
2.2. Instruction on GPIO Registers ...................................................................................................7
2.2.1.
2.2.2.
2.2.3.
2.2.4.
2.2.5.
2.3.1.
2.3.2.
2.3.3.
2.3.4.
2.3.5.
GPIO Function Selection Register ................................................................................ 7
GPIO Output Registers ................................................................................................. 7
GPIO Input Register
......................................................................................................8
GPIO Interrupt Registers ..............................................................................................8
GPIO16 Related APIs ...................................................................................................9
Parameter Configuration for Scene 1 ...........................................................................9
Parameter Configuration for Scene 2 .........................................................................10
Parameter Configuration for Scene 3 .........................................................................11
Interrupt Function Processing Procedures .................................................................12
Example of The Interrupt Function Processing Procedures .......................................12
2.3. Parameter onfiguration
...............................................................................................................9
3. SPI Compatibility Mode User Guide
....................................................................................13
3.1. Functional Overview
.................................................................................................................13
3.2. DEMO Solution ........................................................................................................................13
3.2.1.
3.2.2.
3.2.3.
Introduction
................................................................................................................. 13
ESP8266 Software Compiling and Downloading .......................................................13
ESP8266 FLASH Software Downloading ...................................................................14
3.2.4.
3.3.1.
3.3.2.
3.3.3.
3.4.1.
ESP8266 FLASH Software Downloading ...................................................................14
Protocol Principle: SDIO Line Breakage and SDIO Status Register
...........................15
Instructions on The Read/Write Buffer and The Registration Linked List
...................16
API Functions in The ESP8266 DEMO .......................................................................17
Important functions
.....................................................................................................18
3.3. ESP8266 Software Instruction .................................................................................................15
3.4. STM32 Software Instruction ....................................................................................................18
4. SPI Communication User Guide
........................................................................................... 21
4.1. Overview ..................................................................................................................................21
4.1.1.
4.1.2.
4.2.1.
4.2.2.
4.3.1.
4.3.2.
4.3.3.
4.3.4.
4.4.1.
4.4.2.
4.5.1.
4.5.2.
4.5.3.
Functional Overview ...................................................................................................21
SPI Features ............................................................................................................... 21
Communication Format Supported by Master SPI ....................................................21
Master SPI Communication Format Supported by Current API
.................................22
SPI Slave Clock Polarity Configuration Requirement .................................................22
Communication Format Supported by Slave SPI
.......................................................22
Command Definition Supported by Slave SPI
............................................................ 22
Slave SPI Communication Format Supported by Current API ...................................23
API Function Description of Master SPI .....................................................................23
Master SPI API Function Description .........................................................................25
Data Structure
.............................................................................................................27
API Description ...........................................................................................................30
SPI_Test Demo ...........................................................................................................35
4.2. ESP8266 SPI Master Protocol Format
.....................................................................................21
4.3. ESP8266 SPI Slave Protocol Format .......................................................................................22
4.4. API Function Description of SPI Module
..................................................................................23
4.5. SPI Interface Description .........................................................................................................27
5. SPI Overlap & Display Application Guide .............................................................................46
5.1. Functional Overview
.................................................................................................................46
5.2. Hardware Connection of SPI Overlap Mode ............................................................................47
5.3. API Description of SPI Overlap Mode ......................................................................................47
5.4. Display Screen Console Program DEMO
.................................................................................48
5.4.1.
5.4.2.
5.4.3.
Connection Description .............................................................................................. 48
API Function Description ............................................................................................48
Pre-compiled Macro Setting
.......................................................................................50
6. SPI Wi-Fi Passthrough 1-Interrupt Mode .............................................................................51
Zgłoś jeśli naruszono regulamin