Connecting an SPI device to WCD4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am trying to hook up an SPI device but am confused about which SPI interface to use. I am using 3.1.2 SDK with the WCD4_EVB.

The only one defined in platform.h/c is SPI1, but this seems to be used by the flash driver. I found some forum discussions that seemed to suggest multiple SPI devices are not feasible as of now.

Can someone please help with the following questions?

1. If I use SPI1 (albeit with a different chip select pin than flash), will this work without any changes to the platform files?

2. Is there any other SPI interface I can use? I saw references to SPI3 in platform.h but nothing is defined in platform files

3. What exactly is the flash code used for? Does it even make sense for me to think of sacrificing flash support to get my SPI device working?

Thanks in advance!

0 Likes
1 Solution
Anonymous
Not applicable

Yes , eventhough you're using different CS pin, you might have to do that, Are SPI APIs thread safe ?

ie; locking & unlocking using a mutex, Since you're sharing a resource you must do that.

Also ,if you're using SPI1 for multiple peripherals, the SPI modes, Clock frequency  used by these modules will be different and you might have to init the SPI for each specific peripheral before doing it's corresponding SPI operation.

View solution in original post

0 Likes
4 Replies