Skip to content

Commit

Permalink
feat: code abstraction improved
Browse files Browse the repository at this point in the history
  • Loading branch information
giuuuug committed Dec 20, 2024
1 parent 57f8730 commit 5ee0448
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 171 deletions.
4 changes: 2 additions & 2 deletions Core/Inc/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ void MCB_send_msg(uint32_t id);
#include "spi.h"
#include "usart.h"
/* ---------- Exported types -------------------------------------------------*/

/* ---------- Exported constants ---------------------------------------------*/
#define LCD_TFT_SPI_Handle hspi3
#define LCD_TFT_USART_Handle huart1
/* ---------- Exported constants ---------------------------------------------*/

/* ---------- Exported variables ---------------------------------------------*/

/* ---------- Exported macros ------------------------------------------------*/
Expand Down
22 changes: 22 additions & 0 deletions Core/Src/bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,3 +477,25 @@ void MCB_send_msg(uint32_t id) {
}

/*---------- Private Functions -----------------------------------------------*/

/* LCD TFT SCREEN ILI9488 ####################################################*/

/*---------- Private define -----------------.--------------------------------*/

/*---------- Private macro ------------------.--------------------------------*/

/*---------- Private variables --------------.--------------------------------*/
enum LCD_TFT_Device{CS, RST, DC, LCD_TFT_Device_NUM};
static const struct GPIO_Tuple LCD_TFT_Device_to_GPIO_Tuple_map[LCD_TFT_Device_NUM] = {
[CS] = {.GPIO_Port = LCD_TFT_CS_GPIO_OUT_GPIO_Port, .GPIO_Pin = LCD_TFT_CS_GPIO_OUT_Pin},
[DC] = {.GPIO_Port = LCD_TFT_DC_GPIO_OUT_GPIO_Port, .GPIO_Pin = LCD_TFT_DC_GPIO_OUT_Pin},
[RST] = {.GPIO_Port = LCD_TFT_RST_GPIO_OUT_GPIO_Port, .GPIO_Pin = LCD_TFT_RST_GPIO_OUT_Pin},
};

/*---------- Private function prototypes ----.--------------------------------*/

/*---------- Exported Variables -------------.--------------------------------*/

/*---------- Exported Functions ----------------------------------------------*/

/*---------- Private Functions -----------------------------------------------*/
2 changes: 1 addition & 1 deletion Drivers/ILI9488
97 changes: 54 additions & 43 deletions EEZ/ILI9488.eez-project
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
],
"destinationFolder": "src\\ui",
"separateFolderForImagesAndFonts": false,
"lvglInclude": "lvgl/lvgl.h",
"lvglInclude": "lvgl.h",
"generateSourceCodeForEezFramework": false,
"compressFlowDefinition": false,
"executionQueueSize": 1000,
Expand Down Expand Up @@ -348,12 +348,13 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "c2622862-f01c-4455-94c4-23657802a9f8",
"definition": {
"MAIN": {
"DEFAULT": {
"text_color": "#d01d1d",
"text_color": "#1d3dd0",
"text_font": "MONTSERRAT_32",
"text_align": "CENTER"
}
Expand Down Expand Up @@ -514,14 +515,14 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "f48893e6-9a03-4fe4-f4fa-6278b4c9c73b",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -566,18 +567,9 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "0c9fd775-abcc-41f3-ae42-39f1d7f24ba5",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER",
"text_color": "#d01d1d"
}
}
}
"objID": "0c9fd775-abcc-41f3-ae42-39f1d7f24ba5"
},
"group": "",
"groupIndex": 0,
Expand Down Expand Up @@ -826,14 +818,14 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "000ddc4b-2d88-4d55-d8b2-3fdabf9e0de0",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -878,15 +870,15 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "8d1127aa-29f0-4e98-9cec-8a408c6dcd18",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -1138,14 +1130,14 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "2c485e9c-d5e2-4239-c55a-8755afe778ca",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -1190,15 +1182,15 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "da1e5849-ba27-4927-ba45-7beda58d7d12",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -1450,14 +1442,14 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "4f673662-c5fa-41cf-b16a-7b0cda3280ca",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -1502,15 +1494,15 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "0e4722d4-eef0-4e0b-8b6c-b2c0b9a63ece",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -1896,14 +1888,14 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "d83936fd-baa0-4fb1-cd70-6f19e86cb7e5",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -1948,15 +1940,15 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "7ea925ad-58c9-4933-da57-568af6ff21b3",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -2155,14 +2147,14 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "14e4c5aa-673f-41bf-bbcb-6bdc3b6d4dc1",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -2207,15 +2199,15 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "8393a05f-5975-4a4f-deff-7bc305194e52",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -2414,14 +2406,14 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "849b5f16-e0c5-47ea-8022-c6239eee73ec",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -2466,15 +2458,15 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "40509ed0-31ad-4852-ee64-4ce715eafc79",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -2673,14 +2665,14 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "fd063e4e-9587-4029-96a9-90cbf4b825ab",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -2725,15 +2717,15 @@
"checkedStateType": "literal",
"disabledStateType": "literal",
"states": "",
"useStyle": "label_red",
"localStyles": {
"objID": "eaa0a703-4e4c-488f-a91a-d3a76722fa8c",
"definition": {
"MAIN": {
"DEFAULT": {
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER",
"text_color": "#d01d1d"
"text_align": "CENTER"
}
}
}
Expand Down Expand Up @@ -4955,6 +4947,25 @@
}
}
}
},
{
"objID": "6fc7cf12-33a5-4d0d-de72-76f5103383a9",
"name": "label_red",
"forWidgetType": "LVGLLabelWidget",
"childStyles": [],
"definition": {
"objID": "26cb5696-f5a7-48ac-de32-ba7404681a5d",
"definition": {
"MAIN": {
"DEFAULT": {
"text_color": "#1d3dd0",
"text_font": "MONTSERRAT_32",
"pad_left": 2,
"text_align": "CENTER"
}
}
}
}
}
],
"defaultStyles": {
Expand Down
Loading

0 comments on commit 5ee0448

Please sign in to comment.