spi用于接外部Flash和读卡IC , 功能需求:
外部Flash: 读写都是通过system CPU操作SPI来完成
读卡IC: 每330ms使用sensor controller操作SPI做一次检卡 , 检测到卡片之后唤醒system CPU操作SPI来读卡
实测发现sensor controller和system CPU只有一个能对SPI进行操作 , 应该怎样实现sensor controller和system CPU都能对SPI进行控制 ?
Viki Shi:
根据你的描述,SCS检卡完成后,如果有卡则唤醒System CPU进行操作,这个流程是完全可行的,你是通过Sensor Controller Studio来操作的吗?Sensor Controller Studio生成的代码类似与一个驱动接口,相应的参数都会包含进去,像firmware,相关定义,基本函数等,System CPU可以据此 去控制SCS并进行数据操作。
SCS里有SPI部分的资料,请参考一下: C:\Program Files (x86)\Texas Instruments\Sensor Controller Studio\resource_docs\spi_data_transfer.html
AndyChen:
e2e.ti.com/…/761174
Hi Andy,
Yes, but it requires manual management by the application. The Sensor Controller task can safely access the SPI pins, as long as the main application is not accessing it, and vice versa. Since the SC task is dependent on the main application to know when it is safe to access the SPI pins, the management logic has to be implemented in the main application.
From a software point of view, this means that the main application can open an SPI handle and use it when it know the SC task is not accessing it, and has to close the handle when the SC task is to access them. However, before the main application is to reschedule the SC task, the IO pins must be re-initialized for the Sensor Controller. This is done with the scifReinitIo() API.
There exists an example of shared IO pins in Sensor Controller Studio, found under launchpad/Shared IO Pins.
Regards,
Severin Suveren
灰小子:
推荐使用Sensor Controller Studio来进行开发,很方便和快捷,大部分代码只需要点点鼠标
TI中文支持网


