2010-10-20 19:21:56 SPI AD7476A-DBRD DMA example?
Brian Nelson (UNITED STATES)
Message: 94785
Hi,
I've looked at the Wiki entries for "Direct Memory Access (DMA)" and
"Sample SPI DMA Driver", and have poked through some of the
driver source and header files, but I'm still not sure exactly how
to set up a block DMA access for a AD7476A-DBRD.
Basically, I want to set up the ADC to stream a fixed total number of
samples to SDRAM via DMA, while my device driver is running. Knowing
the address of the DMA block, and the time the DMA started, I'd like to read
some of the previously-stored samples to do some calculations to
program timer settings. Is this possible?
Any suggestions of code to study would be greatly appreciated.
Thanks,
Brian
QuoteReplyEditDelete
2010-10-21 00:43:42 Re: SPI AD7476A-DBRD DMA example?
Sonic Zhang (CHINA)
Message: 94790
You may use sport to read samples via DMA. Please refer to linux-2.6.x/drivers/char/bfin_sport.c and user/blkfin-apps/ndso/src_ndso/ndso.c in svn trunk for an example.
QuoteReplyEditDelete
2010-10-21 16:03:17 Re: SPI AD7476A-DBRD DMA example?
Brian Nelson (UNITED STATES)
Message: 94821
Thanks for the speedy reply.
For the time being, I need to use my existing SPI AD7476A-DBRD card, unless
there is a SPORT ADC card available for the STAMP board (?).
I don't see DMA in the ndso.c code, so I'm not sure I can use that.
I see the Wiki page:
docs.blackfin.uclinux.org/doku.php?id=dma_systems
cites code from an older release (R05R4-RC2), viz., adsp-spiadc.c; it looks
like if the API it uses is still valid, I may be able to modify that.
It seems like the more modern version is bfin_spi_adc.c, from:
docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:example_dma_spi
but I'm still not sure exactly how to call these (I can't find userland
code that calls these drivers).
I'l try grabbing chunks of these two drivers to put in my char driver. Basically
I just want to start taking a block of ADC data when I get a trigger, and use the
SDRAM data in my driver.
Brian
QuoteReplyEditDelete
2010-10-21 16:23:05 Re: SPI AD7476A-DBRD DMA example?
Brian Nelson (UNITED STATES)
Message: 94823
Oops, just stumbled upon:
docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:bfin-dma
and the directories user/blkfin-test/...
Might be some help in there.