It was tested on STM32F103 with external bus (SFMC)
#define LCD_ILI9341_CMD(index) ((*(volatile u16 *) ((u32)0x6C000000)) = ((u16)index))
#define LCD_ILI9341_Parameter(val) ((*(volatile u16 *) ((u32)0x6D000000)) = ((u16)(val)))
for (i=0; i< (0xAFFf<<2); i++); // delay
GPIOG->BSRR = LCD_RESET;
for (i=0; i< (0xAFFf<<2); i++);
/* Pixel Format Set (3Ah) */
LCD_ILI9341_CMD(0x3a);
LCD_ILI9341_Parameter(0x55); // set to 16bit per pixel
/* Sleep Out (11h) */
LCD_ILI9341_CMD(0x11);
for (i=0; i< (0xAFFf<<2); i++);
/* Display ON (29h) */
LCD_ILI9341_CMD(0x29);
No comments:
Post a Comment