|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set the number of transfers (number of triggers until complete) |
|
|
// Set the number of transfers (number of triggers until complete) |
|
|
void transferCount(unsigned int len) { |
|
|
void transferCount(unsigned int len) { |
|
|
if (len > 32767) return; |
|
|
|
|
|
if (len >= 512) { |
|
|
|
|
|
|
|
|
if (!(TCD->BITER & DMA_TCD_BITER_ELINK)) { |
|
|
|
|
|
if (len > 32767) return; |
|
|
TCD->BITER = len; |
|
|
TCD->BITER = len; |
|
|
TCD->CITER = len; |
|
|
TCD->CITER = len; |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
if (len > 511) return; |
|
|
TCD->BITER = (TCD->BITER & 0xFE00) | len; |
|
|
TCD->BITER = (TCD->BITER & 0xFE00) | len; |
|
|
TCD->CITER = (TCD->CITER & 0xFE00) | len; |
|
|
TCD->CITER = (TCD->CITER & 0xFE00) | len; |
|
|
} |
|
|
} |