Hello.
I have a question regarding fat16lib's code.
You define the DMAC Channel HW Interface Number for SPI as
#define SPI_TX_IDX 1
#define SPI_RX_IDX 2
You are then using them to fill the field of the DMAC_CFG register in the DST_PER and RST_PER.
In the SAM3X datasheet, we have the following:
SRC_PER: Source with Peripheral identifier
Channel x Source Request is associated with peripheral identifier coded SRC_PER handshaking interface.
• DST_PER: Destination with Peripheral identifier
Channel x Destination Request is associated with peripheral identifier coded DST_PER handshaking interface.
And when searching for the peripheral identifers, we also see table 11-1, that lists all the peripherals with the Instance ID.
The SRC_PER and DST_PER are 4 bit values each. The peripherals are 45, thus they require 6 bits, so, we cannot add all the peripherals in the SRC_PER and DST_PER fields.
But then, how did you choose the values 1 and 2? Are these values random? What are they used for? How did you know what to do?
Thanks a lot!