` 国庆期间收到板子,因为在忙着别的事情以至于一直都没有发帖,现在补上。板子收到之后第一印象就是外设接口非常齐全,有两个USB接口,一个mpcie接口(实际上是走USB接口协议),一个HDMI接口,一个摄像头接口,两个网口以及工业用的CAN/485接口,首先说说我欣赏的地方,那就是HDMI接口,因为使用外置转接芯片引出HDMI接口的IMX6UL/IMX6ULL开发板真的非常稀少,除了韦东山老师这款100ask-IMX6UL开发板外,就只有野火的IMX6-pro以及乐美客的一款工控板,而且那款乐美客IMX6UL工控板早已停产,市面上根本买不到,只在乐美客少数几次活动中能见到,在乐美客厂家介绍网站上的piano工控板也是换用了IMX6D/Q主控,以致不需要转接芯片的HDMI接口,如图绿色板子:
对于韦东山老师的CAN和485接口,数量各一个,这个一般是用于评估教学用的,有就行了不需要多,而专业的工控板一般会配备多个CAN/485接口,比如米尔的MYC-IMX6UL和一些国内的工控板厂家就是这样做的:
韦老师的这款板子唯一美中不足的地方就是GPIO接口数量实在是稀少,好在聪明的我—— 电子发烧友一名普普通通的试用者,另辟蹊径,使用嵌入式平台里面弥补GPIO接口数量不足的绝佳方案——外挂MCU主控,也就是使用一个 单片机板子,通过USB接口与嵌入式平台进行 通信,所有对于GPIO传感器的采集工作如I2C SPI USART 单总线等,交由单片机板子进行,单片机板子只需要将这些数据通过USB报文上报到嵌入式平台即可,不需要再占用IMX6UL主控本身就吃紧的CPU和内存资源。
板子拿到手之后烧录的是米尔厂家推出的measy-iot文件系统,这个文件系统跟我的项目格格不入完全冲突,肯定要换掉,好在韦老师提供了一个Ubuntu的EMMC镜像和烧录工具,非常体贴到位,烧录步骤也非常简单,在韦老师提供的网盘地址那里可以下载,打开100ASK_IMX6ULL_Flashing工具,将EMMC烧录固件放到files文件夹里面,这里准备了一个预设的Ubuntu镜像,注意这个镜像是必须要带有分区表/uboot/内核/dtb的,不能只有文件系统,不然烧录完了也没法启动。设置拨码开关为0001即USB启动,再用micro USB线将板子的OTG烧录接口接到电脑上,烧录工具提示设备已连接就可以进行烧录了:
烧录完毕设置拨码0010即可从EMMC启动,启动画面只有命令行:
后续可以通过apt安装诸多软件,比如xorg+xfce4装一个轻量化桌面,当然这是后话了,板子第一次上电启动要先更新软件库,将/etc/apt/source.list文件的内容替换,阿里云armhf源,适用于所有32位armv7 ubuntu主控的开发板的软件源:
- deb http://mirrors.aliyun.com/ubuntu-ports/ xenial main
- deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial main
- deb http://mirrors.aliyun.com/ubuntu-ports/ xenial-updates main
- deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial-updates main
- deb http://mirrors.aliyun.com/ubuntu-ports/ xenial universe
- deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial universe
- deb http://mirrors.aliyun.com/ubuntu-ports/ xenial-updates universe
- deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial-updates universe
- deb http://mirrors.aliyun.com/ubuntu-ports/ xenial-security main
- deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial-security main
- deb http://mirrors.aliyun.com/ubuntu-ports/ xenial-security universe
- deb-src http://mirrors.aliyun.com/ubuntu-ports/ xenial-security universe
复制代码
这样就可以用
来进行软件库更新:
装好了之后我还要安装gcc g++ make xorg xfce4等常用软件:
- apt install gcc g++ make xorg xfce4
复制代码
装好了xfce4之后板子就可以在命令行敲startx命令启动xfce4桌面:
当然了,目前的项目DEMO并不需要这种桌面,而IMX6ULL主控跑xfce4图形界面的应用或者QT之类的应用也会非常卡,所以先跳过,先把项目代码跑起来,项目DEMO代码里面有两个外设需要驱动,分别是用于显示的/dev/fb0和用于摄像头图像采集用的/dev/video1,/dev/fb0操作非常简单,不多说,甚至可以直接沿用以前的代码:
- #include "lcd.h"
- #include "font.h"
- static int lcd_buf[LCD_WIDTH*LCD_HEIGHT];
- static unsigned int lcd_buff[LCD_HEIGHT][LCD_WIDTH];
- static unsigned char bmp_buf[LCD_WIDTH*LCD_HEIGHT*4],*point=bmp_buf;
- int tsfd,ret,fd_lcd;
- struct input_event myinput;
- void Get_Information_Frame_Buffer(char *dev)
- {
- struct fb_var_screeninfo vinfo;
- printf("dev=%s
- ",dev);
- fd_lcd=open(dev,O_RDWR);
- if(fd_lcd==-1)
- {
- printf("Device open failed.
- ");
- return ;
- }
- if (ioctl(fd_lcd,FBIOGET_VSCREENINFO,&vinfo))
- {
- printf("Device get information failed.
- ");
- return ;
- }
- close(fd_lcd);
- printf("%d %d %d
- ",vinfo.xres,vinfo.yres,vinfo.bits_per_pixel);
- }
- void LCD_Effect()
- {
- fd_lcd=open("/dev/fb0",O_RDWR); // O_RDONLY, O_WRONLY, or O_RDWR
- if(fd_lcd==-1)
- {
- printf("open LCD failed!
- ");
- return ;
- }
- write(fd_lcd,lcd_buf,LCD_WIDTH*LCD_HEIGHT*4);
- close(fd_lcd);
- }
- void LCD_Show_Buffer(char *dev_name,int x1,int y1,int width,int height,unsigned char *frame_buffer)
- {
- int fd_lcd,i,j;
- fd_lcd=open(dev_name,O_RDWR);
- if(fd_lcd==-1)
- {
- printf("open LCD failed!
- ");
- return ;
- }
- for(i=x1;i
- {
- for(j=y1;j
- if(i<=height&&j<=width)
- {
- lcd_buf[i*LCD_WIDTH+j]=
- frame_buffer[(i*width+j)*3]|
- frame_buffer[(i*width+j)*3+1]<<8|
- frame_buffer[(i*width+j)*3+2]<<16;
- }
- //else lcd_buf[i*LCD_WIDTH+j]=0xffff0000;
- }
- write(fd_lcd,lcd_buf,LCD_WIDTH*LCD_HEIGHT*4);
- // printf("LCD_Show_Buffer OK!
- ");
- close(fd_lcd);
- }
- void LCD_Clear_Screen(long color)
- {
- int i;
- fd_lcd=open("/dev/fb0",O_RDWR); // O_RDONLY, O_WRONLY, or O_RDWR
- if(fd_lcd==-1)
- {
- printf("open LCD failed!
- ");
- return ;
- }
- for(i=0;i
- lcd_buf[i]=color;
- ret = write(fd_lcd,lcd_buf,LCD_WIDTH*LCD_HEIGHT*4);
- if(ret == -1)
- {
- printf("fill frame failed!
- ");
- return ;
- }
- close(fd_lcd);
- }
- void Open_Touch_Screen()
- {
- tsfd=open("/dev/input/event0",O_RDWR);
- if(tsfd==-1)
- {
- printf("open TS failed!
- ");
- return ;
- }
- }
- void Get_Touch_Screen(int * x,int * y)
- {
- read(tsfd,&myinput,sizeof(myinput));
- if(myinput.type==EV_ABS)
- {
- if(myinput.code==ABS_X)
- {
- *x=myinput.value;
- }
- if(myinput.code==ABS_Y)
- {
- *y=myinput.value;
- }
- }
- }
- int LCD_Show_ASCII_64(int x,int y,int fontcolor,int backcolor,int word)
- {
- int i,j,k;
- unsigned char temp;
- word-=0x20;
- for(j=0;j<64;j++)
- {
- for(i=0;i<4;i++)
- {
- temp=ascii_font_64[j*4+i+word*256];
- for(k=0;k<8;k++)
- {
- if(temp&0x80)
- lcd_buf[i*8+k+x+LCD_WIDTH*(j+y)]=fontcolor;
- else
- lcd_buf[i*8+k+x+LCD_WIDTH*(j+y)]=backcolor;
- temp<<=1;
- }
- }
- }
- }
- int LCD_Show_ASCII_String_64(int x,int y,int wordcolor,int backcolor,char s[])
- {
- int i=0;
- for(i=0;s[i]!='\0';i++)
- LCD_Show_ASCII_64(x+i*32,y,wordcolor,backcolor,s[i]);
- }
- //int LCD_Show_Chinese_64(int x,int y,int fontcolor,int backcolor,int word)
- //{
- // int i,j,k;
- // unsigned char temp;
- // for(j=0;j<64;j++)
- // {
- // for(i=0;i<8;i++)
- // {
- // temp=chinese_font_64[j*8+i+word*512];
- // for(k=0;k<8;k++)
- // {
- // if(temp&0x80)
- // lcd_buf[i*8+k+x+LCD_WIDTH*(j+y)]=fontcolor;
- // else
- // lcd_buf[i*8+k+x+LCD_WIDTH*(j+y)]=backcolor;
- // temp<<=1;
- // }
- // }
- //
- // }
- //}
- //int LCD_Show_BMP_File(int xpos,int ypos,char* filename)
- //{
- // int i,j,fbmp,fd,width,width_mod,height;
- // fd=open("/dev/fb0",O_RDWR);
- // if(fd == -1)
- // {
- // printf("open LCD failed!
- ");
- // return -1;
- // }
- //
- // fbmp=open(filename,O_RDONLY);
- //
- // read(fbmp,bmp_buf,54);
- // width=bmp_buf[21]<<24|bmp_buf[20]<<16|bmp_buf[19]<<8|bmp_buf[18];
- // height=bmp_buf[25]<<24|bmp_buf[24]<<16|bmp_buf[23]<<8|bmp_buf[22];
- //
- // fbmp=open(filename,O_RDONLY);
- //
- // read(fbmp,bmp_buf,width*height*3+54);
- //
- // width_mod=width%4;
- //
- // for(i=0;i
- // {
- // for(j=0;j
- // if(i<=height&&j<=width)
- // {
- // lcd_buf[i*LCD_WIDTH+j]=
- // bmp_buf[(i*width+j)*3+54+i*width_mod]|
- // bmp_buf[(i*width+j)*3+55+i*width_mod]<<8|
- // bmp_buf[(i*width+j)*3+56+i*width_mod]<<16;
- // }
- // else lcd_buf[i*LCD_WIDTH+j]=0;
- // }
- //
- // for(i=0;i
- // for(j=0;j
- // lcd_buff[i][j]=lcd_buf[i*LCD_WIDTH+j];
- //
- // for(i=0;i
- // for(j=0;j
- // lcd_buff_2[height-i+ypos][j+xpos]=lcd_buff[i][j];
- //
- // for(i=0;i
- // for(j=0;j
- // lcd_buf[i*LCD_WIDTH+j]=lcd_buff_2[i][j];
- //
- // //ret = write(fd,lcd_buf,LCD_WIDTH*LCD_HEIGHT*4);
- // if(ret == -1)
- // {
- // printf("fill frame failed!
- ");
- // return -1;
- // }
- // close(fd);
- //}
- //
- //void LCD_Show_JPG_File(int xpos,int ypos,char *filename)
- //{
- // int fd,fjpg,i,j;
- // FILE *input_file=fopen(filename,"rb");
- // struct jpeg_decompress_struct cinfo;
- // //JPEG鍥惧儚鍦ㄨВ鐮佽繃绋嬩腑锛屼娇鐢╦peg_decompress_struct绫诲瀷鐨勭粨鏋勪綋鏉ヨ〃绀猴紝鍥惧儚鐨勬墍鏈変俊鎭兘瀛樺偍鍦ㄧ粨鏋勪綋涓?
- // struct jpeg_error_mgr jerr;
- // //瀹氫箟涓€涓爣鍑嗙殑閿欒缁撴瀯浣擄紝涓€鏃︾▼搴忓嚭鐜伴敊璇氨浼氳皟鐢╡xit()鍑芥暟閫€鍑鸿繘绋?
- // JSAMPARRAY buffer;
- // //鐢ㄤ簬瀛樺彇涓€琛屾暟鎹?
- // fjpg=open((char *)"/home/fa/1.jpg",O_RDONLY);
- // cinfo.err = jpeg_std_error(&jerr);//缁戝畾閿欒澶勭悊缁撴瀯瀵硅薄
- // jpeg_create_decompress(&cinfo);//鍒濆鍖朿info缁撴瀯
- // jpeg_stdio_src(&cinfo,input_file);//鎸囧畾瑙e帇缂╂暟鎹簮
- // jpeg_read_header(&cinfo,TRUE);//鑾峰彇鏂囦欢淇℃伅
- // jpeg_start_decompress(&cinfo);//寮€濮嬭В鍘嬬缉
- //
- // int width = cinfo.output_width;//鍥惧儚瀹藉害
- // int height = cinfo.output_height;//鍥惧儚楂樺害
- // int depth = cinfo.output_components;//鍥惧儚娣卞害
- //
- // memset(bmp_buf,0,sizeof(unsigned char)*width*height*depth);
- //
- // buffer=(*cinfo.mem->alloc_sarray)((j_common_ptr)&cinfo,JPOOL_IMAGE,width*depth,1);
- // //鍒嗛厤涓€琛屾暟鎹┖闂?
- //
- // while(cinfo.output_scanline
- // {
- // jpeg_read_scanlines(&cinfo,buffer,1);
- // //璇诲彇涓€琛宩pg鍥惧儚鏁版嵁鍒癰uffer
- // memcpy(point,*buffer,width*depth);
- // //灏哹uffer涓殑鏁版嵁閫愯缁檚rc_buff
- // point+=width*3;
- // //鎸囬拡鍋忕Щ涓€琛?
- // }
- //
- // jpeg_finish_decompress(&cinfo);//瑙e帇缂╁畬姣?
- //
- // fd=open("/dev/fb0",O_RDWR); // O_RDONLY, O_WRONLY, or O_RDWR
- //
- //
- // for(i=0;i
- // {
- // for(j=0;j
- // if(i<=height&&j<=width)
- // lcd_buf[(i+ypos)*(LCD_WIDTH)+j+xpos]=bmp_buf[(i*width+j)*3]<<16|bmp_buf[(i*width+j)*3+1]<<8|bmp_buf[(i*width+j)*3+2];
- //
- // else lcd_buf[(i+ypos)*(LCD_WIDTH)+j+xpos]=0;
- // }
- //
- // write(fd,lcd_buf,LCD_WIDTH*LCD_HEIGHT*4);
- //}
复制代码
然后是/dev/video1,这个是板子连接外置视频输入设备,我这边只接了一个USB摄像头,安装命名顺延规则就是video1:
- #include "camera.h"
- #include "lcd.h"
- static int fd_video;
- static struct v4l2_capability cap;
- struct v4l2_fmtdesc fmtdesc;
- struct v4l2_format fmt;
- struct v4l2_streamparm setfps;
- struct v4l2_requestbuffers req;
- struct v4l2_buffer buf;
- enum v4l2_buf_type type;
- unsigned char frame_buffer[IMAGEWIDTH*IMAGEHEIGHT*3];
- buffer *buffers;
- int V4L2_Init(const char * filename)
- {
- int i,ret = 0;
- if ((fd_video=open(filename,O_RDWR))==-1)
- {
- printf("Error opening V4L interface
- ");
- return (0);
- }
- if (ioctl(fd_video,VIDIOC_QUERYCAP,&cap) == -1)
- {
- printf("Error opening device %s: unable to query device.
- ",filename);
- return (0);
- }
- else
- {
- printf("driver: %s
- ",cap.driver);
- printf("card: %s
- ",cap.card);
- printf("bus_info: %s
- ",cap.bus_info);
- printf("version: %d
- ",cap.version);
- printf("capabilities: %x
- ",cap.capabilities);
- if ((cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == V4L2_CAP_VIDEO_CAPTURE)
- {
- printf("Device %s: supports capture.
- ",filename);
- }
- if ((cap.capabilities & V4L2_CAP_STREAMING) == V4L2_CAP_STREAMING)
- {
- printf("Device %s: supports streaming.
- ",filename);
- }
- }
- fmtdesc.index=0;
- fmtdesc.type=V4L2_BUF_TYPE_VIDEO_CAPTURE;
- printf("Support format:
- ");
- while(ioctl(fd_video,VIDIOC_ENUM_FMT,&fmtdesc)!=-1)
- {
- printf(" %d.%s
- ",fmtdesc.index+1,fmtdesc.description);
- fmtdesc.index++;
- }
- fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
- fmt.fmt.pix.height = IMAGEHEIGHT;
- fmt.fmt.pix.width = IMAGEWIDTH;
- fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
- if(ioctl(fd_video,VIDIOC_S_FMT, &fmt) == -1)
- {
- printf("Unable to set format
- ");
- return 1;
- }
- if(ioctl(fd_video,VIDIOC_G_FMT, &fmt) == -1)
- {
- printf("Unable to get format
- ");
- return 2;
- }
- {
- printf("fmt.type: %d
- ",fmt.type);
- printf("pix.pixelformat: %c%c%c%c
- ",fmt.fmt.pix.pixelformat & 0xFF, (fmt.fmt.pix.pixelformat >> 8) & 0xFF,(fmt.fmt.pix.pixelformat >> 16) & 0xFF, (fmt.fmt.pix.pixelformat >> 24) & 0xFF);
- printf("pix.height: %d
- ",fmt.fmt.pix.height);
- printf("pix.width: %d
- ",fmt.fmt.pix.width);
- printf("pix.field: %d
- ",fmt.fmt.pix.field);
- }
- //set fps
- ioctl(fd_video, VIDIOC_G_PARM, &setfps);
- //setfps.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- //setfps.parm.capture.timeperframe.numerator = 30;
- //setfps.parm.capture.timeperframe.denominator = 30;
- req.count=4;
- req.type=V4L2_BUF_TYPE_VIDEO_CAPTURE;
- req.memory=V4L2_MEMORY_MMAP;
- if(ioctl(fd_video,VIDIOC_REQBUFS,&req)==-1)
- {
- printf("request for buffers error
- ");
- return 3;
- }
- printf("init %s [OK]
- ",filename);
- return 0;
- }
- int V4l2_Grab()
- {
- unsigned int n_buffers;
- buffers =(buffer*)malloc(req.count*sizeof (*buffers));
- if (!buffers)
- {
- printf ("Out of memory
- ");
- return 0;
- }
- for (n_buffers = 0; n_buffers < req.count; n_buffers++)
- {
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_MMAP;
- buf.index = n_buffers;
- //query buffers
- if (ioctl (fd_video,VIDIOC_QUERYBUF, &buf) == -1)
- {
- printf("query buffer error
- ");
- return(0);
- }
- buffers[n_buffers].length = buf.length;
- buffers[n_buffers].start = mmap(NULL,buf.length,PROT_READ |PROT_WRITE, MAP_SHARED,
- fd_video, buf.m.offset);
- if (buffers[n_buffers].start == MAP_FAILED)
- {
- printf("buffer map error
- ");
- return 0;
- }
- }
- for (n_buffers = 0; n_buffers < req.count; n_buffers++)
- {
- buf.index = n_buffers;
- ioctl(fd_video, VIDIOC_QBUF, &buf);
- }
- type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- ioctl (fd_video, VIDIOC_STREAMON, &type);
- ioctl(fd_video, VIDIOC_DQBUF, &buf);
- // printf("grab yuyv OK!
- ");
- return 1;
- }
- int Yuyv_2_RGB888(buffer* input_buffers,unsigned char *output_buffer)
- {
- int i,j,r1,g1,b1,r2,g2,b2;
- unsigned char y1,y2,u,v;
- unsigned char *pointer;
- pointer =(unsigned char*)input_buffers[0].start;
- for(i=0;i
- {
- for(j=0;j
- {
- y1 = *( pointer + (i*IMAGEWIDTH/2+j)*4);
- u = *( pointer + (i*IMAGEWIDTH/2+j)*4 + 1);
- y2 = *( pointer + (i*IMAGEWIDTH/2+j)*4 + 2);
- v = *( pointer + (i*IMAGEWIDTH/2+j)*4 + 3);
- r1 = y1 + 1.042*(v-128);
- g1 = y1 - 0.34414*(u-128) - 0.71414*(v-128);
- b1 = y1 + 1.772*(u-128);
- r2 = y2 + 1.042*(v-128);
- g2 = y2 - 0.34414*(u-128) - 0.71414*(v-128);
- b2 = y2 + 1.772*(u-128);
- if(r1>255)
- r1 = 255;
- else if(r1<0)
- r1 = 0;
- if(b1>255)
- b1 = 255;
- else if(b1<0)
- b1 = 0;
- if(g1>255)
- g1 = 255;
- else if(g1<0)
- g1 = 0;
- if(r2>255)
- r2 = 255;
- else if(r2<0)
- r2 = 0;
- if(b2>255)
- b2 = 255;
- else if(b2<0)
- b2 = 0;
- if(g2>255)
- g2 = 255;
- else if(g2<0)
- g2 = 0;
- *(output_buffer + (i*IMAGEWIDTH/2+j)*6 ) = (unsigned char)b1;
- *(output_buffer + (i*IMAGEWIDTH/2+j)*6 + 1) = (unsigned char)g1;
- *(output_buffer + (i*IMAGEWIDTH/2+j)*6 + 2) = (unsigned char)r1;
- *(output_buffer + (i*IMAGEWIDTH/2+j)*6 + 3) = (unsigned char)b2;
- *(output_buffer + (i*IMAGEWIDTH/2+j)*6 + 4) = (unsigned char)g2;
- *(output_buffer + (i*IMAGEWIDTH/2+j)*6 + 5) = (unsigned char)r2;
- }
- }
- // printf("change to RGB OK!
- ");
- free(input_buffers);
- }
- //int Encode_Jpeg(unsigned char *lpbuf,int width,int height,const char *output_filename)
- //{
- // struct jpeg_compress_struct cinfo ;
- // struct jpeg_error_mgr jerr ;
- // JSAMPROW row_pointer[1] ;
- // int row_stride ;
- // char *buf=NULL ;
- // int x ;
- //
- // FILE *fptr_jpg = fopen ((char *)output_filename,"wb");
- // if(fptr_jpg==NULL)
- // {
- // printf("Encoder:open file failed!/n") ;
- // return 0;
- // }
- //
- // cinfo.err = jpeg_std_error(&jerr);
- // jpeg_create_compress(&cinfo);
- // jpeg_stdio_dest(&cinfo, fptr_jpg);
- //
- // cinfo.image_width = width;
- // cinfo.image_height = height;
- // cinfo.input_components = 3;
- // cinfo.in_color_space = JCS_RGB;
- //
- // jpeg_set_defaults(&cinfo);
- //
- //
- // jpeg_set_quality(&cinfo, 80,1);
- //
- //
- // jpeg_start_compress(&cinfo, 1);
- //
- // row_stride = width * 3;
- // buf=(char*)malloc(row_stride);
- // row_pointer[0] =(unsigned char*)buf;
- // while (cinfo.next_scanline < height)
- // {
- // for (x=0;x
- // {
- //
- // buf[x] = lpbuf[x];
- // buf[x+1] = lpbuf[x+1];
- // buf[x+2] = lpbuf[x+2];
- //
- // }
- // jpeg_write_scanlines (&cinfo, row_pointer, 1);
- // lpbuf += row_stride;
- // }
- //
- // jpeg_finish_compress(&cinfo);
- // fclose(fptr_jpg);
- // jpeg_destroy_compress(&cinfo);
- // free(buf);
- // printf("save "JPEG"OK
- ");
- // return 0 ;
- //
- //}
- int close_v4l2(void)
- {
- if(fd_video!=-1)
- {
- close(fd_video);
- return 1;
- }
- return 0;
- }
复制代码
编写makefile:
- PROG = main
- SRCS = main.cc lcd.cc camera.cc
- CLEANFILES = $(PROG)
- #CFLAGS += -lcrypto
- #LDFLAGS +=
- all: $(PROG)
- $(PROG): $(SRCS)
- $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
- clean:
- rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
复制代码
使用make进行编译:
驱动摄像头效果,由于IMX6UL主控性能确实不怎么高,无论是grab抓取图像还是yuyv解码都非常慢,所以驱动摄像头的效果也不好:
`
|