Merge branch 'main' into TFTP

This commit is contained in:
2023-11-20 16:03:33 +01:00
3 changed files with 106 additions and 32 deletions

View File

@@ -104,7 +104,7 @@ void main(void) {
#### Drawing text on the screen
```c
void lcd_display_text(const char* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, uint32_t bg_color, sFONT *font);
void lcd_display_text(const char* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, sFONT *font);
```
```c
@@ -116,7 +116,7 @@ void main(void) {
...
lcd_init(true);
...
lcd_display_text("This is a text string.", 10, 10, LCD_GREEN, LCD_BLACK, LCD_FONT16);
lcd_display_text("This is a text string.", 10, 10, LCD_GREEN, LCD_FONT16);
}
```
Display text on the LCD screen in a certain color. When text width exceeds BSP_LCD_GetXSize(), a text wrap will be performed. If the text wrap is between two will be injected.
@@ -194,13 +194,13 @@ void main(void) {
...
lcd_init(true);
...
// From a C-array
lcd_gif_t* gif = lcd_draw_gif(gif_array, gif_size, 0, 0);
// From the filesystem
lcd_gif_t* gif = lcd_draw_gif_from_fs("st.gif", 0, 0);
if (gif == NULL) {
LOG_WARNING("GIF could not be drawn");
}
@@ -229,15 +229,22 @@ Call this function before drawing over the GIF.
This function should not be called on a GIF that has already been stopped (GIFs with a loop count will stop automatically).
It is possible that the handler has been assigned to a new GIF, so it would stop the new GIF instead.
#### Stopping all GIF animations
```c
void lcd_stop_all_gifs(void);
```
This function stops all the GIF animations and frees the memory allocated for the GIF.
Call this function before drawing over the GIF.
#### Checking if a GIF is still running
```c
bool lcd_gif_is_playing(lcd_gif_t* gif);
```
NOTE: It is possible that the GIF has stopped playing, but another GIF has taken its slot and is still playing.
#### Clearing the LCD screen
#### Clearing the text on the LCD screen
```c
void lcd_clear(uint32_t color);
void lcd_clear_text(void);
```
```c
@@ -246,9 +253,29 @@ void lcd_clear(uint32_t color);
void main(void) {
...
lcd_init(true);
lcd_display_text("Hello world!", 0, 0, LCD_GREEN, LCD_FONT20);
...
lcd_clear(LCD_BLACK);
lcd_clear_text();
}
```
Clears the LCD screen to the specified color.
Clears all text strings on the LCD screen.
#### Clearing the images on the LCD screen
```c
void lcd_clear_images(void);
```
```c
#include "lcd_api.h"
void main(void) {
...
lcd_init(true);
lcd_draw_img_from_fs("st.bmp", 300, 100);
...
lcd_clear_images();
}
```
Clears all text strings on the LCD screen.