Giter Site home page Giter Site logo

st7789-stm32's People

Contributors

floyd-fish avatar jasonlrh avatar legath 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

st7789-stm32's Issues

no read function

hello all,

I would want to read by SPI the configuration of ST7789 as for example RDDID or RDDCOLMOD, but i don't see any function to perform this kind of operation.
Can you provide us these functions by DMA or interuption ?

Thx

Black screen

I tried exactly same code you shared but I have only black screen.I added 4.7k pull-up resistor on SCK and MOSI but it did not work.What might be problem?Thanks.

About STM32F103C8T6

Hello,
I am trying to show pictures and videos on an st7789 screen with stm32f103c8. I wanted to try your code but my Keil uVision version does not support (L6047U: The size of this image (49960 bytes) exceeds the maximum allowed for this version of the linker) such long codes or such big codes. Can you give me any advice or hint? I need to show pictures as one function and show videos as a second one.
Best regards

what function i need use for print in st7789 adc value?

hi,it is necessary to display the ADC value or any int16_t digit value by what function it can be done,i dont find it in library if i use

int16_t adc ;
//for example adc=120;
ST7789_WriteString(0,160,adc,Font_16x26,WHITE,BLACK);
or
ST7789_WriteChar(0,160,adc,Font_16x26,WHITE,BLACK);
its dont work,show only not correct characters

help me please,thanks.

ST7789 引脚问题

你好,最近入手了一个 ST7789 硬件怎么没有你的那么多引脚?想问一下你的具体硬件引脚连接是什么??

Licensing

Thanks for the useful code.
I would like to use this code, however could not find any license statement.
Would it be possible to add it?

No CS pin issue

Hi i have ST7789 which has no CS pin. This library does not work for me. Is there anybody who faced with that issue and solved?

Start of coordinates in ST7789_ROTATION == 3 issue

Hello, @Floyd-Fish,

I've bought the 240x320 display based on ST7789 driver faced the problem that in the ST7789_ROTATION == 3 mode the start of the coordinates is in the top left part of the display.

To test the true coordinates, I've used this part of code to get the visual identification where the begin and end of coordinates are located:

ST7789_DrawCircle(0, 0, 5, RED);
ST7789_DrawCircle(0, 239, 5, CYAN);
ST7789_DrawCircle(319, 0, 5, MAGENTA);

Here is the photo with some mark-up from my side:
photo_5361783129209165760_y

Could you please explain/provide solution how to set 0,0 to the left bottom side of display?

Additional Fonts

I'm using a modified version of this library and I'm just wondering where you get the fonts in this format? I'm hoping to find one a bit larger but when I tried to implement modified fonts from other libraries all I seem to get is nonsense on screen.

Fill color issue.

memset will not set uint16_t type. it will only set first byte.

use this instead:

uint16_t* memset16(uint16_t *m, uint16_t val, size_t count) {
uint16_t *buf = m;

while (count--)
	*buf++ = val;
return m;

}

Frequency Problem

Hi,

I have tested your code but it only works with SPI 2MHz. Is there any place you can help?

Please check CPAH CPOL level --请检查CPAH和CPOL极性

经过我的测试,一些屏幕支持README中配置的CPAH和CPOL极性(1Edge,High)
其中分两种情况:
有一部分屏幕支持CPAH和CPOL极性(1Edge,High)与(2Edge,High),
有一部仅支持(2Edge,High)。
目前测试了四五款ST7789 240*240屏幕,其差异性与制造商有关,暂不知道具体原因。
Uploading 0d64ac63640b9cf2bde74a5dcd0e23a.jpg…
image

另外 在STM32F103系列中,SPI1和SPI2在HAL库的使用也表现出差异性
在测试时使用(1Edge,High)配置SPI1和SPI2,在部分屏幕测试上仅SPI2可以点亮屏幕,怀疑HAL库在配置时,对CPAH和CPOL处理稍有问题。尽管在逻辑分析仪上看起来两个SPI外设生成的波形近乎一模一样,但是在部分屏幕测试上仅SPI2可以点亮屏幕。
我使用的版本为CubeMX6.8.0
image
SPI1
image
SPI2

