25.7.3.13 Data Reordering
Data read from the source can be re-ordered to allow for various byte orders of the source data, such as endianness. The re-ordered source data is written to the channel destination when CHCTRLBk.WBOEN = 1’. The unaltered initial source data is written to the destination when CHCTRLBk.WBOEN = 0. The following figure shows the different byte order settings and the effect on data reads. BYTORD value of ‘01’ is useful for re-ordering bytes within words. While BYTORD values of ‘10’ and ‘11’ is useful for re-ordering bytes within half-words.
- Data is re-ordered as it is read. This means that data that is not word-aligned may not be re-ordered correctly. Both the block and cell sizes must also be word-aligned.
- The CRC will process data such that the final result is the same regardless of read address mode (byte, halfword, or word). This is completely transparent to software. This reordering for the CRC block is explained in more detail in CRC and Checksum Engine and is independent of the BYTORD setting for the channel. In this way, this would allow the user, in CRC mode, to byte reorder the data from source to destination using a different swapping than is required for the CRC calculation.
Byte Order | ||||
---|---|---|---|---|
3 | 2 | 1 | 0 | |
Source Address | 0x78 | 0x56 | 0x34 | 0x12 |
Destination Address | 0x12 | 0x34 | 0x56 | 0x78 |