This is a simple python generator script for SquareLine board packages. This script copies all files from common
folder to the destination ZIP file. It also generates other files according to the manifest.json
file from each board directory in boards
folder. For information on the structure of SquareLine board packages, please refer to (add link here).
manifest.json
- Description of the boardimage.png
- Image of the board 380px x 300pxsdkconfig.defaults
- defaultsmain/idf_component.yml
- Component Registry description
components
- Folder with components (will be copied without using placeholders)
Mandatory JSON keys in manifest:
name
- Board name (string)version
- Package version (string)mcu
- ESP mcu (string)screen_width
- Screen width (string)screen_height
- Screen height (string)screen_color_swap
- Is color bytes swapped (boolean)short_description
- Short board description (string)long_description
- Long board description (string)placeholders
- List of placeholders and values of them (JSON object)
When copying all the files (except for image.png
), the script will replace placeholders found in these files. Placeholder must be in compound brackets (e.g. {PLACEHOLDER}
). The placeholders and their values should be defined in manifest.json
as follows:
"placeholders":
{
"PLACEHOLDER_1": "value 1",
"PLACEHOLDER_2": "value 2"
}
NOTE 1: Placeholders are optional. But when some placeholder is found in code and not found in JSON, it will not be substituted.
NOTE 2: All default values (SLB file, default folders, etc...) are saved in gen.py
.
Generate all available boards to out_dir
folder
python gen.py -o out_dir
Generate only one selected board board_dir
to out_dir
folder
python gen.py -o out_dir -b board_dir
NOTE: The output folder is cleaned before generating.
The generator supports custom boards. The example of the custom board is here. There is custom BSP for the custom board as a component. For use this custom board in SquareLine, follow these steps:
- Generate custom board.
python gen.py -o out_dir -b custom_waveshare_7inch
- Copy folder from
out_dir/espressif/custom_waveshare_7inch
to"SquareLine Studio installation path"/boards/espressif/