Introο
This library is developed for the ECS Oberon-2 Compiler as a framework to work with MCUs.
The ECS Oberon compiler is implemented according to the original Oberon-2 report with modernizing extensions. The language is particular suited to embedded development due to itβs simplicity.
Currently the STM32F4, STM32L4 and STM32C5 MCUs are supported and the following boards are tested:
NUCLEO-L432KC STM32L432KC MCU
STM32F407G-DISC1 STM32F407VG MCU
STM32F429I-DISC1 STM32F429ZI MCU
STM32C5-EVAL STM32C551CET MCU
This documentation only cover the MCU independent generic part of the framework.
These modules needs to be replaced with the concrete implementation for the selected MCU target in the startup of the firmware. Example of this is found in the BoardConfig.mod in the boards folder.
The MCU dependent modules extend from the generic Interfaces/buses and the code can largely be written in a MCU independent way, as is shown in the device drivers code and demos.
Exampleο
(** Simple led blinker demo using the SysTick millisecond timer *)
MODULE Test;
IMPORT BoardConfig;
IMPORT Machine IN Micro;
CONST
Debug = TRUE; (* Set Debug = FALSE to allow to run demo without debugger *)
Pins = BoardConfig.Pins;
VAR pin : Pins.Pin;
BEGIN
IF Debug THEN TRACE("START") END;
BoardConfig.Init;
pin.Init(BoardConfig.USER_LED1_PORT, BoardConfig.USER_LED1_PIN, Pins.output,
Pins.pushPull, Pins.medium, Pins.noPull, Pins.AF0);
REPEAT
pin.On;
IF Debug THEN TRACE("ON0") END;
Machine.DelayMS(100);
pin.Off;
IF Debug THEN TRACE("OFF0") END;
Machine.DelayMS(100);
UNTIL FALSE
END Test.