How do I access RGB image data on the M0 core?

169 views
Skip to first unread message

Joshua

unread,
Jul 25, 2017, 3:18:15 PM7/25/17
to pixy_firmware_sdk
Hello,
I've modified the firmware(with LPCXpresso) to grab raw sensor data on the M0 core, turn it into a heavily scaled down(64x40) binary image(just black and white) and send it forth to the M4. All of that is working fine. But I still don't exactly understand the way I'm getting the data.
I'd like to get an explanation of what the functions

_ASM_FUNC void lineM1R2(uint32_t *gpio, uint16_t *memory, uint32_t xoffset, uint32_t xwidth)

and

_ASM_FUNC void lineM1R2Merge(uint32_t *gpio, uint16_t *lineMemory, uint8_t *memory, uint32_t xoffset, uint32_t xwidth)

in https://github.com/charmedlabs/pixy/blob/master/src/device/libpixy_m0/src/frame_m0.c actually write in the specified memory locations, and how.
I think it's the RGB data, but I wasn't able to understand what they do, since their function bodies consist of strange Assembly-like calls. I chose to use these functions because I want the smallest possible resolution(320x200).
Right now, i call

lineM1R2((uint32_t *)&CAM_PORT, my_memory_pointer, 0, CAM_RES2_WIDTH);

to write 320 bytes of pixel data, from one pixel line, into the specified memory location. I have no idea what these represent, but I figured out I can use them as grayscale values. However, now I need to get the complete RGB data. I understand that Pixy doesn't have enough RAM to hold a whole picture, but all I really need it to do is to hold just one line of 320 RGB pixels at a time. If it's not possible to get RGB data with these functions, could you explain me another way of doing so?

Thanks in advance, Joshua
Reply all
Reply to author
Forward
0 new messages