ESP8266 Developer Zone The Official ESP8266 Forum 2016-04-18T18:01:57+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=2044 2016-04-18T18:01:57+08:00 2016-04-18T18:01:57+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2044&p=6512#p6512 <![CDATA[Re: SPI overlap]]> Function spi_overlap_init() ans spi_overlap_deinit() is the same!!!

Code:

void ICACHE_FLASH_ATTR
hspi_overlap_init(void)
{
   //hspi overlap to spi, two spi masters on cspi
   SET_PERI_REG_MASK(HOST_INF_SEL, reg_cspi_overlap);

   //set higher priority for spi than hspi
   SET_PERI_REG_MASK(SPI_EXT3(SPI),0x1);
   SET_PERI_REG_MASK(SPI_EXT3(HSPI),0x3);
   SET_PERI_REG_MASK(SPI_USER(HSPI), BIT(5));
}


Code:

void ICACHE_FLASH_ATTR
hspi_overlap_deinit(void)
{
   //hspi overlap to spi, two spi masters on cspi
   CLEAR_PERI_REG_MASK(HOST_INF_SEL, reg_cspi_overlap);

   //set higher priority for spi than hspi
   CLEAR_PERI_REG_MASK(SPI_EXT3(SPI),0x1);
   CLEAR_PERI_REG_MASK(SPI_EXT3(HSPI),0x3);
   CLEAR_PERI_REG_MASK(SPI_USER(HSPI), BIT(5));
}


And deinit not working when I testes connect SPI RAM to SPI and my SPI device to HSPI and I try to switch between them because I can not find a solution to connect these two devices to together SPI (to which is also connected FLASH to).

What is correct function to deinit spi overlat? Thanks.

Statistics: Posted by mgrunt — Mon Apr 18, 2016 6:01 pm


]]>
2016-04-17T17:05:14+08:00 2016-04-17T17:05:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2044&p=6495#p6495 <![CDATA[SPI overlap]]> I have SPI RAM (23LC1024) which is connected to SPI (no HSPI) and using this functions to init - spiRamInit() which includes SPI overlap:
https://github.com/espressif/ESP8266_MP ... r/spiram.c

Now I can connect to same SPI second device (now I have connect to HSPI bud I can reconnect to SPI, together to RAM), bud I don't know how to drive CS. I drive CS on second device manually, and now is configured and used by this way...

Configure CS PIN:
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, FUNC_GPIO15);// configure SPI CS (set manualy)

Using:
PIN_OUT_SET |= (1<<CS_PIN);

How to reconfigure CS to second device for SPI overlap?

Thanks, MG

Statistics: Posted by mgrunt — Sun Apr 17, 2016 5:05 pm


]]>