| Electronic Components Datasheet Search |
|
ESP8266 Datasheet(PDF) 47 Page - ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD. |
|
|
|||||||||||||||||||||||||||||
ESP8266 Datasheet(HTML) 47 Page - ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD. |
|
47 / 117 page ![]() ! 4. SPI Communication User Guide spiData.addr = &addr; spiData.addrLen = 0; spiData.data = sendData; spiData.dataLen = 4; SPIMasterSendData(SpiNum_HSPI, &spiData); os_printf("\r\n Master receive 4 bytes data from slaver\n"); spiData.cmd = MASTER_READ_DATA_FROM_SLAVE_CMD; spiData.cmdLen = 0; spiData.addr = &addr; spiData.addrLen = 0; spiData.data = sendData; spiData.dataLen = 4; os_memset(sendData, 0, sizeof(sendData)); SPIMasterRecvData(SpiNum_HSPI, &spiData); os_printf(" Recv Slave data[0x%08x]\r\n", sendData[0]); #endif } spi_slave_test The SPI buffer used by the slave starts from W8. The program configures SPI mode first and initializes GPIO. Then it receives the data from the master and uploads the data to SPI buffer, waiting for the master to read. Finally, the program will modify the value of the status register. void ICACHE_FLASH_ATTR spi_slave_test() { // SPI initialization configuration, speed = 0 in slave mode SpiAttr hSpiAttr; hSpiAttr.bitOrder = SpiBitOrder_MSBFirst; hSpiAttr.speed = 0; hSpiAttr.mode = SpiMode_Slave; hSpiAttr.subMode = SpiSubMode_0; // Init HSPI GPIO WRITE_PERI_REG(PERIPHS_IO_MUX, 0x105); Espressif ! /! 39 104 2017.05 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |