Multi-slave SPI
Moderators: RoccoMarco, lbednarz, tfAteba
Multi-slave SPI
In SPIConfig, there is a field for CS port and line, which is saved for later use with spiSelect(). This works well with a single slave, but if I want to use SPI as a bus (with one CS line per slave and the other lines shared) I'm not sure how to stop spiSelect() from asserting the same one each time.
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Multi-slave SPI
Hi,
Just define multiple configuration structures, each one defining its own CS and communication parameters, then use spiStart() to switch among configurations, you don't need to perform a spiStop(), just spiStart().
Giovanni
Just define multiple configuration structures, each one defining its own CS and communication parameters, then use spiStart() to switch among configurations, you don't need to perform a spiStop(), just spiStart().
Giovanni
Re: Multi-slave SPI
Thanks for getting back to me so quick!
Is there any way to use SPI0 on the LPC2148? The lld code seems to be written for the SSP (ie SPI1).
Is there any way to use SPI0 on the LPC2148? The lld code seems to be written for the SSP (ie SPI1).
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Multi-slave SPI
Hi,
It is written for the SSP only, use the SPI should be possible but would require a rework in the driver.
Giovanni
It is written for the SSP only, use the SPI should be possible but would require a rework in the driver.
Giovanni