|
|
|
|
|
|
|
|
void transferSize(unsigned int len) { |
|
|
void transferSize(unsigned int len) { |
|
|
uint32_t dcr = CFG->DCR & 0xF0C8FFFF; |
|
|
uint32_t dcr = CFG->DCR & 0xF0C8FFFF; |
|
|
if (len == 4) { |
|
|
if (len == 4) { |
|
|
CFG->DCR = dcr | DMA_DCR_DSIZE(0) | DMA_DCR_DSIZE(0); |
|
|
|
|
|
|
|
|
CFG->DCR = dcr | DMA_DCR_SSIZE(0) | DMA_DCR_DSIZE(0); |
|
|
} else if (len == 2) { |
|
|
} else if (len == 2) { |
|
|
CFG->DCR = dcr | DMA_DCR_DSIZE(2) | DMA_DCR_DSIZE(2); |
|
|
|
|
|
|
|
|
CFG->DCR = dcr | DMA_DCR_SSIZE(2) | DMA_DCR_DSIZE(2); |
|
|
} else { |
|
|
} else { |
|
|
CFG->DCR = dcr | DMA_DCR_DSIZE(1) | DMA_DCR_DSIZE(1); |
|
|
|
|
|
|
|
|
CFG->DCR = dcr | DMA_DCR_SSIZE(1) | DMA_DCR_DSIZE(1); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|