HI!
I need some help!
Please someone can explain to me in the DSO nano firmware 1, how is linked “Ain” with “Scan_buffer” and “vbat” with “ADC1_DR_ADDR” in DMA setup? (Ain and vbat are set in GPIO configuration).
in others words, how is linked that pin with that register or memory position
THANKS!
software fragment:
/*******************************************************************************
-
DMA configuration
*******************************************************************************/
void DMA_Configuration(void)
{
DMA_ISR = 0x00000000;/DMA interrupt status register
|||||||±–GIF1 =0
|||||||±–TCIF1=0
|||||||±–HTIF1=0
|||||||±–TEIF1=0
|+++++±—Reset value
±---------Reserved/
DMA_IFCR= 0x00000000;/DMA interrupt flag clear register
|||||||±–CGIF1 =0
|||||||±–CTCIF1=0
|||||||±–CHTIF1=0
|||||||±–CTEIF1=0
|+++++±—Reset value
±---------Reserved/
DMA_CCR1= 0x00003580;/0011 0101 1000 0000
|||| |||| |||| |||| |||±-EN = 0
|||| |||| |||| |||| ||±–TCIE=0
|||| |||| |||| |||| |±—HTIE=0
|||| |||| |||| |||| ±----TEIE=0
|||| |||| |||| |||±------DIR =0
|||| |||| |||| ||±-------CIRC=0
|||| |||| |||| |±--------PINC=0
|||| |||| |||| ±---------MINC=1
|||| |||| ||+±-----------PSIZE=01
|||| |||| +±-------------MSIZE=01
|||| ||+±----------------PL=11
|||| |±------------------MEM2MEM=0
+++±------±-------------------Reserved/DMA_CNDTR1=0x00001000; //DMA channel1 number of data register=4096*2 Bytes
DMA_CPAR1 = ADC1_DR_ADDR; //DMA channel1 peripheral address register
DMA_CMAR1 =(u32)&Scan_Buffer[0];//DMA channel1 memory address register
DMA_CCR1 |= 0x00000001; //DMA channel1 EN = 1