DVP 配置
DVP 配置包括以下内容:
驱动配置
DVP 驱动依赖 MPP 中的 vin 子模块,所以需要提前打开。
- 打开 MPP VIN在 Luban-Lite 根目录下执行
scons --menuconfig
,进入 menuconfig 的功能配置界面,按如下选择:Local packages options ---> ArtInChip packages options ---> [*] aic-mpp ---> [*] Enable Video Input interface (1843264) Size of Video Input buffer
其中Size of Video Input buffer
需要根据实际的摄像头数据格式来计算。 以 YUV422 格式、640*480 分辨率为例:-
需要申请的 Buf 大小为:
640*480*2*3 = 1843200
(计算方法详见 ) -
- 在 Buf 尾部多申请 64B,是为了满足 Cacheline 对齐的技术要求
-
- 打开
DVP同上,进入 menuconfig 的功能配置界面,按如下选择:
Board options ---> [*] Using DVP
- 打开 CameraDVP 需要 Camera 一起配合,整个数据采集通路才是完整的。 Camera 外设的一些参数和板级电路相关,需要确认:
-
连接到哪个 C 口
-
Reset pin 使用的是哪个 IO
-
Powerdown pin 使用的是哪个 IO
同上,进入 menuconfig 的功能配置界面完成配置,以连接到 C2 的 OV5640 为例,按如下选择:Board options ---> [*] Using i2c2 Camera Support ---> [*] Using camera device [*] Using camera OV5640 (2) The No. of I2C channel (PE.14) The reset pin of Camera (PE.15) The power down pin of Camera
-
- 打开
CLK_OUTx
Camera 外设需要 SoC 提供一路 clock 信号作为运行时的时钟源,D21x 和 x 都支持输出 4 路 clock,分别是 CLK_OUT0~CLK_OUT3,具体应该用哪一路,取决于板级电路的设计。
所以,请参考板级电路在 menuconfig 中选择打开一路 OUT:Board options ---> Clocks options ---> [ ] Enable CLK_OUT0 [ ] Enable CLK_OUT1 [ ] Enable CLK_OUT2 [*] Enable CLK_OUT3