void task_play_init(void) { deg_Printf("task play init\n"); reset_powerSaveChk(); #if (USER_CONFIG==CONFIG_AX3251_AIRBORNE) #else g_SystemState = SYSTEM_IDLE; FRESULT ret; u32 scan_num; play_file_num = 0; play_file_total = 0; memset__(&t_play,0,sizeof(t_play_trl)); sd_dis_flag = 0; if(video_enlager) { video_enlager = 0; tvout_Change_dis_size(video_enlager,0); } if(FALSE == sd_err_reinit()) { return; } if(!InitRecordFolder()) return; if(light_sta) CLOSE_NIGHT_LIGHT(); ret = f_scan_files(WORK_DIR_NAME,".JPG|.AVI",&scan_num); if(ret != FR_OK) { deg_Printf("scan file failed:%d\n",ret); } //deg_Printf("pass f_scan_files, ret =%d,scan_num = %d\n ",ret,scan_num); //play_file_total = scan_num; play_file_total = f_get_totalfile_num(0); play_file_num = play_file_total-1; deg_Printf("file total number =%d\n ",play_file_total); if(!play_file_total) { deg_Printf("no file\n"); return; } //play_file_num = 0; csi_Stop(); OSDInit(&OSD1Inf,0,0 ,MENU_WIDTH,MENU_HEIGHT,0xff,ALPHA_0X00_COLOR); OSD1_useColorAlpha(); if(0 == sys_ctl.tv_mode) lcd_set_backlight(1); t_play.play_sta = PLAY_STOP; OSD_changeFlag = 1; #endif }
int main(int argc, char **argv) { int row = 1; int opt; while ((opt = getopt(argc, argv, "2b:")) != -1) { switch (opt) { case '2': row = 2; break; case 'b': if (strcasecmp("on", optarg) == 0) bl = 0; else if (strcasecmp("off", optarg) == 0) bl = 1; else { fprintf(stderr, helpmsg, argv[0]); exit(EXIT_FAILURE); } break; default: /* '?' */ printf("help\n"); fprintf(stderr, helpmsg, argv[0]); exit(EXIT_FAILURE); } } if (ioperm(LPT_DATA_OUT, 3, 3) < 0) { perror("ioperm"); exit(EXIT_FAILURE); } lcd_set_backlight(); if (optind < argc) { lcd_init(); while (row <= 2 && argv[optind]) { writeln(argv[optind], row); optind++; row++; } } return 0; }
int lcd_param(struct pxa2x0_lcd_softc *sc, u_long cmd, struct wsdisplay_param *dp) { int res = EINVAL; switch (dp->param) { case WSDISPLAYIO_PARAM_BACKLIGHT: if (cmd == WSDISPLAYIO_GETPARAM) { dp->min = 0; dp->max = 1; dp->curval = lcd_get_backlight(); res = 0; } else if (cmd == WSDISPLAYIO_SETPARAM) { lcd_set_backlight(dp->curval); res = 0; } break; case WSDISPLAYIO_PARAM_CONTRAST: /* unsupported */ res = ENOTTY; break; case WSDISPLAYIO_PARAM_BRIGHTNESS: if (cmd == WSDISPLAYIO_GETPARAM) { dp->min = 1; dp->max = lcd_max_brightness(); dp->curval = lcd_get_brightness(); res = 0; } else if (cmd == WSDISPLAYIO_SETPARAM) { lcd_set_brightness(dp->curval); res = 0; } break; } return res; }
void tvout_set_cur_mode(u8 type) { lcd_set_backlight(0); //close backlight tvout_lcd_disen(); REG32(PCON0) &= ~(1<<29); // enable LCD clock REG32(PCON0) &= ~(1<<22); // enable TV clock if(TVOUT_MODE_LCD == type) { DB("tvout is lcd \n"); tv_disable(); tvout_mode = TVOUT_MODE_LCD; tvout_w = lcd_get_w(); tvout_h = lcd_get_h(); DB("tvout_w =%d,tvout_h = %d \n",tvout_w,tvout_h); tvout_lcd_clk_cfg(); //init clk REG32(LCDCON0) &= ~((1<<9)|(1 << 7)|(1 << 6) | (1 << 5) |(1 << 4)|(1 << 3)|(LCD_INTERFACE_SEL<<1)|(1<<0)); //disabled lcd_set_panel_colour(0,0,0); lcd_init(); // REG32(LCDCON0) |= (0 << 8)|(1 << 6) |(1 << 0); //video_en,osd3_en,osd2_en,osd1_en,lcd_en //=======after set clk===== tvout_lcd_disen(); waittingLcdFrameEnd(); set_video_address(VIDEO_BASE_SDRAM_ADDR); tvout_display_set(0,0,u32csi_Dma_Size_H,u32csi_Dma_Size_H,u32csi_Dma_Size_V,tvout_get_w(),tvout_get_h()); waittingLcdFrameEnd(); tvout_lcd_en(); // REG32(LCDCON0) &= ~BIT(7); //write back disable //lcd_set_backlight(1); //open backlight } else if(TVOUT_MODE_NTSC == type) { DB("tvout is ntsc \n"); tvout_mode = TVOUT_MODE_NTSC; tvout_w = 720; tvout_h = 480; DB("tvout_w =%d,tvout_h = %d \n",tvout_w,tvout_h); tvout_clk_cfg(); //tvout clk set tvout_ntsc_reg_init(); //ntsc reg init SetIntSrc(LCD_INT); //open lcd int REG32(LCDCON0) |= 1<<10; tvout_set_panel(tvout_get_w()-1,tvout_get_h()-1,0,0,250); tvout_display_set(0,0,u32csi_Dma_Size_H,u32csi_Dma_Size_H,u32csi_Dma_Size_V,tvout_get_w(),tvout_get_h()); REG32(LCDCON47) = (0<<0)//warped distance enable | (4<<1)//warped distance (4 recommended) | (ROTATEMODE<<4)//rotate mode 0\1 disable\180 | (MIRRORMODE<<5)//mirror mode 0\1\2\3 disable\up_and_down\left_and_right\up_and_down_left_and_right | (1<<8); REG32(LCDCON0) |= (0<<0) //[0]: lcd enable | (LCD_INTERFACE_SEL<<1) //[2:1]: TV out | (DISPLAY_CHANNEL<<3)//[3:6]: osd1ãosd2ãosd3ãvideo enable | (1<<9); //[9]: odd_and_even line first 0/1 even/odd tvout_lcd_en(); tv_enable(); Delay_MS(100); // let tvout work steady } else { DB("tvout is pal \n"); tvout_mode = TVOUT_MODE_PAL; if(0 == PAL_DEFINITION) { tvout_w = 720; tvout_h = 576; } else { tvout_w = 702; tvout_h = 576; } DB("tvout_w =%d,tvout_h = %d \n",tvout_w,tvout_h); tvout_clk_cfg(); //tvout clk set tvout_pal_reg_init(); //pal reg init SetIntSrc(LCD_INT); //open lcd int REG32(LCDCON0) |= 1<<10; tvout_set_panel(tvout_get_w()-1,tvout_get_h()-1,0,0,250); tvout_display_set(0,0,u32csi_Dma_Size_H,u32csi_Dma_Size_H,u32csi_Dma_Size_V,tvout_get_w(),tvout_get_h()); REG32(LCDCON47) = (0<<0)//warped distance enable | (4<<1)//warped distance (4 recommended) | (ROTATEMODE<<4)//rotate mode 0\1 disable\180 | (MIRRORMODE<<5)//mirror mode 0\1\2\3 disable\up_and_down\left_and_right\up_and_down_left_and_right | (1<<8); REG32(LCDCON0) |= (0<<0) //[0]: lcd enable | (LCD_INTERFACE_SEL<<1) //[2:1]: TV out | (DISPLAY_CHANNEL<<3)//[3:6]: osd1ãosd2ãosd3ãvideo enable | (0<<9) //[9]: odd_and_even line first 0/1 even/odd | (0<<10)//one frame display finish pending interrupt | (0<<11)//write back 8line finish pending interrupt | (0<<12);//video or osd buffer empty pending interrupt REG32(LCDCON0) &= ~((1 << 9) ); //[9]: odd_and_even line first 0/1 even/odd tvout_lcd_en(); tv_enable(); Delay_MS(100); // let tvout work steady } OSDInfInit(); // tvout_reg_printf(); }