Depending on your specific use case for the ADC, I would not consider using
the ALSA drivers. I guess you want to use McBSP in SPI mode and use the
frame sync signal for sample generation? – Then the best choice is to write
an ADC char driver that utilizes the McBSP library directly.
I have written an ADC char driver that does exactly this. I had to correct a
few small errors in the Linux McBSP library code and in the DMA library as
well to get it to work, but other than that it went pretty smooth.
If you have any additional questions, feel free to ask.
Thomas Søhus, CeePro | Embedded solutions, www.ceepro.dk
From: Alex Stewart [mailto:email@example.com]
Sent: 22. december 2009 15:28
To: General mailing list for gumstix users.
Subject: [Gumstix-users] ADC/ McBSP advice and questions about writing a
No virus found in this incoming message.
Hello gumstix list!
Hopefully some kind sole can help me.
My goal is to connect a serial ADC to McBSP3. It must be a McBSP (and not
McSPI) so we can use the sample rate generator to run the sample clock. I've
got an overo water and a chestnut board. My question is what is the best way
to go about writing the code. I see I can either write a driver that
interfaces to the McBSP library in the kernel, or add the ADC into the ALSA
framework. Initially I thought adding to the ALSA framework would be the
easier task, but as a hardware engineer I quickly got lost in the layers of
abstraction and could not figure it out. So I tried writing a simple char
driver wrapper for the McBSP library. Am I correct in thinking the steps to
get this all working are to request the bsp, stop the bsp, configure it,
then issue a mcbsp start, at which point I can call things like
omap_mcbsp_xmit_word? Thats what my code currently does but it hangs at the
"wait_for_completion" line in the xmid_word code.
I realize seeing my driver code would help, but I wanted to get to the root
question first. Is writing a simple char driver to DMA my raw adc data into
a userspace buffer easier than simply not reinventing the wheel and adding
support for my adc into the ALSA stuff...?
Thanks for the help and advice!
Checked by AVG - www.avg.com
Version: 9.0.717 / Virus Database: 270.14.117/2581 - Release Date: 12/22/09
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
gumstix-users mailing list