MKS Robin ILI9328 TFT support (#16401)

This commit is contained in:
Alexander Gavrilenko
2020-01-02 05:55:37 +03:00
committed by Scott Lahteine
parent 747b2b9bf4
commit c6f7ea9f22
3 changed files with 298 additions and 122 deletions

View File

@ -49,6 +49,7 @@
void LCD_IO_Init(uint8_t cs, uint8_t rs);
void LCD_IO_WriteData(uint16_t RegValue);
void LCD_IO_WriteReg(uint16_t Reg);
uint16_t LCD_IO_ReadData(uint16_t RegValue);
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize);
#ifdef LCD_USE_DMA_FSMC
void LCD_IO_WriteMultiple(uint16_t data, uint32_t count);
@ -80,7 +81,9 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi
u8g_Delay(50);
if (arg_ptr)
*((uint32_t *)arg_ptr) = LCD_IO_ReadData(LCD_READ_ID, 3);
*((uint32_t *)arg_ptr) = LCD_IO_ReadData(0x0000);
if (*((uint32_t *)arg_ptr) == 0)
*((uint32_t *)arg_ptr) = (LCD_READ_ID << 24) | LCD_IO_ReadData(LCD_READ_ID, 3);
isCommand = 0;
break;
@ -265,6 +268,13 @@ void LCD_IO_WriteReg(uint16_t Reg) {
__DSB();
}
uint16_t LCD_IO_ReadData(uint16_t RegValue) {
LCD->REG = RegValue;
__DSB();
return LCD->RAM;
}
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) {
volatile uint32_t data;
LCD->REG = RegValue;