void init_ColorVision(void) { // initialize ov6620 cmos camera i2cdata[0] = 0x01; i2cdata[1] = 0x8F; // Blue Gain control (default 0x80) i2cdata[2] = 0x8F; // Red Gain Control i2cdata[3] = 0x80; // Saturation i2cdata[4] = 0x00; // Reserved i2cdata[5] = 0x4f; // Contrast i2cdata[6] = 0x9f; // Brightness i2cdata[7] = 0xCF; // Sharpness (default 0xC6) i2cdata[8] = 0x00; // Reserved i2cdata[9] = 0x00; // Reserved i2cdata[10] = 0x00; // Reserved i2cdata[11] = 0x00; // Reserved i2cdata[12] = 0x20; // AWB - Blue i2cdata[13] = 0x20; // AWB - Red i2cdata[14] = 0x0D; // COMR i2cdata[15] = 0x05; // COMS i2cdata[16] = 0x9A; // AEC i2cdata[17] = 0x01; // CLKRC i2cdata[18] = 0x28; // COMA i2cdata[19] = 0x01; // 0x01; // COMB I2C_write(I2C0, 0x60, i2cdata, 20, SET_STOP_BIT_AFTER_WRITE); i2cdata[0] = 0x20; i2cdata[1] = 0x01; // COME I2C_write(I2C0, 0x60, i2cdata, 2, SET_STOP_BIT_AFTER_WRITE); i2cdata[0] = 0x28; i2cdata[1] = 0x81; // COMH I2C_write(I2C0, 0x60, i2cdata, 2, SET_STOP_BIT_AFTER_WRITE); i2cdata[0] = 0x39; // changed to PCLK always on. i2cdata[1] = 0x00; //0x40; // COML I2C_write(I2C0, 0x60, i2cdata, 2, SET_STOP_BIT_AFTER_WRITE); VPIF_initReceive(VIDEO_CONN_CAMERA); // PRU setup EVMOMAPL138_lpscTransition(PSC0, DOMAIN0, LPSC_DMAX, PSC_ENABLE); PRU_stop(PRU0); PRU_reset(PRU0); PRU_load(PRU0_PROG, PRUCode, sizeof(PRUCode)/sizeof(uint32_t)); PRU_reset(PRU0); PRU_run(PRU0); // VPIF (95) interrupt serviced by INT4 ICR = 0x010; // clear pending interrupts IER |= 0x010; // enable interrupt on line // PRU (6) interrupt serviced by INT6 ICR = 0x040; // clear pending interrupts IER |= 0x040; // enable interrupt on line pic_data = (int *)ADDR_VIDEO_DATA_BASE; Image_data = (bgr *)(IMAGE_DATA_MEM); Thres_Image = (unsigned char *)(THRES_IMAGE_MEM); Linux_Image = (bgr *)(ADDR_VIDEO_DATA_BASE+LINUX_IMAGE_OFFSET); LCD_Image = (bgr *)(ADDR_VIDEO_DATA_BASE+LCD_IMAGE_OFFSET); ptrshrdmem = (sharedmemstruct *)SHARED_MEM; while (CHKBIT(VPIF->INTSTAT,INT_FRAME_CH1) == 0) {} SETBIT(VPIF->INTSTATCLR, INT_FRAME_CH1); }
void PRU_restart(pru_regs_t *pru) { PRU_stop(pru); PRU_reset(pru); PRU_run(pru); }