Other Parts Discussed in Thread: ADS1298, ADS1292
I have a task that currently uses the MCU to read data (SPI/I2C) from multiple sensors upon periodic interrupts generated by them (falling edge on GPIO pins). This task is lower priority than the BLE stack tasks but higher priority than a separate task that processes the sensor data. The data processing task blocks until a semaphore is posted from this data reading task. This seems to be working reasonably well. I want to begin optimizing the system and integrate the sensor control to read the SPI/I2C data.
Currently the sensor reading task blocks until any sensor sets a hwi. The hwi Interrupt handler only posts a semaphore (with event message) to unblock this task. I'll start with one SPI sensor. My questions are:
- Can I use a GPIO to detect an edge? From the sensor controller studio, it seems that I can detect high or low level only (and it's polled by the sensor controller task).
- The sensor is ADS1298 which does not have a FIFO. So I want to buffer multiple samples into an array and after say 8 samples, wake up the data processing task. How to I do multiple reads into an array, each time incrementing the starting address?
- On the 8th read, is it possible to post to the same semaphore queue that's posted by the data reading task to wake up the data processing task? I need to know the event that caused wakeup since there are multiple data sources. Or do I need to make a new task for each sensor that uses the sensor controller?
- After the wake up, how do I read/copy the the array into the data processing task?
Thanks!
