PlatformIO
What is PlatformIO?
PlatformIO is a user-friendly and extensible integrated development environment with a set of professional development instruments, compilers and debuggers. PlatformIO provides modern and powerful features to simplify the creation and delivery of embedded products. That is the reason why Luos uses PlatformIO's project structure for its examples, allowing users to use and share easily services and developments on a unified environment. Also, Luos engine and some tools like the gate or the Pipe are available in the PlatformIO's registry. This registry allows users to link directly a project and a library, like Luos engine, by including dependencies in the configuration project file called platformio.ini. Learn more about PlatformIO and how to install it in VS Code .
PlatformIO's project structure
Every PlatformIO's project has a basic folder project structure and must have the file platformio.ini at the root of the project.
Checkout the Luos tutorial on how to create a Luos project with PlatformIO .
Luos configuration for platformio.ini
With PlatformIO, Luos libraries use scripts before compilation to select and include the code folder depending to your needs.
Configuration parameters need to be the same as the folder name you want to use.
Some build_flags
definition may be added to your platformio.ini file to configure these scripts.
Build flags examples:
build_flags =
-include node_config.h
-D GATEFORMAT=TinyJSON
-D LUOSHAL=STM32F0
-D PIPEMODE=SERIAL
-D PIPEHAL=NUCLEO-F0
lib_deps =
luos_engine
Gate
Pipe
Every Luos project needs to have a node_config.h file allowing to configure the hardware dependencies and the libraries. See the basics concept page for more information.
A good configuration looks like this:
During the build, a message appearing in red means a problem has occurred.
Configuration for Luos engine Library
Definition | Description | Value | flag example |
---|---|---|---|
LUOSHAL | Defines the HAL family to use depending on your MCU. | Luos engine HAL | -D LUOSHAL=ATSAMD21_ARDUINO |
Configuration for the gate
Definition | Description | Value | flag example |
---|---|---|---|
GATEFORMAT | Chooses the format of data sent by the gate through a pipe. | Available folder names . | -D GATEFORMAT=TinyJSON |
For more information about the gate configuration, check the file select_format_script.py.
Configuration for the pipe
Definition | Description | Value | flag example |
---|---|---|---|
PIPEMODE | Chooses the pipe style to send or receive information through a specific physical layer. | Available folder names | -D PIPEMODE=SERIAL |
PIPEHAL | Chooses the pipe HAL matched to a specific physical layer with the board. | Available folder names on the selected PIPEMODE | -D PIPEHAL=ARDUINO |
For more information about the pipe configuration, check the file select_hal_script.py.