Add documentation

This commit is contained in:
xoreo
2023-11-14 14:37:25 +01:00
parent e88620dd3c
commit 425074336b

View File

@@ -73,9 +73,9 @@ void main(void) {
```
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.
#### Drawing a BMP (C-array) onto the screen
#### Drawing a 'raw' image onto the screen
```c
void lcd_draw_bmp(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_t x_size, uint32_t y_size, uint32_t color_mode);
void lcd_draw_raw_img(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_t x_size, uint32_t y_size, uint32_t color_mode);
```
```c
@@ -86,7 +86,66 @@ void main(void) {
...
lcd_init(true);
...
lcd_draw_bmp(bmp_array, 0, 0, 50, 50, LCD_ARGB8888);
lcd_draw_raw_img(raw_img_array, 0, 0, 50, 50, LCD_ARGB8888);
}
```
Draw BMP image from C array to the LCD screen at position X, Y. In color mode ARGB8888, RGB888, RGB565 or ARGB1555 Supports ARGB8888, RGB565, RGB888 (see LCD_* defines in header file).
Draw raw image from a C array to the LCD screen at position X, Y. In color mode ARGB8888, RGB888, RGB565 or ARGB1555 Supports ARGB8888, RGB565, RGB888 (see LCD_* defines in header file).
#### Drawing a BMP image onto the screen
```c
void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos);
```
```c
#include "lcd_api.h"
#include "test_image.h"
void main(void) {
...
lcd_init(true);
...
lcd_draw_bmp_img(bmp_array, 0, 0);
lcd_draw_bmp_img(file->data, 50, 50);
}
```
Drawing a BMP image (either from filesystem or a C-array) to the LCD screen at position X, Y. The image size and color scheme do not have to be passed as arguments like in the `lcd_draw_raw_img(...)` function, these values are present in the BMP header.
#### Drawing a BMP from the filesystem to the LCD
```c
void lcd_draw_img_from_fs_with_name(const char* name, uint32_t x_pos, uint32_t y_pos);
```
```c
#include "lcd_api.h"
#include "test_image.h"
void main(void) {
...
lcd_init(true);
...
lcd_draw_img_from_fs_with_name("st.bmp", 0, 0);
}
```
This function expects the name of the BMP image as argument, together with the X and Y coordinates.
Note that this function only works for BMP images and not raw images.
#### Clearing the LCD screen
```c
void lcd_clear(uint32_t color);
```
```c
#include "lcd_api.h"
#include "test_image.h"
void main(void) {
...
lcd_init(true);
...
lcd_clear(LCD_BLACK);
}
```
Clears the LCD screen to the specified color.