Is Luos for me? 🤔

Luos Hardware Abstraction Layer

Luos library, Robus communication protocol, and physical bus

Luos can work on a single node or it can create a network for communication between containers located on different nodes. This communication should be defined and hardware-configured to fit with the chosen MCU. The files luos_hal.c and luos_hal.h define all the functions needed by the Luos library to send messages through the bus and create the initialization of all MCU peripherials. The file luos_hal_config.h file contains a default config for an MCU family and can be redefined in a config file to fit with your design.

Luos HAL

Lists of all the functions using hardware components relative to protocol communication and physical bus:

  • PORT: Defines necessary pins, PTP lines, Rx/Tx, enable/disable
  • TIMER: Defines timeouts for communications
  • COM: Serial bus
  • CRC: Validates messages. CRC can be generated by hardware or software
  • DMA: Used by default with COM but can be disabled
  • FLASH: Storing of containers' aliases in the system

Luos HAL configuration

luos_hal_config.h defines a default configuration pinout, serial bus for a MCU Family.

Luos covers many Hardware Abstraction Layers for MCU Families, so you can choose the right one for your MCU. To match pinout and fonctionality with your design, you can create or use the file node_config.h (see Luos example) Base on the default configuration define in luos_hal_config.h, you can define in the file node_config.h, in the section "LUOS HAL LIBRARY DEFINITION", pinout usart timer etc.

This way you are able to change default hardware configuration so it need to be call in the preprossessor variable section of your IDE to be taken into consideration for your project

FYI: Every example provide by luos has a node_config.h files and includes by the file platformio.ini

For example, using USART3 in your design instead of USART1 defined by luos_hal_config.h is defined as followed:

#define COM_TX_PIN                  10
#define COM_TX_PORT                 GPIOA
#define COM_TX_AF                   GPIO_AF1_USART3

#define COM_RX_PIN                  11
#define COM_RX_PORT                 GPIOA
#define COM_RX_AF                   GPIO_AF1_USART3

#define LUOS_COM                    USART3
#define LUOS_COM_IRQ                USART3_IRQn
#define LUOS_COM_IRQHANDLER()       USART3_IRQHandler()

There are many possible configurations that you can change, not all of them being necessary for your design:


PORT_CLOCK_ENABLEActivates clock for GPIODepends on port
RX_EN_PIN/TX_EN_PINChooses pinout to activate Rx/Tx commsNecessary for special comms
COM_TX_PIN/COM_RX_PINChooses pinout for Rx/Tx commsAdapts to the chosen serial bus
PTPX_PIN/PTPX_IRQ/PINOUT_IRQHANDLERChooses pinout, IRQ and callback for the PTP lineNecessary for topology detection


LUOS_COM_CLOCK_ENABLEActivates clock for serialDepends on serial bus
LUOS_COM/LUOS_COM_IRQ/LUOS_COM_IRQHANDLERChooses serial bus, IRQ and callbackAdapts to the serial bus chosen
LUOS_DMA_CLOCK_ENABLEActivates clock for DMANecessary for for Tx
LUOS_DMA_CHANNELChooses ChannelSend Tx


LUOS_TIMER_CLOCK_ENABLEActivates clock for TimeoutNecessary for Timeout
LUOS_TIMER/LUOS_TIMER_IRQ/LUOS_TIMER_IRQHANDLERChooses Timer, IRQ and callbackNecessary for Timeout


PAGE_SIZE/ADRESS_LAST_PAGEDefines space in flash for aliasNecessary to rename container alias