Recently I have a project to use a Linux host to communicate with ADS1299. I search the forums find TI does not support n ADS1299 Linux device driver. So I use my knowledge to write one for the ADC.
The goal of this driver is to read ADC data and transfer them to userspace. My idea is when the Linux host gets the DRDY signal from ADC, the interrupt is triggered, and the SPI read API of the driver will read data from the SPI bus. the data will fill into a buffer, when the buffer is full, the driver sends a SIGNAL to the userspace program, and the data in the buffer will be read by the userspace.
Although this idea is not a perfect plan to realize my goal, I finish the code above. However, I face a question that makes my goal failed.
The SPI transfer API of the Linux host should be put into the bottom half of the interrupt(due to the sleep mechanic of SPI API), that is to say, if the sample rate of AD is too fast, the bottom half of the interrupt may read a delayed data of ADC, when I use 4ksps, there are 7997 interrupts, but only 7907 data has been read. When I use 250sps, my idea is OK. But, I should use at least 4ksps.
I do not know whether you have some experience of this problem, or your customer has a similar question, or maybe my framework is not suited for the high-speed ADC, or if you have some other ADC(SPI transfer) which have a Linux device driver to be a reference, I hope you can help me, thanks a lot.