Hi Bill,
Thanks for your post.
Actually LCDK board has HW support for RAW capture device, because it has connector for LeopardImaging camera boards. VPIF configuration is based on vpifloopback demo and you need to modify the code to support RAW capture from CMOS sensor.
Here is the configuration: https://gist.github.com/andresv/4739017
You can use the example from the ~\OMAPL138_StarterWare_1_10_03_03\examples\evmOMAPL138\vpif_loopback_sd\vpifLoopbackSD.c and use this source as reference and modify the sequence in the initialize capture function SetUpVPIFRx() to work for raw capture mode. Please see the attached source file for reference and compare vpifLoopbackSD.c & vpiftransfer.c (attached file). Actually vpiftransfer.c is the source file modified for raw data capture and kindly review the attached file.
static void SetUpVPIFRx(void) {
// Disable interrupts
VPIFInterruptDisable(SOC_VPIF_0_REGS, VPIF_FRAMEINT_CH1);
VPIFInterruptDisable(SOC_VPIF_0_REGS, VPIF_FRAMEINT_CH0);
// Disable capture ports
VPIFCaptureChanenDisable(SOC_VPIF_0_REGS, VPIF_CHANNEL_1);
VPIFCaptureChanenDisable(SOC_VPIF_0_REGS, VPIF_CHANNEL_0);
// Interrupt after capturing the bottom field of every frame
VPIFCaptureIntframeConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_FRAME_INTERRUPT_BOTTOM);
// RAW mode
VPIFCaptureCapmodeModeSelect(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_CAPTURE_RAW);
VPIFCaptureModeConfig(SOC_VPIF_0_REGS, VPIF_RAW, VPIF_CHANNEL_0, 0, (VPIFVbufParam*) 0);
// 12 bit data
VPIFCaptureRawDatawidthConfig(SOC_VPIF_0_REGS, VPIF_RAW_TWELVE_BPS);
// Progressive capture
VPIFCaptureIntrprogModeSelect(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_CAPTURE_PROGRESSIVE);
}
(Please visit the site to view this file)
Note: In general, VPIF will issue line-interval triggered interrupts using the field/frame interrupt signals. The line-interval is programmable in the C0CTRL register, and it uses the FRAME1 interrupt signal.
So to get interrupt for each line you need to set the line-interval INTLINE to 1. Please check the C0CTRL register value of VPIF. For more details to get the line interrupts, please refer the below E2E post:
http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/t/327167.aspx
Thanks & regards,
Sivaraj K
-------------------------------------------------------------------------------------------------------