Part Number: CC2640
Tool/software: TI-RTOS
Hi Forum
I searched the forum quite a bit and I didn't find any solution which fits my usage.
I have a custom board with a SPI sensor and a SPI Flash, both use the same SPI bus (but different CS of course). I'm now curious, how I could use the SPI driver to fit both chip selects.
I use the SPI driver via SPI_MODE_CALLBACK, and have already written a running system with the sensor. Now I want to add the FLASH functionality and I have trouble to do the correct approach:
Do I rather
- make a new SPI1 handle, which shares the same MISO, MOSI and SCK pins as the SPI0 device, but with another CS? Is it possible to do this? The SPI0 handle is then used to access the sensor and the SPI1 handle is used to access the Flash?
- Do I reconfigure the SPI0 every time I use a different CS? If so, should I first call SPI_close, then SPI:open with the other index and params?
I don't want to use the CS as a dedicated GPIO, because I can only reset the CS in the SPI transfer finish callback function, and there I need to start a new transaction right away: the time which a CS-GPIO pin is high would then be too low!
I really hope you can understand my question and my issues and could give me an elegant solution.
Best Regards,
Matthias