📄 tcon_drv_ar1829.c
字号:
//include tft panel//
#if defined(TFT_SUNPLUS_AUO_PANEL)
#define TFT_SUNPLUS_AUO_PANEL_LED_BACKLIGHT
//#define TFT_SUNPLUS_AUO_PANEL_CCFL_BACKLIGHT
#endif
#ifdef TFT_SUNPLUS_AUO_PANEL_LED_BACKLIGHT
#include "..\panel\tft_sunplus_ar1829_auo_panel_led.h"
#include "..\panel\tft_sunplus_ar1829_auo_panel_led.c"
#elif defined(TFT_SUNPLUS_AUO_PANEL_CCFL_BACKLIGHT)
#include "..\panel\tft_sunplus_ar1829_auo_panel_ccfl.h"
#include "..\panel\tft_sunplus_ar1829_auo_panel_ccfl.c"
#endif
void backlight_on(void)
{
GPIO_M_SET(1,1);
GPIO_E_SET(1,1);
GPIO_O_SET(1,1);
}
void backlight_off(void)
{
GPIO_M_SET(1,1);
GPIO_E_SET(1,1);
GPIO_O_SET(1,0);
}
#if 1//def TCON_DRIVER_ARK1829
void ark1829_photo_16_9()
{
#if 0
const BYTE ark_1829_table_169[]=
{
1,0x45 ,0x78,
1,0x61 ,0x09,
1,0x86 ,0x00,
1,0x7a ,0x00,
1,0x7b ,0x1b,
1,0x6a ,0x00,
1,0x6b ,0x1e,
1,0x6d ,0x14,
1,0x8a ,0x02,
0,
};
#endif
WriteI2c(TCONT_I2C_ADDR,0x45,0x78,1);
WriteI2c(TCONT_I2C_ADDR,0x61,0x09,1);
WriteI2c(TCONT_I2C_ADDR,0x86,0x00,1);
WriteI2c(TCONT_I2C_ADDR,0x7a,0x00,1);
WriteI2c(TCONT_I2C_ADDR,0x7b,0x1b,1);
WriteI2c(TCONT_I2C_ADDR,0x6a,0x00,1);
WriteI2c(TCONT_I2C_ADDR,0x6b,0x1e,1);
WriteI2c(TCONT_I2C_ADDR,0x6d,0x14,1);
WriteI2c(TCONT_I2C_ADDR,0x8a,0x02,1);
}
void ark1829_photo_4_3()
{
#if 0
const BYTE ark_1829_table_43[]=
{
1,0x45 ,0xa5,
1,0x61 ,0xff,
1,0x86 ,0x1e,
1,0x7a ,0x01,
1,0x7b ,0x20,
1,0x6a ,0x00,
1,0x6b ,0xff,
1,0x6d ,0xc4,
1,0x8a ,0x02,
0,
};
#endif
WriteI2c(TCONT_I2C_ADDR,0x45,0xa5,1);
WriteI2c(TCONT_I2C_ADDR,0x61,0xff,1);
WriteI2c(TCONT_I2C_ADDR,0x86,0x1e,1);
WriteI2c(TCONT_I2C_ADDR,0x7a,0x01,1);
WriteI2c(TCONT_I2C_ADDR,0x7b,0x20,1);
WriteI2c(TCONT_I2C_ADDR,0x6a,0x00,1);
WriteI2c(TCONT_I2C_ADDR,0x6b,0xff,1);
WriteI2c(TCONT_I2C_ADDR,0x6d,0xc4,1);
WriteI2c(TCONT_I2C_ADDR,0x8a,0x02,1);
}
#endif
//just like the function name
void set_tft_tcon1829_tv_format(UINT8 panelfmt)
{
WriteI2c(TCONT_I2C_ADDR,0x05,0x00,1);
if(panelfmt == 1)
{
ark1829_photo_4_3();
}
else
{
ark1829_photo_16_9();
}
delay_1ms(200);
WriteI2c(TCONT_I2C_ADDR,0x05,0xa0,1);
}
#ifdef SUPPORT_DPF_UI
void set_tft_tcon_tv_format(UINT8 panelfmt)
{
if(dpf_input_play_process == DPF_PLAY_MEDIA_STATE)
{
WriteI2c(TCONT_I2C_ADDR,0x05,0x00,1);
if(panelfmt == 1)
{
ark1829_photo_4_3();
}
else
{
ark1829_photo_16_9();
}
delay_1ms(200);
WriteI2c(TCONT_I2C_ADDR,0x05,0xa0,1);
}
}
#endif
void set_tft_ark1829_power_off()
{
WriteI2c(TCONT_I2C_ADDR,0x04,0x00,1);
}
void set_tft_ark1829_power_on()
{
WriteI2c(TCONT_I2C_ADDR,0x04,0x81,1);
WriteI2c(TCONT_I2C_ADDR,0x05,0xa0,1);
}
void reset_tft(void)
{
#ifdef TFT_SUNPLUS_AUO_PANEL_LED_BACKLIGHT
Init_ARK_1829_LED();
#else
Init_ARK_1829_CCFL();
#endif
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -