Files | |
| file | e_calc.c |
| Calculate the timing for the camera (two timers). | |
| file | e_po3030k.h |
| PO3030k library header (two timers). | |
| file | e_timers.c |
| Manage camera's interrupts (two timers). | |
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 e_po3030k_config_cam(), nothing is written on the camera, but only in the internal register representation.
To effectively write the register, you must call e_po3030k_write_cam_registers(). This is typically done after every configuration call and before acquire the first picture.
#include "e_po3030k.h" char buffer[2*40*40]; int main(void) { e_po3030k_init_cam(); e_po3030k_config_cam((ARRAY_WIDTH -160)/2,(ARRAY_HEIGHT-160)/2, 160,160,4,4,RGB_565_MODE); e_po3030k_write_cam_registers(); e_po3030k_launch_capture(buffer); while(!e_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 "e_po3030k.h" char buffer[160*2]; int main(void) { e_po3030k_init_cam(); e_po3030k_config_cam((ARRAY_WIDTH - 320)/2,(ARRAY_HEIGHT - 32)/2, 320,8,2,4,GREY_SCALE_MODE); e_po3030k_set_mirror(1,1); e_po3030ke_set_ref_exposure(100); e_po3030k_write_cam_registers(); e_po3030k_launch_capture(buffer); while(!e_po3030k_is_img_ready()); // Here buffer contain a 160x2 greyscale picture return 0; }
1.5.4