void el_init_camera(){ int X,Y; CAM_VSYNC_DIR = INPUT_PIN; CAM_HREF_DIR = INPUT_PIN; CAM_PCLK_DIR = INPUT_PIN; el_cam_enabled = 0; el_cam_lock_buffer = 0; el_cam_frame_counter = 0; el_cam_x = 0; el_cam_y = 0; el_cam_r_frame = &el_frame_buffer_a; el_cam_w_frame = &el_frame_buffer_b; el_cam_line_pointer = &el_cam_w_frame->Data[0][0]; el_cam_pixel_pointer = &el_cam_w_frame->Data[0][0]; el_cam_device_id = 0; el_cam_revision_n = 0; el_cam_auto_function = 0; // reset the camera module, use the duration required to initialize the buffers CAM_RESET = 0; el_frame_buffer_a.Width = 0; el_frame_buffer_a.Height = 0; for(Y=0;Y<EL_CAMERA_FRAME_DIM_Y;Y++){ for(X=0;X<EL_CAMERA_FRAME_DIM_X;X++){ el_frame_buffer_a.Data[Y][X] = 0; } } CAM_RESET = 1; el_frame_buffer_b.Width = 0; el_frame_buffer_b.Height = 0; for(Y=0;Y<EL_CAMERA_FRAME_DIM_Y;Y++){ for(X=0;X<EL_CAMERA_FRAME_DIM_X;X++){ el_frame_buffer_b.Data[Y][X] = 0; } } el_camera_options_reset(); // reset the camera module el_cam_init_register(); }
void el_init_camera(){ int i; int X,Y; CAM_VSYNC_DIR = INPUT_PIN; CAM_HREF_DIR = INPUT_PIN; CAM_PCLK_DIR = INPUT_PIN; el_cam_enabled = 0; el_cam_lock_buffer = 0; el_cam_frame_counter = 0; el_cam_x = 0; el_cam_y = 0; el_cam_r_frame = &el_frame_buffer_a; el_cam_w_frame = &el_frame_buffer_b; el_cam_line_pointer = &el_cam_w_frame->Data[0][0]; el_cam_pixel_pointer = &el_cam_w_frame->Data[0][0]; el_cam_device_id = 0; el_cam_revision_n = 0; el_cam_auto_function = 0; // reset the camera module, use the duration required to initialize the buffers CAM_RESET = 0; el_frame_buffer_a.Width = 0; el_frame_buffer_a.Height = 0; for(Y=0;Y<EL_CAMERA_FRAME_DIM_Y;Y++){ for(X=0;X<EL_CAMERA_FRAME_DIM_X;X++){ el_frame_buffer_a.Data[Y][X] = 0; } } CAM_RESET = 1; el_frame_buffer_b.Width = 0; el_frame_buffer_b.Height = 0; for(Y=0;Y<EL_CAMERA_FRAME_DIM_Y;Y++){ for(X=0;X<EL_CAMERA_FRAME_DIM_X;X++){ el_frame_buffer_b.Data[Y][X] = 0; } } el_cam_parameters.ExposureMode = EL_AUTOMATIC; el_cam_parameters.AutoWhiteBalance = true; el_cam_parameters.AutoDigitalGain = true; el_cam_parameters.ExposureTime = 1.0f; el_cam_parameters.RedGain = 1.0f; el_cam_parameters.GreenGain = 1.0f; el_cam_parameters.BlueGain = 1.0f; el_cam_parameters.ExternalIntergationTime = 1.0f; el_cam_parameters.ExternalLinearGain = 1.0f; el_cam_parameters.IntegrationTime = 1.0f; el_cam_parameters.GlobalGain = 1.0f; el_cam_parameters.DigitalGain = 1.0f; // reset the camera module el_cam_init_register(); }