SPI Driver issue
Posted: Mon Feb 04, 2013 9:36 am
Hi All,
I'm using a 7" LCD SSD1963 display with an on-board SPI Flash memory (W25Q16V), SPI Touch Screen controller (XPT2046), and SPI microSD.
The microSD is accessed using the MMC over SPI driver, the TouchScreen uses the driver provided by the Chibios/GFX lib, and the flash driver is implemented by me.
I've tested all these modules separately and they are working ok.
The problem is that I cannot use all 3 at the same time (every one of them has a separate CS). All modules are using the SPI driver from ChibiOS HAL.
Is there a way to configure the SPI driver to access multiple devices on the same SPI bus?
The workaround found was to call spiStart() every time the SPI bus was accessed (I had to modify the MMC over SPI driver for this). This way the spiconfig is set properly before every access.
The spiAcquireBus/spiReleaseBus functions are not helping me in this situation (all 3 modules are accessed from the same thread).
Thanks,
George
I'm using a 7" LCD SSD1963 display with an on-board SPI Flash memory (W25Q16V), SPI Touch Screen controller (XPT2046), and SPI microSD.
The microSD is accessed using the MMC over SPI driver, the TouchScreen uses the driver provided by the Chibios/GFX lib, and the flash driver is implemented by me.
I've tested all these modules separately and they are working ok.
The problem is that I cannot use all 3 at the same time (every one of them has a separate CS). All modules are using the SPI driver from ChibiOS HAL.
Is there a way to configure the SPI driver to access multiple devices on the same SPI bus?
The workaround found was to call spiStart() every time the SPI bus was accessed (I had to modify the MMC over SPI driver for this). This way the spiconfig is set properly before every access.
The spiAcquireBus/spiReleaseBus functions are not helping me in this situation (all 3 modules are accessed from the same thread).
Thanks,
George