因此若无法点亮,推荐尝试
image
希望有人能解答一下我的疑惑

Draw Image

Sorry Sir. Can you help me with the Draw Image function formart. Seem like i can get display to show right color with format R5G6B5. Can you help me?

Not working for STM32H7

I've been trying to get a ST7789 display running using the STM32H7 and this driver but it seems like it doesn't work for the H7.

Fix function ST7789_Fill_Color not fill correct color

Hello,
function ST7789_Fill_Color is not correct because memset is not working with uint16_t data, and the uint16_t buffer should be swap 2 byte high and low . So, we have to modify this function to working correct:
`void MemsetBuffer(uint16_t buf, uint16_t data, uint32_t size)
{
while(size--)
{
buf++ = data;
}
}
/

  • @brief Fill the DisplayWindow with single color
  • @param color -> color to Fill with
  • @return none
    */
    void ST7789_Fill_Color(uint16_t color)
    {
    uint16_t i;
    uint16_t convert_color;
    ST7789_SetAddressWindow(0, 0, ST7789_WIDTH - 1, ST7789_HEIGHT - 1);
    ST7789_Select();
    convert_color = ((color & 0xFF) << 8) | ((color & 0xFF00) >> 8);
    #ifdef LCD_USE_DMA
    for (i = 0; i < ST7789_HEIGHT / HOR_LEN; i++)
    {
    MemsetBuffer(disp_buf, convert_color, ST7789_WIDTH * HOR_LEN);
    ST7789_WriteData((uint8_t *)disp_buf, sizeof(disp_buf));
    }
    #else
    uint16_t j;
    for (i = 0; i < ST7789_WIDTH; i++)
    for (j = 0; j < ST7789_HEIGHT; j++) {
    uint8_t data[] = {color >> 8, color & 0xFF};
    ST7789_WriteData(data, sizeof(data));
    }
    #endif
    ST7789_UnSelect();
    }`

My fork: github.com/deividAlfa/ST7789-STM32 Uses UGUI, custom fonts, pictures, windows, huge performance gains!

Given this repository seems dead, I forked and further enhanced it.

  • HUGE performance gains. Up to 13x faster in some drawing tasks.
  • Able to use DMA (Can be disabled) for even faster speeds.
  • Interfaced uGUI library, several modifcations for best performance.
  • You can easily add bitmaps and custom fonts...
  • Demos for STM32F103, STM32F411 and STM32F407.

https://github.com/deividAlfa/ST7789-STM32

How to make fonts

could you tell me how you made fonts
which software used to make these fonts?

Arduino IDE ZIP installation error

I tried to install this from the zip file into the Arduino IDE and got the error message:

"Specified folder/zip file does not contain a valid library"

Is this not meant to work with the Arduino IDE?

FILL colour function

Hello,
In the fill colour function you are using memset to set the colour but memset will set the memory to only the first byte, if for example you try green, in 565 it's 0x07E0, it will set each memory element in the array with E0, use this instead:

static void memset_pattern2(void *b, const void *pattern2, size_t len)
{
char * start = (char *)b;
char * p = (char *)b;
while ((start + len) - p >= 2) {
memmove(p, pattern2, 2);
p += 2;
}
if ((start + len) - p != 0) {
memmove(p, pattern2, (start + len) - p);
}
}

and in the fill colour function :
memset_pattern2(disp_buf, &color, sizeof(disp_buf));

kind regards
Vlad

about font generated question

Hello,
I can run normally with your driver, but now I need to change the ASCII font size, Chinese character set and modify the picture. I would like to ask what software you use for module extraction and generation, could you tell me the specific software and procedures of module extraction? Thank you very much!

st7789 for 2.8 inch lcd

Hi and thank you for sharing the library.
Can I use this library for 2.8 inch lcd?
if yes, what changes I have make in the code?
If no, why?
Is there any difference between st7789 and st7789v and st7789h2?

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.