Skip to main content

<alp/camera.h> — Image Capture

Camera capture from MIPI CSI-2 (V2N, AEN, i.MX 93) or parallel CPI (fallback).

#include <alp/camera.h>

Capture a frame

alp_camera_t *cam = alp_camera_open(&(alp_camera_config_t){
.sensor = ALP_CAMERA_SENSOR_OV5640,
.resolution = ALP_CAMERA_RES_VGA,
.pixel_format = ALP_CAMERA_FMT_RGB565,
});

alp_camera_frame_t frame;
alp_camera_capture(cam, &frame);

// frame.data / frame.width / frame.height / frame.pitch
process_frame(&frame);

alp_camera_release_frame(cam, &frame);
alp_camera_close(cam);

ISP toggles (v0.5)

alp_camera_configure_isp exposes the Mali-C55 ISP toggles on the AEN family (auto-exposure, auto-white-balance, gamma, sharpening).

Camera mux (E1M EVK)

The E1M EVK carries an on-board OV5640 and a cam_mux chip to multiplex between it and an external MIPI CSI input; the E1M-X EVK instead exposes dedicated MIPI CSI-2 connectors (CAM0/CAM1) with no on-board sensor or mux. On a board that populates the mux, select the input with the board-side chip driver before opening the camera:

cam_mux_t mux;
cam_mux_init(&mux, brd_i2c, 0x35);
cam_mux_select(&mux, CAM_MUX_INPUT_EXTERNAL);

See also

Questions about this page? Discuss in Community Forum