So far in terms of just compilation, the issues I've found:
1) In sdc_lld_wait_transaction_end(), this code:
Code: Select all
/* Wait until DMA channel enabled to be sure that all data transferred.*/
while (sdcp->dma->stream->CR & STM32_DMA_CR_EN)
;
is DMAv2 specific. From what I can tell DMAv1 equivalent would be more like:
Code: Select all
while (sdcp->dma->channel->CCR & DMA_CCR_EN )
;
Is there something at the higher level that could abstract this? If not, is it ok to add it? Something like dmaStreamIsEnabled(), alongside the dmaStreamEnable() macro perhaps?
2. In sdc_lld_start(), the #if 1 code doesn't compile with DMAv1.
Code: Select all
#if 1
sdcp->dmamode |= STM32_DMA_CR_PFCTRL |
STM32_DMA_CR_PBURST_INCR4 |
STM32_DMA_CR_MBURST_INCR4;
#endif
Code: Select all
#if 1
dmaStreamSetFIFO(sdcp->dma, STM32_DMA_FCR_DMDIS | STM32_DMA_FCR_FTH_FULL);
#endif
Is that why someone put it inside a #if? Is there a more correct #define symbol that could be used here? Or could this be abstracted out into the DMA interface? What does it do?
Any help appreciated, Paul.