博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
I.MX6 ov5640 camera
阅读量:6257 次
发布时间:2019-06-22

本文共 4699 字,大约阅读时间需要 15 分钟。

/************************************************************************ *                       I.MX6 ov5640 camera * 说明: *     记录ov5640摄像头的设备注册方式。 * *                                      2016-6-8 深圳 南山平山村 曾剑锋 ***********************************************************************/一、设备注册:    cat arch/arm/mach-mx6/board-mx6q_sabresd.c        ......        static void mx6q_csi0_io_init(void)        {            if (cpu_is_mx6q())                mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_csi0_sensor_pads,                    ARRAY_SIZE(mx6q_sabresd_csi0_sensor_pads));            else if (cpu_is_mx6dl())                mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_csi0_sensor_pads,                    ARRAY_SIZE(mx6dl_sabresd_csi0_sensor_pads));            /* Camera reset */            gpio_request(SABRESD_CSI0_RST, "cam-reset");            gpio_direction_output(SABRESD_CSI0_RST, 1);            /* Camera power down */            gpio_request(SABRESD_CSI0_PWN, "cam-pwdn");            gpio_direction_output(SABRESD_CSI0_PWN, 1);            msleep(5);            gpio_set_value(SABRESD_CSI0_PWN, 0);            msleep(5);            gpio_set_value(SABRESD_CSI0_RST, 0);            msleep(1);            gpio_set_value(SABRESD_CSI0_RST, 1);            msleep(5);            gpio_set_value(SABRESD_CSI0_PWN, 1);            /* For MX6Q:             * GPR1 bit19 and bit20 meaning:             * Bit19:       0 - Enable mipi to IPU1 CSI0             *                      virtual channel is fixed to 0             *              1 - Enable parallel interface to IPU1 CSI0             * Bit20:       0 - Enable mipi to IPU2 CSI1             *                      virtual channel is fixed to 3             *              1 - Enable parallel interface to IPU2 CSI1             * IPU1 CSI1 directly connect to mipi csi2,             *      virtual channel is fixed to 1             * IPU2 CSI0 directly connect to mipi csi2,             *      virtual channel is fixed to 2             *             * For MX6DL:             * GPR13 bit 0-2 IPU_CSI0_MUX             *   000 MIPI_CSI0             *   100 IPU CSI0             */            if (cpu_is_mx6q())                mxc_iomux_set_gpr_register(1, 19, 1, 1);            else if (cpu_is_mx6dl())                mxc_iomux_set_gpr_register(13, 0, 3, 4);        }        ......        static void mx6q_mipi_sensor_io_init(void)        {            if (cpu_is_mx6q())                mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_mipi_sensor_pads,                    ARRAY_SIZE(mx6q_sabresd_mipi_sensor_pads));            else if (cpu_is_mx6dl())                mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_mipi_sensor_pads,                    ARRAY_SIZE(mx6dl_sabresd_mipi_sensor_pads));            /* Camera reset */            gpio_request(SABRESD_MIPICSI_RST, "cam-reset");            gpio_direction_output(SABRESD_MIPICSI_RST, 1);            /* Camera power down */            gpio_request(SABRESD_MIPICSI_PWN, "cam-pwdn");            gpio_direction_output(SABRESD_MIPICSI_PWN, 1);            msleep(5);            gpio_set_value(SABRESD_MIPICSI_PWN, 0);            msleep(5);            gpio_set_value(SABRESD_MIPICSI_RST, 0);            msleep(1);            gpio_set_value(SABRESD_MIPICSI_RST, 1);            msleep(5);            gpio_set_value(SABRESD_MIPICSI_PWN, 1);            /*for mx6dl, mipi virtual channel 1 connect to csi 1*/            if (cpu_is_mx6dl())                mxc_iomux_set_gpr_register(13, 3, 3, 1);        }        ......        static struct fsl_mxc_camera_platform_data mipi_csi2_data = {            .mclk = 24000000,            .mclk_source = 0,            .csi = 1,            .io_init = mx6q_mipi_sensor_io_init,            .pwdn = mx6q_mipi_powerdown,        };        ......        static struct fsl_mxc_camera_platform_data camera_data = {            .mclk = 24000000,            .mclk_source = 0,            .csi = 0,            .io_init = mx6q_csi0_io_init,            .pwdn = mx6q_csi0_cam_powerdown,        };        ......        static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {            ......            {                I2C_BOARD_INFO("ov564x", 0x3c),                .platform_data = (void *)&camera_data,            },            ......        }        ......        static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {            ......            {                I2C_BOARD_INFO("ov5640_mipi", 0x3c),                .platform_data = (void *)&mipi_csi2_data,            },            ......        }        ......            二、dmesg信息查看:    root@android:/ # dmesg | grep 5640    <6>camera ov5640 is found    <6>camera ov5640_mipi is found    root@android:/ #

 

转载地址:http://ddasa.baihongyu.com/

你可能感兴趣的文章
ORA-04031:
查看>>
早晚有一天,我们都会成为自己当初讨厌的人
查看>>
基于SMTP协议的CMD命令邮件发送
查看>>
九度笔记之 1209最小邮票数
查看>>
Java中swap解惑
查看>>
HDU 2068 RPG的错排
查看>>
操作数有自增操作时复合表达式的陷阱
查看>>
从WW中剥离一个三维场景框架
查看>>
ASP.NET网页动态添加、更新或删除数据行
查看>>
vbs获取当前主机IP
查看>>
IIS7中的站点、应用程序和虚拟目录详细介绍
查看>>
为何C语言(的函数调用)需要堆栈,而汇编语言却不需要堆栈
查看>>
对Map按key和value分别排序
查看>>
知名第三方编译版tete009 Firefox 24.0
查看>>
java反射生成ORM
查看>>
堆和栈的区别
查看>>
生成CSV文件后再将CSV文件导入到mysql
查看>>
Html.DropDownListFor练习(2)
查看>>
Eclipse+Maven创建webapp项目<一>
查看>>
筑巢引凤
查看>>