• Kaori-HSM, an event-driven Hierarchical State Machine (HSM) library in Rust (Released in January 2024)
Hierarchical state machines (HSMs) are an extension of traditional state machines where states can be nested within one another. This nesting allows for a hierarchical organization of states, enabling more complex and modular state-based behavior modeling. In HSMs, nested states inherit event handling from their parent states, reducing redundancy and improving code organization.
This crate provides an interface that allows developers to create their own HSMs as Rust code. Once created, custom events can be successively injected into the state machine. Thoses events will eventually lead the state machine to execute specific user-defined action and transition to another state. As this crate is primarily destined to be run on microcontrollers, I have put special effort in limiting both program size and its stack usage. There is also no use of dynamic memory. The library is thoroughly tested, and I even made a specific test to compare its performance to the C++ QEP library, running on a STM32f103 microcontroller.
I hope in a close future to be able to add more crates working in synergy with Kaori-HSM, I'm thinking for example of a tool generating statechart diagrams from Kaori-HSM state machine code, a crate for performing unit test on Kaori-HSM and maybe also of a crate for checking the state machine written by the developer respects UML 2.5 standard.
• Cortex-M-Microclock, a Rust crate for measuring time Cortex-M processors (released in November 2023)
This crate lays on the 32 bits CYCCNT counter present in most Cortex-M processor, which increments with each system clock tick. It gives to the user the ability to produce blocking delays and also to retrieve timestamps which can be compared with each other to measure time.
• Ruthless Flow, a small game in Rust (released February 2023)
I developed this small game to improve my skill in Rust. It consists of a snake that you have to guide through the exit of a perpetually scrolling maze. The difficulty of the game lies in the demultiplication of the snake heads when you pass over specific cells. When this occurs, you should merge the heads back together as fast as possible to avoid explosion of heads numbers. You lose if any head gets caught by the bottom of the scrolling map.