acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

README.md (3921B)

      1 # How to Create CMSIS-Pack
      2 
      3 
      4 
      5 ## STEP 1 Update 'lv_conf_cmsis.h'
      6 
      7 1. Copy the **lv_conf_template.h** to '**cmsis-pack**' directory
      8 
      9 2. Set the macro protector to '1' 
     10 
     11 ```c
     12 ...
     13 /* clang-format off */
     14 #if 1 /*Set it to "1" to enable content*/
     15 ...
     16 ```
     17 
     18 remove the misleading guide above this code segment.
     19 
     20 ```c
     21 /*
     22  * Copy this file as `lv_conf.h`
     23  * 1. simply next to the `lvgl` folder
     24  * 2. or any other places and
     25  *    - define `LV_CONF_INCLUDE_SIMPLE`
     26  *    - add the path as include path
     27  */
     28 ```
     29 
     30 
     31 3. Add including for '**RTE_Components.h**'
     32 
     33 ```c
     34 #ifndef LV_CONF_H
     35 #define LV_CONF_H
     36 
     37 #include <stdint.h>
     38 #include "RTE_Components.h"
     39 ...
     40 ```
     41 
     42 4. Remove macro definitions for
     43    - LV_USE_GPU_STM32_DMA2D
     44    - LV_USE_GPU_NXP_PXP
     45    - LV_USE_GPU_NXP_VG_LITE
     46 5. Update macro LV_ATTRIBUTE_MEM_ALIGN to force a WORD alignment.
     47 ```c
     48 #define LV_ATTRIBUTE_MEM_ALIGN      __attribute__((aligned(4)))
     49 ```
     50 6. Update Theme related macros:
     51 
     52 ```c
     53 #ifdef RTE_GRAPHICS_LVGL_USE_EXTRA_THEMES
     54     /*A simple, impressive and very complete theme*/
     55     #define LV_USE_THEME_DEFAULT 1
     56     #if LV_USE_THEME_DEFAULT
     57 
     58         /*0: Light mode; 1: Dark mode*/
     59         #define LV_THEME_DEFAULT_DARK 0
     60 
     61         /*1: Enable grow on press*/
     62         #define LV_THEME_DEFAULT_GROW 1
     63 
     64         /*Default transition time in [ms]*/
     65         #define LV_THEME_DEFAULT_TRANSITION_TIME 80
     66     #endif /*LV_USE_THEME_DEFAULT*/
     67 
     68     /*A very simple theme that is a good starting point for a custom theme*/
     69     #define LV_USE_THEME_BASIC 1
     70 
     71     /*A theme designed for monochrome displays*/
     72     #define LV_USE_THEME_MONO 1
     73 #else
     74     #define LV_USE_THEME_DEFAULT    0
     75     #define LV_USE_THEME_BASIC      0
     76     #define LV_USE_THEME_MONO       0
     77 #endif
     78 ```
     79 7. Update `LV_TICK_CUSTOM` related macros:
     80 ```c
     81 /*Use a custom tick source that tells the elapsed time in milliseconds.
     82  *It removes the need to manually update the tick with `lv_tick_inc()`)*/
     83 #ifdef __PERF_COUNTER__
     84     #define LV_TICK_CUSTOM 1
     85     #if LV_TICK_CUSTOM
     86         extern uint32_t SystemCoreClock;
     87         #define LV_TICK_CUSTOM_INCLUDE             "perf_counter.h"
     88 
     89         #if __PER_COUNTER_VER__ < 10902ul
     90             #define LV_TICK_CUSTOM_SYS_TIME_EXPR    ((uint32_t)get_system_ticks() / (SystemCoreClock / 1000ul))
     91         #else
     92             #define LV_TICK_CUSTOM_SYS_TIME_EXPR    get_system_ms()
     93         #endif
     94     #endif   /*LV_TICK_CUSTOM*/
     95 #else
     96     #define LV_TICK_CUSTOM 0
     97     #if LV_TICK_CUSTOM
     98         #define LV_TICK_CUSTOM_INCLUDE "Arduino.h"         /*Header for the system time function*/
     99         #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())    /*Expression evaluating to current system time in ms*/
    100     #endif   /*LV_TICK_CUSTOM*/
    101 #endif       /*__PERF_COUNTER__*/
    102 ```
    103 9. Thoroughly remove the `DEMO USAGE` section.
    104 10. Thoroughly remove the '3rd party libraries' section.
    105 10. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'.
    106 
    107 
    108 
    109 ## STEP 2 Check, Update and Run the 'gen_pack.sh'
    110 
    111 ```sh
    112 if [ `uname -s` = "Linux" ]
    113   then
    114   CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/"
    115   PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/"
    116 else
    117   CMSIS_PACK_PATH="/C/Users/gabriel/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0"
    118   PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/"
    119 fi
    120 [[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}"
    121 echo $PATH_TO_ADD appended to PATH
    122 echo " "
    123 ```
    124 
    125 
    126 
    127 ### A. For Windows users
    128 
    129 Update the '**CMSIS_PACK_PATH**' accordingly (Usually just replace the name gabriel with your own windows account name is sufficient.).
    130 
    131 Update the '**PATH_TO_ADD**' to point to the installation folders of **7Zip** and **xmllint**.
    132 
    133 Launch the git-bash and go to the cmsis-pack folder.
    134 
    135 enter the following command:
    136 
    137 ```sh
    138 ./gen_pack.sh
    139 ```
    140 
    141 
    142 
    143 ### B. For Linux Users
    144 
    145 Update '**PATH_TO_ADD**' if necessary.
    146 
    147 go to the **cmsis-pack** folder.
    148 
    149 enter the following command:
    150 
    151 ```sh
    152 ./gen_pack.sh
    153 ```
    154