分类: 嵌入式
2014-08-12 11:43:28
zynq> cat /usr/bin/load_oled#!/bin/shinsmod /lib/modules/`uname -r`/pmodoled-gpio.ko;if [ -c /dev/zed_oled ]; thencat /root/logo.bin > /dev/zed_oled;fi;
zynq> cat /usr/bin/unload_oled#!/bin/shrmmod pmodoled-gpio /lib/modules/`uname -r`/pmodoled-gpio.ko;
#include #include #include #include #include unsigned char dis_buf[128*4]={0};const unsigned char gImage_logo_aa[512] = { /* 0X82,0X01,0X80,0X00,0X20,0X00, */0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X80,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X80,0X80,0X80,0X80,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XC0,0XC0,0X00,0X00,0X00,0X00,0XE0,0XE0,0X00,0X00,0X00,0X00,0X80,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0X00,0X00,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XE0,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,0X06,0X07,0X03,0X01,0X01,0X01,0X01,0X01,0X03,0X03,0X07,0X1E,0XFC,0XF8,0XE0,0X00,0X00,0X00,0X00,0X07,0X03,0X83,0X81,0X81,0XC1,0XC1,0XC3,0XE3,0XFF,0XFE,0X7C,0X00,0X00,0X00,0X00,0X00,0X18,0X18,0X1B,0X1B,0X19,0X18,0X18,0X18,0X18,0X18,0X19,0X1F,0XFE,0XF8,0X98,0X18,0X18,0X1F,0X1F,0X1C,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X8F,0X8C,0X88,0X88,0XF8,0XF8,0XC8,0X88,0X8C,0X8F,0X8F,0X00,0X00,0X3F,0X3F,0X30,0X30,0X30,0XF0,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XF0,0X7C,0X0C,0X00,0X00,0X00,0X00,0XFF,0XFF,0X00,0X00,0X00,0X00,0X3C,0XFC,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,0XC0,0XC0,0X80,0X00,0X00,0X00,0X00,0X00,0X80,0X80,0XC0,0XF0,0X7F,0X3F,0X0F,0X00,0X00,0X00,0X7C,0XFF,0XFF,0XC7,0X83,0X03,0X03,0X01,0X01,0X01,0X80,0X80,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X0F,0X1F,0X3B,0XF3,0XE3,0XC3,0XC3,0XE3,0X73,0X3B,0X1F,0X07,0X0F,0X1E,0X38,0X70,0XE0,0XC0,0X80,0X00,0X00,0X00,0X00,0X00,0X3F,0XBF,0XB0,0X30,0X30,0XFF,0XFF,0X30,0X30,0X30,0X3F,0X3F,0X00,0X00,0XFC,0XFC,0X04,0X04,0X04,0X07,0X07,0X00,0X00,0X00,0X00,0X78,0X7F,0X0F,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0X00,0X00,0X00,0X00,0X00,0X01,0X0F,0X3F,0X78,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X03,0X03,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X03,0X03,0X03,0X03,0X03,0X03,0X01,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X01,0X01,0X00,0X00,0X00,0X00,0X04,0X0C,0X0C,0X06,0X06,0X07,0X03,0X03,0X01,0X01,0X03,0X03,0X06,0X06,0X0E,0X0C,0X0C,0X0C,0X00,0X00,0X01,0X03,0X01,0X00,0X00,0X00,0X0E,0X0F,0X07,0X06,0X06,0X06,0X07,0X0F,0X0C,0X0C,0X0C,0X0C,0X0C,0X0C,0X00,0X03,0X0F,0X0E,0X0C,0X0C,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0X0F,0X0C,0X0C,0X0C,0X0C,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};int main(){int fd = open("/dev/zed_oled",O_RDWR);int i=0;if( fd == -1){printf("Can't open zed_oled device!\n");return 0;}else{printf("/dev/zed_oled open success!\n");}for(i=0;i<128*4;i++){dis_buf[i]=0;}for(i=0; i<128*4 ; i++){dis_buf[i]=gImage_logo_aa[i];}write(fd,dis_buf,128*4);return 0;}