Master Spi Api Function Description - Espressif ESP8266 Technical Reference

Hide thumbs Also See for ESP8266:
Table of Contents

Advertisement

!
! Note:
Yellow line: CS, blue line: CLK, red line: MOSI, green line: MISO.

4.4.2. Master SPI API Function Description

1. void spi_slave_init(uint8 spi_no)
Function:
Initialization of slave SPI mode. Configure IO interface to SPI mode, enable SPI
transmission interruption and register the function spi_slave_isr_handler.
Communication format is set at 7bits command +1bit address+8bits read/write data.
Command and address combines to be high 8 bits and the address must be 0. According
to descriptions in 3.3, it supports the three master commands, i.e. 0x04 master write and
slave read, 0x06master write and slave read, 0x0c master and slave read/write. The
communication waveform is illustrated in Figure 4-1, 4-2.
Parameters:
spi_no The number of SPI module. ESP8266 processor has two SPI modules with the
same function, i.e. SPI and HSPI.
Optional values: SPI or HSPI.
2. spi_slave_isr_handler(void *para)
Function and trigger condition:
SPI interrupt processing function. Interruption will be triggered if the master operates the
correct transmission operation(read/write slave).
Code:
Espressif
!
Figure 4-2. The slave waveform of spi_byte_read_espslave read from ESP8266
//0x3ff00020 is isr flag register, bit4 is for spi isr,
if(READ_PERI_REG(0x3ff00020)&BIT4){
25 86
!
/!
4. SPI Communication User 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

Subscribe to Our Youtube Channel

Table of Contents

Save PDF