The architecture is quite simple. The driver keep a array where every known camera register is keept in memory. The configuration function only alter this array. When you call, for example po3030k_config_cam(), nothing is written on the camera, but only in the internal register representation.
To effectively write the register, you must call po3030k_write_cam_registers(). This is typically done after every configuration call and before acquire the first picture.
#include "po3030k.h" char buffer[2*40*40]; int main(void) { po3030k_init_cam(); po3030k_config_cam((ARRAY_WIDTH -160)/2,(ARRAY_HEIGHT-160)/2, 160,160,4,4,RGB_565_MODE); po3030k_write_cam_registers(); po3030k_launch_capture(buffer); while(!po3030k_is_img_ready()); // buffer contain a 40*40 RGB picture now ( insert usefull code here ) return 0; }
This example tell de driver to aquire 160x160 pixel picture from the camera 4x subsampling, thus resulting with a 40x40 pixel. The buffer as a size of 40*40*2 because RGB565 is a two bytes per pixel data format.
#include "po3030k.h" char buffer[160*2]; int main(void) { po3030k_init_cam(); po3030k_config_cam((ARRAY_WIDTH - 320)/2,(ARRAY_HEIGHT - 32)/2, 320,8,2,4,GREY_SCALE_MODE); po3030k_set_mirror(1,1); po3030ke_set_ref_exposure(100); po3030k_write_cam_registers(); po3030k_launch_capture(buffer); while(!po3030k_is_img_ready()); // Here buffer contain a 160x2 greyscale picture return 0; }
1.5.1