Real-time artificial horizon

For a school project I implemented a crude artificial horizon on a STM32F746-DISCO board. This was the occasion to learn embedded-rust. The code of the Hardware Abstraction Layer (HAL) I contributed to can be found here. The code of my crude artificial horizon can be found here.

Digital artificial horizon
A digital artificial horizon

First, because I needed I2C to communicate with an Inertial Measurement Unit (IMU), I had to implement the protocol for the specific STM32F7 microcontroller family. I took some inspiration from existing I2C implementation for the F4 family and ported it to my microcontroller family. This resulted in a contribution to stm32f7-hal.

Then, because I needed to use the display of the STM32F746-DISCO board, I implemented a driver for the LTDC (LCD-TFT Display Controller Interface) peripheral of the STM32F7xx microcontrollers. This was more difficult since no implementation existed in existing HALs. Diving in the details of the LTDC, I also worked on DMA transfers. This also resulted in contributions to stm32f7-hal: 1 and 2.

This project was a great opportunity to discover the embedded-rust ecosystem and community. Being part of the course C programming for embebedded systems, I also made a small introduction of rust-lang to my teachers who wanted to know more about "the replacement of C".