[bsp][stm32f429-disco] Repair encoding problem
This commit is contained in:
parent
7d0a99c58f
commit
f8918c34f1
|
@ -21,13 +21,13 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
rt_uint16_t width; //LCD <20><><EFBFBD>
|
||||
rt_uint16_t height; //LCD <20>߶<EFBFBD>
|
||||
rt_uint16_t id; //LCD ID
|
||||
rt_uint8_t dir; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rt_uint16_t wramcmd; //<2F><>ʼдgramָ<6D><D6B8>
|
||||
rt_uint16_t setxcmd; //<2F><><EFBFBD><EFBFBD>x<EFBFBD><78><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
||||
rt_uint16_t setycmd; //<2F><><EFBFBD><EFBFBD>y<EFBFBD><79><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
||||
rt_uint16_t width;
|
||||
rt_uint16_t height;
|
||||
rt_uint16_t id;
|
||||
rt_uint8_t dir; //Horizontal or vertical screen control: 0, vertical; 1, horizontal
|
||||
rt_uint16_t wramcmd;
|
||||
rt_uint16_t setxcmd;
|
||||
rt_uint16_t setycmd;
|
||||
} lcd_info_t;
|
||||
|
||||
typedef struct
|
||||
|
@ -36,22 +36,20 @@ typedef struct
|
|||
volatile rt_uint16_t ram;
|
||||
} lcd_ili9341_t;
|
||||
|
||||
//ʹ<><CAB9>NOR/SRAM<41><4D> Bank1.sector1,<2C><>ַλHADDR[27,26]=00 A18<31><38>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱSTM32<33>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һλ<D2BB><CEBB><EFBFBD><EFBFBD>!
|
||||
#define LCD_ILI9341_BASE ((rt_uint32_t)(0x60000000 | 0x0007FFFE))
|
||||
#define ili9341 ((lcd_ili9341_t *) LCD_ILI9341_BASE)
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//ɨ<EFBFBD>跽<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define L2R_U2D 0 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>
|
||||
#define L2R_D2U 1 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
||||
#define R2L_U2D 2 //<2F><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>,<2C><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>
|
||||
#define R2L_D2U 3 //<2F><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>,<2C><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
||||
#define U2D_L2R 4 //<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define U2D_R2L 5 //<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>,<2C><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
||||
#define D2U_L2R 6 //<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define D2U_R2L 7 //<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>,<2C><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
||||
#define DFT_SCAN_DIR L2R_U2D //Ĭ<>ϵ<EFBFBD>ɨ<EFBFBD>跽<EFBFBD><E8B7BD>
|
||||
//Definition of scan direction
|
||||
#define L2R_U2D 0
|
||||
#define L2R_D2U 1
|
||||
#define R2L_U2D 2
|
||||
#define R2L_D2U 3
|
||||
#define U2D_L2R 4
|
||||
#define U2D_R2L 5
|
||||
#define D2U_L2R 6
|
||||
#define D2U_R2L 7
|
||||
#define DFT_SCAN_DIR L2R_U2D
|
||||
|
||||
static lcd_info_t lcddev;
|
||||
LTDC_HandleTypeDef LtdcHandler;
|
||||
|
@ -730,108 +728,6 @@ rt_uint16_t ili9341_bgr2rgb(rt_uint16_t value)
|
|||
|
||||
return (blue << 11) + (green << 5) + (red << 0);
|
||||
}
|
||||
|
||||
//static void ili9341_set_scan_direction(rt_uint8_t dir)
|
||||
//{
|
||||
// rt_uint16_t regval = 0;
|
||||
// rt_uint16_t dirreg = 0;
|
||||
// rt_uint16_t temp;
|
||||
|
||||
// switch (dir)
|
||||
// {
|
||||
// case L2R_U2D://<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>
|
||||
// regval |= (0 << 7) | (0 << 6) | (0 << 5);
|
||||
// break;
|
||||
// case L2R_D2U://<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
||||
// regval |= (1 << 7) | (0 << 6) | (0 << 5);
|
||||
// break;
|
||||
// case R2L_U2D://<2F><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>,<2C><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>
|
||||
// regval |= (0 << 7) | (1 << 6) | (0 << 5);
|
||||
// break;
|
||||
// case R2L_D2U://<2F><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>,<2C><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
||||
// regval |= (1 << 7) | (1 << 6) | (0 << 5);
|
||||
// break;
|
||||
// case U2D_L2R://<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// regval |= (0 << 7) | (0 << 6) | (1 << 5);
|
||||
// break;
|
||||
// case U2D_R2L://<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>,<2C><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
||||
// regval |= (0 << 7) | (1 << 6) | (1 << 5);
|
||||
// break;
|
||||
// case D2U_L2R://<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// regval |= (1 << 7) | (0 << 6) | (1 << 5);
|
||||
// break;
|
||||
// case D2U_R2L://<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>,<2C><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
||||
// regval |= (1 << 7) | (1 << 6) | (1 << 5);
|
||||
// break;
|
||||
// }
|
||||
|
||||
// dirreg = 0X36;
|
||||
// ili9341_write_reg_with_value(dirreg, regval);
|
||||
|
||||
// if (regval & 0X20)
|
||||
// {
|
||||
// if (lcddev.width < lcddev.height)//<2F><><EFBFBD><EFBFBD>X,Y
|
||||
// {
|
||||
// temp = lcddev.width;
|
||||
// lcddev.width = lcddev.height;
|
||||
// lcddev.height = temp;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (lcddev.width > lcddev.height)//<2F><><EFBFBD><EFBFBD>X,Y
|
||||
// {
|
||||
// temp = lcddev.width;
|
||||
// lcddev.width = lcddev.height;
|
||||
// lcddev.height = temp;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// ili9341_write_reg(lcddev.setxcmd);
|
||||
// ili9341_write_data(0);
|
||||
// ili9341_write_data(0);
|
||||
// ili9341_write_data((lcddev.width - 1) >> 8);
|
||||
// ili9341_write_data((lcddev.width - 1) & 0XFF);
|
||||
|
||||
// ili9341_write_reg(lcddev.setycmd);
|
||||
// ili9341_write_data(0);
|
||||
// ili9341_write_data(0);
|
||||
// ili9341_write_data((lcddev.height - 1) >> 8);
|
||||
// ili9341_write_data((lcddev.height - 1) & 0XFF);
|
||||
//}
|
||||
|
||||
//void ili9341_set_backlight(rt_uint8_t pwm)
|
||||
//{
|
||||
// ili9341_write_reg(0xBE);
|
||||
// ili9341_write_data(0x05);
|
||||
// ili9341_write_data(pwm*2.55);
|
||||
// ili9341_write_data(0x01);
|
||||
// ili9341_write_data(0xFF);
|
||||
// ili9341_write_data(0x00);
|
||||
// ili9341_write_data(0x00);
|
||||
//}
|
||||
|
||||
//void ili9341_set_display_direction(rt_uint8_t dir)
|
||||
//{
|
||||
// lcddev.dir = dir;
|
||||
// if (dir == 0)
|
||||
// {
|
||||
// lcddev.width = 240;
|
||||
// lcddev.height = 320;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// lcddev.width = 320;
|
||||
// lcddev.height = 240;
|
||||
// }
|
||||
|
||||
// lcddev.wramcmd = 0X2C;
|
||||
// lcddev.setxcmd = 0X2A;
|
||||
// lcddev.setycmd = 0X2B;
|
||||
|
||||
// ili9341_set_scan_direction(DFT_SCAN_DIR);
|
||||
//}
|
||||
|
||||
|
||||
void _lcd_low_level_init(void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue