2015-07-08 12:14 PM
Hello
Suppose data is arrived from dcmi in following order:1st byte : R[4:0]G[5:3]2nd byte : G[2:0]B[4:0]3rd byte : R[4:0]G[5:3]4th byte : G[2:0]B[4:0]...And so on, how it will be saved in memory?Thanks.2015-07-08 12:49 PM
And so on, how it will be saved in memory?
Just like that if you're doing 8-bit transfers. Looks to be a small-endian 5-6-5 type representation. You should be able to load as a 16-bit word and mask/shift the colour values out. The combinations should be rather small if it's some other format/order. Point the camera at different Red, Green and Blue sheets of card if that helps to separate the colour channels.2015-07-08 01:20 PM
I didn't explain completely, according to picture below the 2nd received byte is stacked at first byte of DCMI FIFO, my question is whether it will be the actual placement of data in memory(assuming little endian) or it will be placed as it was received?
2015-07-08 01:46 PM
Ok, but they still seem to be in order. If you believe the diagram the Red and Blue channels are swapped, but if you read the memory out 16-bits at a time the pixels will be in order.
I would take the Camera manual as the controlling document for the byte/bit ordering for what it's sending. The hardware's going to deliver the data in the order it's sent, there's no value to swizzling the bit/byte ordering at the DCMI/DMA level. The FIFO is there to provide elasticity where the inbound rate/size and outbound rate/size are not perfectly balanced.Point the camera at a solid red image, it should be quite apparent what channel R is.