Espressif ESP8266 Technical Reference page 51

Hide thumbs Also See for ESP8266:
Table of Contents

Advertisement

!
//wr_rdy: ready to conduct the next SPI write operation
//rd_rdy: ready to conduct the next SPI read operation
unsigned char wr_rdy=1,rd_rdy=0;
void spi_read_func(....)
{
}
void spi_write_func(...)
{
}
GPIO0_Raising_Edge_ISR() // rising edge interrupt program connected
to the ESP8266 GPIO0
{
Espressif
// before starting the read operation, check if there is new
data for the slave to read (rd_rdy is non-0);
// also, check if the previous write operation is completed;
write operationcompleted and processing data (signal GPIO0 is
0), or new data can be written into the slave (wr_rdy is non-0)
if(rd_rdy&&((GPIO0= =0)||wr_rdy)){
rd_rdy=0;
//rd_rdy set to be 0
spi_transmit(0x03,0,*read_buff);// start the SPI transmission,
command 3 + address 0 + 32 bytes of data
....
}
// before starting the write operation, check if there is new
data for the slave to receive (rd_rdy is non-0);
// also, check if the previous read operation is completed;
completed, no new data to be read (signal GPIO2 is 0), or new
data to be read (rd_rdy is non-0)
if(wr_rdy&&((GPIO2= =0)||rd_rdy)){
wr_rdy=0;
//wr_rdy set to be 0
spi_transmit(0x02,0,*write_buff);// start the SPI transmission,
command 2 + address 0 + 32 bytes of data
...
}
wr_rdy=1;
// data sent by the master has been processed,
ready for the next write operation
7. SPI Wi-Fi Passthrough 2-Interrupt Mode
42 86
!
/!
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