Giter Site home page Giter Site logo

robertobenjami / stm32_graphics_display_drivers Goto Github PK

View Code? Open in Web Editor NEW
497.0 20.0 105.0 8.76 MB

STM32 LCD drivers (currently: spi(dma), gpio, fsmc(dma), st7735, st7783, ili9325, ili9328, ili9341, ili9486, ili9488, hx8347g)

C 99.48% HTML 0.52%
c stm32 lcd-driver st7735 st7783 ili9325 ili9341 ili9488 hx8347g touchscreen

stm32_graphics_display_drivers's People

Contributors

robertobenjami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32_graphics_display_drivers's Issues

Help with ILI9486 - SPI mode.

Hi!

I can use this library for comunicate stm32f103c8 with a SPI LCD 3.5" for RPi. My display is similar like that : "http://www.lcdwiki.com/3.5inch_RPi_Display ".
As i can see the driver is ili9486. I tryed it with an example with Standard Peripheral Library , but not HAL.
I followed all the steps in this instructions and compiling the code works well. But i cant see image. I change the pins, and the macros in "lcd_io_spi.h" but nothing...

Can you help me?

I use this guide shared in your website
(https://www.youtube.com/watch?v=4NZ1VwuQWhw)
stm32f103c8 (bluepill board) - st7735 spi driver

Great work !
Tks

using LCD_IO_WriteCmd8MultipleData16 for each image row

Would it be possible to expose these functions:

ili9341_SetDisplayWindow(Xpos, Ypos, Xsize, Ysize);
LCD_IO_WriteCmd8MultipleData16(ILI9341_RAMWR, (uint16_t *)pData, Xsize * Ysize);

So it would be possible to send each row of image without calling ili9341_SetDisplayWindow?

ili9341_SetDisplayWindow(Xpos, Ypos, Xsize, Ysize);
for (int i = 0; i < image_height; i++)
{
  // read image line
  LCD_IO_WriteCmd8MultipleData16(ILI9341_RAMWR, (uint16_t *)pData, Xsize * Ysize);
}

Just interested to see would it improve performance. I am trying to make screen as fast as possible...

SPI Reading Codes not working

Hi dear Roberto Benjami.
I used your codes.
I am using STM32F030C8T6 in SPI Mode and ili9341 Driver.
The answer of the codes used to read information from the LCD is always 0x0000. Like BSP_LCD_ReadID() or BSP_LCD_ReadPixel().

stm32f407ve LL spi possible?

Hi

Is it possible to drive my ILI9341 (DSO138) display on the STM32f407VET board (black)
via LL drivers without HAL using spi dma?

Or does this require heavy rewriting of your driver code to work with LL?

Image distortions on STMF407VE

Hi when I moved same code from STM32F091RC to STM32F407VE (changed driver to FSMC 8bit) I am getting strange image distortions. On STM32F091RC everything was working fine.
I am using ILI9486 driver. Tried no DMA but does not change images apear distorted.
Any ideas?

Touch xpt2046/ili9341

Hello Roberto, Thanks a lot for your excellent work. A time ago, I got from china, some recicled boards wich use Illi 9341, ads7846 and stm32f103vct6 and a 2.8 inch Lcd , but I didn´t get any information about firmware (It was for a cryolipolysis machine). Your firmware on the display is working excellent but when I tried to add ts functions I coudnt get to make it work. I have to say the ADS7846 isn´t conected to SPI port, so I had to use the configuration for SPI SOFTWARE. After try reading cordinates results on serial port, I realised that the firmware doesnt write the port and also cant get the coordinates. I wrote my own code and I discoverd that the problem is using bit masking for write/read ports.
Your code write in ts_xpt_2046.c
void TsWrite8(uint8_t d8)
{

GPIOX_ODR(TS_MOSI) = BITBAND_ACCESS(d8, 7);
TS_WRITE_CLK;
GPIOX_ODR(TS_MOSI) = BITBAND_ACCESS(d8, 6);
TS_WRITE_CLK;
GPIOX_ODR(TS_MOSI) = BITBAND_ACCESS(d8, 5);
TS_WRITE_CLK;
GPIOX_ODR(TS_MOSI) = BITBAND_ACCESS(d8, 4);
TS_WRITE_CLK;
GPIOX_ODR(TS_MOSI) = BITBAND_ACCESS(d8, 3);
TS_WRITE_CLK;
GPIOX_ODR(TS_MOSI) = BITBAND_ACCESS(d8, 2);
TS_WRITE_CLK;
GPIOX_ODR(TS_MOSI) = BITBAND_ACCESS(d8, 1);
TS_WRITE_CLK;
GPIOX_ODR(TS_MOSI) = BITBAND_ACCESS(d8, 0);
TS_WRITE_CLK;
}

I tried with that and I got values, but has too much noise, I would like use your code

unsigned char TCS_SPI_Read_Write(unsigned char DataByte)
{
unsigned char Bit,result = 0 ;
for (Bit = 0; Bit < 8; Bit++)
{
// Clock High(Prepared Write Data)
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_15, GPIO_PIN_SET);
// Write Data to MOSI Pin : MSB First
if((DataByte & 0b10000000)== 0b10000000)//0x80)
{
// Set Bit Data(MOSI) = 1
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_13, GPIO_PIN_SET);
}
else
{
// Reset Bit Data(MOSI) = 0
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_13, GPIO_PIN_RESET);
}
// Clock Low(Strobe Data & Read)
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_15, GPIO_PIN_RESET);
// Shift Next Bit Data
DataByte <<= 1;
// Read Data From MISO Pin
result <<= 1;
if ( HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_11) == GPIO_PIN_SET)
{
result |= 0b00000001;//0x01;
} }
return (result);
}

