cashmere

cashmere

RTIC

Description

RTIC (Real-Time Interrupt-driven Concurrency) is a crate to write simple and efficient Firmware for embedded Systems.

Features

Tasks

Advantages through Rust

Demo Explanation

App Macro

#![no_main]
#![no_std]

use panic_halt as _;

#[rtic::app(device = stm32l4xx_hal::stm32, peripherals = true)]
mod app {
    use stm32l4xx_hal as _;

    #[shared]
    struct Shared {

    }

    #[local]
    struct Local {

    }

    #[init]
    fn init(ctx: init::Context) -> (Shared, Local, init::Monotonics) {

        (
            Shared {
            },
            Local {

            },
            init::Monotonics(),
        )
    }

    #[idle]
    fn idle(_ctx: idle::Context) -> ! {
        loop {

        }
    }
}

Shared

There we define shared resources or in other terms resources which should be accessible by every fn

Local

resources which should be only be accessible by local functions such as an counter

Resources

RTIC: Real Time Interrupt driven Concurrency - YouTube GitHub - korken89/oxidize2020-rtic rtic-examples/rticv1/rp-picolocalinitilzdresources/src/main.rs at master … Example code for RPI Pico RTIC: Real time concurrency on ARM Cortex-M | Rust Wrocław #26, 23.06.2022 - … How to communicate over USB to rpico