Hello,
I'm using TI-RTOS with a TM4C1294 acting as a master via SPI to a slave TM4C123 slave device. The master can send various command to the slave to configure or perform other actions on the slave, this all works fine.
However, the slave also needs to generate an interrupt notification (via gpio pin) back to the master whenever it decodes a smpte timecode packet. These interrupts will stream at a rate of around 2kHz as the slave decodes packets and notifies the master to read the data from the slave and clear the interrupt. The The master must read the timecode packet data and acknowledge each interrupt to the slave via a SPI status command read to the slave.
However, other RTOS threads in my applicaiton will need to communicate with the slave via the same SPI bus to control functions provided by the slave. The slave will also be busy decoding timecode packets and notifying the master via gpio pin interrupt. The problem is my Hwi INT handler in the master will need to read over the same SPI bus to acknowledge interrupts from the slave. Since the same SPI bus can also be accessed from other threads in my application synchronously, how do I synchronize the asynch Hwi SPI reads with other tasks performing synchronous SPI reads over the same SPI port.
Should my INT notifcation handler post to a Swi and then use a global mutex or semaphore between the swi and other tasks making spi calls?
If this is not possible, perhaps it would be easier to setup another SPI channel to process just the interrupt data stream? Unfortunately, expensive hardware changes would be required to setup a second comm channel to a slave processor device.
Thanks in advance for any suggestions.
Regards
Bob Starr