Thanks again, regards from Argentina

ili9328 tft lcd Touch not working

when i use ili9328 tft lcd with arduino uno code then ili9328 tft lcd touch is working fine.
With stm32f103vbt6 microcontroller & ili9328 tft lcd, i am using lcdts_io_gpio8 file to parallel communicate with microcontroller with application TouchCalib . normal lcd print is working fine but touch is not working. Please help me to resolve this problem. I am also attaching the file......
STM32F103VBT6 WITH ILI9328 WITH ATOLIC TRUE STUDIO 2 18-08-2022 REV1.zip
. My email id is [email protected]

Help for XPT2046 on ILI9486(SPI mode)

Hi.
ILI9488 (spi mode-DMA) works great on STM32F407VET6. I couldn't find any example related to XPT2046. I decided to do it myself. Many compilation errors occurred when I included the XPT2046 touchscreen. The problem appears in the file "stm32_adafruit_ts.c".
Where am I doing wrong?

Errors:

17:04:13 **** Incremental Build of configuration Debug for project Stm32F407_ili9488_Touch_2 ****
make -j6 all
arm-none-eabi-gcc -o "Stm32F407_ili9488_Touch_2.elf" @"objects.list" -mcpu=cortex-m4 -T"C:\Disk\CAN\CubeMxTest\Stm32F407_ili9488_Touch_2\STM32F407VETX_FLASH.ld" --specs=nosys.specs -Wl,-Map="Stm32F407_ili9488_Touch_2.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./Core/Src/Lcd/stm32_adafruit_ts.o: in function BSP_TS_Init': C:/Disk/CAN/CubeMxTest/Stm32F407_ili9488_Touch_2/Debug/../Core/Src/Lcd/stm32_adafruit_ts.c:34: undefined reference to ts_drv'
c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./Core/Src/Lcd/stm32_adafruit_ts.o: in function BSP_TS_GetState': C:/Disk/CAN/CubeMxTest/Stm32F407_ili9488_Touch_2/Debug/../Core/Src/Lcd/stm32_adafruit_ts.c:66: undefined reference to ts_drv'
c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: C:/Disk/CAN/CubeMxTest/Stm32F407_ili9488_Touch_2/Debug/../Core/Src/Lcd/stm32_adafruit_ts.c:66: undefined reference to `ts_cindex'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:67: Stm32F407_ili9488_Touch_2.elf] Error 1
"make -j6 all" terminated with exit code 2. Build might be incomplete.

17:04:14 Build Failed. 6 errors, 0 warnings. (took 1s.445ms)

SPFD5408/ILI932x

Namely, in fsmc mode 8bit with the SPFD 5408 controller, I can't get a display on the screen, only a white screen, no image. This controller in the sequence to write the index register does not need to write the higher byte, only the low uint8_t byte, could it be a problem or the speed of the transaction?
To be precise, the controller in that lcd has ID = 2053, but it works fine with drivers for ILI932x. It is otherwise a very common LCD Arduino shield.
Just one more observation that might help solve the problem:
At the moment when he needs to write something in GRAM, the screen is completely white, but in between for a moment color noise appears. That's why I thought that the problem might be with the speed of writing in GRAM.
regards, freetoair

Running with Keil? How to solve errors/warnings?

Can anyone run this on Keil?

I tried running but got these errors/warnings:

..\Src\App\appLcdSpeedTest.c(94): warning: #223-D: function "random" declared implicitly
x = random() % BSP_LCD_GetXSize();

..\Src\App\appLcdSpeedTest.c(373): error: #20: identifier "_impure_ptr" is undefined
_impure_ptr->_r48->_rand_next = 0;

..\Src\Lcd\lcd_io_spi.c(660): warning: #161-D: unrecognized #pragma

#pragma GCC push_options
#pragma GCC optimize("O0")
void LCD_IO_Delay(volatile uint32_t c)
{
  while(c--);
}
#pragma GCC pop_options

..\Src\Lcd\lcd_io_spi.c(721): warning: #61-D: integer operation result is out of range
..\Src\Lcd\lcd_io_spi.c(721): warning: #68-D: integer conversion resulted in a change of sign
GPIOX_MODE(MODE_PP_ALTER_50MHZ, LCD_MOSI);

....\f103c8t_app\Src\App\beer_60x100_16.c(39): error: #1077: an initializer cannot be specified for a flexible array member

How could I solve these errors/warnings?

License

Hello Roberto,

thanks for the drivers, they are great!

I would like to use one of the drivers in closed source project and I did not found any license disclaimer in your repository.
As discussed e.g. here
https://opensource.stackexchange.com/questions/1720/what-can-i-assume-if-a-publicly-published-project-has-no-license
no license means that all rights are reserved and I cannot modify or redistribute this code without explicit permission from the copyright holder.

Could you please state the license type or could I get permission to use it?

Thanks,
Petr

FSMC changed RS line

I had to change the RS line in the FSMC driver to A17 (PD 12). But I can't find how I should change #define LCD_REGSELECT_BIT 6 to get the proper memory bank select address.
My question is how to get LCD_REGSELECT_BIT =" x " in a function of LCD RS select line ?

regards, freetoair.

ili9486

if possible please support ili9486 in 8 bit mode

ILI9488 Hardware SPI not working (but software mode works)

stm32_caplcd_test.zip

Hi RobertoBenjami!

I'm trying to use an ILI9488 screen and recently saw this library. It has been super helpful, thanks a lot for your effort!

However, I ran into an issue using hardware SPI. The whole project file is attached.

I set up the hardware SPI1 in CubeIDE and configured the lcd_io_spi.h, it will not work if I set the LCD_SPI to 1 (i.e. SPI1), however when I switch it to 0 and keep everything else, the code works.

I would really like to use hardware mode for DMA support. Could you help me to see whether I have done anything wrong during the configuration?

Best regards,
Desmond

LittleVGL compatibility?

Hello, is there, or have your tried your drivers in combination with LittleVGL (lvgl.io)?
Basically, it just needs a (callback) function to fill a certain area of the screen with a buffer (of color values).
And preferable via DMA.
Thanks!

STM32F091RC Nuclio - can it be that DMA interfare with CAN BUS?

Hi, your driver is working fine with STM32F091RC, but once I try to draw while also sending receiving CAN BUS messages MCU gets into infinite loop in WaitForDmaEnd, LCD_IO_DmaTransferStatus value seems to be 1.

Is my configuration wrong?

My configuration:

 #define LCD_SPI           2
 #define LCD_SPI_MODE      1
 #define LCD_SPI_SPD_WRITE 1
 #define LCD_SPI_SPD_READ  3
 #define LCD_SPI_AFR       0
 #define LCD_RST           B, 11  /* If not used leave it that way */
 #define LCD_RS            B, 14
 #define LCD_CS            B, 12
 #define LCD_SCK           B, 13
 #define LCD_MOSI          B, 15
 #define LCD_MISO          X, 0  /* If not used leave it that way */
 #define LCD_BL            X, 0  /* If not used leave it that way */
 #define LCD_BLON          0
 #define LCD_SCK_EXTRACLK  0
 #define LCD_DMA_TX        1, 5, 3, 0
 #define LCD_DMA_RX        1, 4, 3, 0
 #define LCD_DMA_TXWAIT      0
 #define LCD_DMA_RX_BUFSIZE  256
 #define LCD_DMA_RX_BUFMODE  1

If I enable Software SPI everything works just drawing is much slower. How to use DMA SPI with CAN also?

Driver integration with STemWin library

Hello Roberto. First of all I want to thank you for sharing your drivers. They are really very useful.
At the moment I'm using the driver for ILI9486 with an F446RE nucleo board (8 bit parallel with Touch screen) and it works perfectly.
However, I cannot integrate your drivers with the STemWin library.
Could you help me?
Thanks again

Port to mbed

Hi,
would it make sense to port the library to mbed 5 or 6?

thanks

David

STM32H7

I can't make it work with the STM32H743IIT6 with FMC 16Bit , I don't know why , Can u add H7 support for the fmc?

ILI9486 calibration problem

Hello, i've got LCD TFT ILI9486 which uses 8-bit parallel interface. So in that i case i have lcdts_io_gpio8.c/h files respectively.

The file .h is configurated like this:

  /*
   * 5 controll pins (CS, RS, WR, RD, RST) + 8 data pins + backlight pin
  
   * note: since the LCD and touch are on the same pins, 
   * the simultaneous use of these should be excluded.
   * In multi-threaded interruption mode, collision prevention must be avoided!
   */
  
  //=============================================================================
  /* Lcd controll pins assign (A..K, 0..15) */
  #define LCD_CS            B, 0
  #define LCD_RS            A, 4
  #define LCD_WR            A, 1
  #define LCD_RD            A, 0  /* If not used leave it that way */
  #define LCD_RST           C, 1  /* If not used leave it that way */
  
  /* Lcd data pins assign (A..K, 0..15) */
  #define LCD_D0            A, 9
  #define LCD_D1            C, 7
  #define LCD_D2            A, 10
  #define LCD_D3            B, 3
  #define LCD_D4            B, 5
  #define LCD_D5            B, 4
  #define LCD_D6            B, 10
  #define LCD_D7            A, 8
  
  /* Backlight control
     - BL: A..K, 0..15 (if not used -> X, 0)
     - BL_ON: 0 = active low level, 1 = active high level */
  #define LCD_BL            X, 0  /* If not used leave it that way */
  #define LCD_BLON          0
  
  /*-----------------------------------------------------------------------------
  Touch I/O pins and A/D channels
  In the lcd board are paralell pins
   - TS_XM <- LCD_RS
   - TS_XP <- LCD_D6
   - TS_YM <- LCD_D7
   - TS_YP <- LCD_WR */
  
  /* ADC converter number (1, 2, 3, or 0 if not used)
     - 0: analog touchscreen driver not used
     - 1..3: A/D converter number */
  #define TS_ADC            1
  
  /* If you use different pins for touch AD conversion than for lcd control, specify it
     (When using the same pins or not using a touchscreen -> X, 0
      in this case, LCD_RS and LCD_WR will be the selected AD pin on the touchscreen) */
  #define TS_XM_AN          A, 4  /* If not used leave it that way */
  #define TS_YP_AN          A, 1  /* If not used leave it that way */
  
  /* Select the AD channels */
  #define TS_XM_ADCCH       1
  #define TS_YP_ADCCH       0
  
  /* Wait time for LCD write and read pulse and touchscreen AD converter
     - First, give 10, 20, 500 values, then lower them to speed up the program.
       (values also depend on processor speed and LCD display speed) */
  #define LCD_WRITE_DELAY  0
  #define LCD_READ_DELAY   1
  #define TS_AD_DELAY     500

To watch SWO i use STM32CubeProgrammer with SWV. I cannot understand why output is like this:

image

and why after 3 checked rectangles it does not show me TS_CINDEX values.

I've checked that longer SWO buffers works corrcectly.

animation question

Hi
Sorry, programming noob alert!
Not a bug, rather a programming question.
I connected the display to my blue pill via 8bit parallel and works so far.
How would one realize for example a smooth moving rectangle(w=40,h=40) from X0/Y0 to X0/Y200 ?
I tried with a simple for loop counting up to the screens height-rectangleSize, moving the rect step by step and after each step I cleared the screen with BSP_LCD_Clear(RGB888TORGB565(0,0,0)).
But clearing the screen like that is very time intensive and gives obviously not a smooth movement.

My next try was to move the rect and behind I move another rect that clears the previous rect with the background color. That gives me a nice smooth animation instead of clearing the whole screen every step.
Is that the right way? So how would you do that?

Touch XPT2046

Hello Roberto,

First of all, thank you for your work.
You really did a GREAT job with these graphical drivers.
I'm however facing a little problem.
I'm using a 3.5 touch panel, sporting ILI9488 and XPT2046.
I interfaced it with a NUCLEO-F411RE development board (STM32F411RE in LQPF64 package).
The panel shows the usual ILI9488 SDO problem, in which the line is never released and never goes tri-state.
So I decide to use two different SPI lines, one for the LCD (ILI9488), the other for the touchscreen (XPT2046).
I used the "stm32f4xx/cd_io_spi.x" driver, which works just fine (with the "LcdSpeedTest" app).
When I try to add the touchscreen support, however, I get errors.
I imported the "ts_xpt2046.x" files into the project.
Unfortunately, the compiler keep complaining that a "ts_drv" reference is missing, since it is not declared nor referenced in any place.
I think we need something like the "lcd_drv" defined in "ili9488" driver.
I know we need to write a xpt2046 driver, I will try to write it, but before, do you have something already done?
Thank you!

'GPIOX' undeclared (first use in this function); did you mean 'GPIOA'?

Thank you for the code. I've done everything like the video, but there is some errors in this file "lcd_io_gpio16.c".

For example, in line 73 (#define GPIOX_SET_(a, b) GPIO ## a ->BSRR = 1 << b), there is this error:

'GPIOX' undeclared (first use in this function); did you mean 'GPIOA'?

I've commented these 5 lines to see other possible errors. Now, there is an error in this file "lcd_io_gpio16.h".

In line 8 (#define LCD_CS F, 13), there is this error:

'F' undeclared (first use in this function)

Do you know what I've done wrong?

Thank you in advance.

Hamed

ILI9488 coordinate not start from the left of the screen

Hello,
I meet an issue that the start coordinate not start the left of the screen, it's start the right of the screen. I have checked the ili9488_Init(), but not found the helpful information. It's normal for me to use other's code, the follwing is the ili9488 init code:

LCD_WR_REG(0XD3);	
LCD.ID=LCD_RD_DATA();     
LCD.ID=LCD_RD_DATA();    
LCD.ID=LCD_RD_DATA();    
LCD.ID<<=8;               
LCD.ID|=LCD_RD_DATA();    
printf(" LCD ID:ILI%x\r\n",LCD.ID);
if(LCD.ID!=0x9488)while(1);	

LCD_WR_REG(0xE0); //P-Gamma
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x03);
LCD_WR_DATA(0x0C);
LCD_WR_DATA(0x09);
LCD_WR_DATA(0x17);
LCD_WR_DATA(0x09);
LCD_WR_DATA(0x3E);
LCD_WR_DATA(0x89);
LCD_WR_DATA(0x49);
LCD_WR_DATA(0x08);
LCD_WR_DATA(0x0D);
LCD_WR_DATA(0x0A);
LCD_WR_DATA(0x13);
LCD_WR_DATA(0x15);
LCD_WR_DATA(0x0F);

LCD_WR_REG(0XE1); //N-Gamma
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x11);
LCD_WR_DATA(0x15);
LCD_WR_DATA(0x03);
LCD_WR_DATA(0x0F);
LCD_WR_DATA(0x05);
LCD_WR_DATA(0x2D);
LCD_WR_DATA(0x34);
LCD_WR_DATA(0x41);
LCD_WR_DATA(0x02);
LCD_WR_DATA(0x0B);
LCD_WR_DATA(0x0A);
LCD_WR_DATA(0x33);
LCD_WR_DATA(0x37);
LCD_WR_DATA(0x0F);

LCD_WR_REG(0XC0); //Power Control 1
LCD_WR_DATA(0x17); //Vreg1out
LCD_WR_DATA(0x15); //Verg2out

LCD_WR_REG(0xC1); //Power Control 2
LCD_WR_DATA(0x41); //VGH,VGL

LCD_WR_REG(0xC5); //Power Control 3
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x12); //Vcom
LCD_WR_DATA(0x80);

LCD_WR_REG(0x36); //Memory Access
LCD_WR_DATA(0x48);

LCD_WR_REG(0x3A); // Interface Pixel Format
LCD_WR_DATA(0x55);  ///?????

LCD_WR_REG(0XB0); // Interface Mode Control
LCD_WR_DATA(0x00);

LCD_WR_REG(0xB1); //Frame rate
LCD_WR_DATA(0xA0); //60Hz

LCD_WR_REG(0xB4); //Display Inversion Control
LCD_WR_DATA(0x02); //2-dot

LCD_WR_REG(0XB6); //RGB/MCU Interface Control
LCD_WR_DATA(0x02); //MCU
LCD_WR_DATA(0x02); //Source,Gate scan dieection

LCD_WR_REG(0XE9); // Set Image Function
LCD_WR_DATA(0x00); // Disable 24 bit data input  

LCD_WR_REG(0xF7);// Adjust Control
LCD_WR_DATA(0xA9);
LCD_WR_DATA(0x51);
LCD_WR_DATA(0x2C);
LCD_WR_DATA(0x82);
// D7 stream, loose
LCD_WR_REG(0x11); //Sleep out
LCD_Delay(120);
LCD_WR_REG(0x29); //Display on

LCD_DisplayMode(Mode_V);		 // Set display mode
LCD_Clear();		                         // clear the screen

The LCD_DisplayMode() function like this:

void LCD_DisplayMode(uint8_t direction)
{
	if (LCD.Direction == Mode_H) 		
	{
		LCD_WR_REG(0X36);		
		LCD_WR_DATA(0X28); 	
		LCD_WR_REG(0x2A); 	
		LCD_WR_DATA(0x00);	
		LCD_WR_DATA(0x00); 			
		LCD_WR_DATA(0x01);	
		LCD_WR_DATA(0XDF); 
		LCD_WR_REG(0x2B); 
		LCD_WR_DATA(0x00);	
		LCD_WR_DATA(0x00); 		
		LCD_WR_DATA(0x01);	
		LCD_WR_DATA(0x3F); 		
	}
	else if(LCD.Direction == Mode_V)	
	{
		LCD_WR_REG(0X36);		
		LCD_WR_DATA(0X48); 	
		LCD_WR_REG(0x2A); 	
		LCD_WR_DATA(0x00);	
		LCD_WR_DATA(0x00); 			
		LCD_WR_DATA(0x01);   
		LCD_WR_DATA(0x3F); 				
		LCD_WR_REG(0x2B);    
		LCD_WR_DATA(0x00);  
		LCD_WR_DATA(0x00); 			
		LCD_WR_DATA(0x01);   
		LCD_WR_DATA(0XDF); 			
	}
}

The LCD_Clear() like this:

void LCD_Clear(void)
{ 
	uint32_t i = 0;
	LCD_SetCursor(0,0);	
	LCD_WR_REG(0X2C);		
	for(i=0;i<320*480;i++)	
	{
		*(__IO uint16_t*) FSMC_DATA = LCD.BackColor;
	}
}
	
void LCD_SetCursor(uint16_t x, uint16_t y)
{
	LCD_WR_REG(0x2A); 							
	LCD_WR_DATA(x>>8);LCD_WR_DATA(x&0XFF); 	
	LCD_WR_DATA(0x01);  
	LCD_WR_DATA(0xDF); 	
	LCD_WR_REG(0x2B); 						
	LCD_WR_DATA(y>>8);LCD_WR_DATA(y&0XFF); 	
	LCD_WR_DATA(0x01);   
	LCD_WR_DATA(0xDF); 
}

Could you tell me what register i was missed? How can i check this issue?

Thank you very much!

ili9488 + stm32f103ret6

hi
thanks for your great work for beginners(as me!)
i am trying to run ili9488 on f103re(8 bit parallel) with your youtube film but no success
i think you have forgotten to add setup pin configurations (gpio output on video)
this is my setup
d0-d7 > pin c0 to c7
rd > pin c8
wr > pin c9
cs > pin c10
rs > pin c11
rst > pin c12
i set all pins as out put except c8 (it is input)
compile give me no error but no success in action
i use stm32cube ide in linuxmint

Please add support for display SSD1963

Hi, i'm trying to add support for display SSD1963 (800x480 7" display).
I've copied the initialization commands sequence from another library that is working, but i'm just getting the display to initialize, startup and show something (like clear screen and draw a cirle) display a blue rectangle in the center of the screen with some sorta of circle all messed up.
I have this display, so if you wanna try with my help to create this driver support, i'll be glad to contribute.

I attach here the code i've created for this display, if wanna check it:
ssd1963.zip

SPI DMA for STM32L4

I am delighted with your driver, everything is done very carefully. Tested F4, SPI + DMA, FSMC16 + DMA, ILI9341. No complaints, thank you very much. Also tested SPI on L4 (STM32L433, STM32F452), DMA does not work due to an error - the request channel is not taken into account. For definitions LCD_DMA_TX, LCD_DMA_RX there must be 4 parameters: DMA number, DMA channel, DMA request, DMA priority (similar to the L0 family).
For L4 I made the following modifications:

  • used the lcd_io_spi.h file from L0;

  • in the lcd_io_spi.c file definitions /* DMA */ copied from the file for L0;

  • in the same file lcd_io_spi.c in the LCD_IO_Init () function added the following code:

    #if DMANUM(LCD_DMA_TX) > 0
    DMAX_CSELR(LCD_DMA_TX)->CSELR = (DMAX_CSELR(LCD_DMA_TX)->CSELR & ~(0xF << (4 * (DMACHN(LCD_DMA_TX) - 1)))) | DMAREQ(LCD_DMA_TX) << (4 * (DMACHN(LCD_DMA_TX) - 1));
    #endif
    #if DMANUM(LCD_DMA_RX) > 0
    DMAX_CSELR(LCD_DMA_RX)->CSELR = (DMAX_CSELR(LCD_DMA_RX)->CSELR & ~(0xF << (4 * (DMACHN(LCD_DMA_RX) - 1)))) | DMAREQ(LCD_DMA_RX) << (4 * (DMACHN(LCD_DMA_RX) - 1));
    #endif

The TX process is now running fine. The RX process has not been tested. The numbering of channels in L0 and L4 is 1...7, so -1 in the given code must be taken into account for L0 as well.
Please update your driver accordingly.

Configurable TS pins

Hi, great job!
I recommend to pull out TS pins configuration to header file.
Not all LCD has XP/XM/YP/YM on data pins pre-configurated like it is done inside lib.
It's small change but very helpfull ;)

Whats the fastest way to draw? (ILI9341 spi dma)

Hi, I wanted to ask whats the fastest way to draw?
I noticed you are formatting whole BMP image when drawing text.
Whats the best size to send images? (having in mind that ram cant hold whole screen image)
Would you be interested in contributions for making font to support dynamic width per char and other changes in stm32_adafruit_lcd?

ILI9341 in SPI mode tested on L152RE

Hi,
Your README.md says "untested", but I tested your code on a L152RE board (Nucleo) in combination with an ILI9341 LCD, and this is working perfect (software SPI, hardware SPI & hardware SPI with DMA).
I used the STM32CubeIDE instead of TrueStudio, but your walk-through applied quite well on this IDE.
Thanks!

ILI9341 3.2inch TFT with XPT2046 Problem

Hi Roberto!
I use STM32F103C8T6 and ILI9341 display(SPI) with XPT2046, I tested that all functions can work except Display char function, I cannot display any char at the display, and the Char Test in appLcdSpeedTest is also doesn't work, it just display the black screen.

I tried to change the SPI Baud Rate but it just can control the LCD speed.

Can you tell me how to solve this problem?

Thank you!!

ssd1289 Driver

Hi I wanna Interface LCD TFT 3.2 with ssd1289 using STM32F103C8T6 ( 16 bit parallel ) and I dont have driver for the lcd can you please add driver ssd1289 or can help find one for that.

ILI9881C driver

Hi,

I am working on display for electric motorcycle.

I have STM32F769i-Discovery and WF50DSYA3MNN0.
This display has ILI9881C driver. I have connected display and kit through converter board.

I find out your drivers for ili9486, ili9488,...
I would to ask, if there is posibilty modify this code and use it for ILI9881C driver.

Thanks for your advice.
Best regards Honza.

ILI9488 gpio8 mirror issue

Hello dear Benjami,

I am working on ILI9488 integration using gpio8 interface.

The mirror problem occurs when I print text on the screen. How can I solve this problem?

My configuration
#define ILI9488_INTERFACE 1
#define ILI9488_ORIENTATION 3

mirror

When I set the configuration like this
#define ILI9488_INTERFACE 0
#define ILI9488_ORIENTATION 3
problem is solving. But I am not using SPI mode and I observed SPI mode is slower than gpio8.
WhatsApp Image 2024-02-23 at 22 00 38

Add font?

Hi. Thanks for your hard work on this library. I want to ask on how can we add a custom font and font size.

Calibration not work

I think the touch calibration application is not working properly, with an error of approximately 30%-40%.
I am using f446 and ili9486 screen.

how to draw a string on ILI9488 screen?

hello, thank you for your hard work!
i want to konw how to draw a string on a ILI9488 screen? is there any function to do this ? should i write these function myself ?

Touch support for ili9341?

It seems there is no touch support for ili9341. I tried to use appPaint with ili9341 and found there are no ts_drv and ts_cindex definitions.

ILI9486 3.5 inch TFT Problem

My board is STM32F103C8T6, I use the ILI9341 LCD driver to control the ILI9341 3.5(480*320) touched TFT, but it can not display anything.

Unexpectedly, I use the ILI9486 driver to control the ILI9341, the display function is effective!!, but the touch function does not work.

I used Arduino to test whether the LCD can be touched, I'm sure it can detect the x y coordinates.

Could you help me to solve my problem?

Thank you very much!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.