Open source

Open source

Every public crate, from register to GUI: what it does, a code sample and where to read more.

All of them are Rust and open source. The first four are the core: the API, its wire format, units and the firmware template. canzone is work in progress. The last ones are the tools around the boards: a test bench scheduler and the GUI building blocks. draft

  1. ProductsDonguru · rePort · CAN line · IOWeaver · RockFace
  2. API
  3. Wire format
  4. Units
  5. Firmware

    embedded_bedrock

    not on crates.io yet

    Bare-metal firmware template with ruggedizing, debugging and logging built in. Optional embassy, RTIC and HAL support.

    use bedrock_led::code::{blink, Code};
    
    // A firmware that won't start says why on its status LED,
    // then waits in the ROM bootloader to be flashed.
    if !guard.runs_board() {
        blink(Code::UnknownRework, |on| led_pin_set(on), |ms| cortex_m::asm::delay(ms * BOOT_CLOCK_KHZ));
        reboot_into_rom_bootloader();
    }
  6. Firmware

    canzone work in progress

    renamed from mcan, not on crates.io yet

    Stand-alone Rust driver for the Bosch M_CAN controller, aimed at STM32 G0, G4, H5, H7 and L5. Goals: no panics, no blocking waits without a timeout, optional async.

    let mut can = unwrap!(can.into_config_mode());
    can.set_nominal_bit_timing(unwrap!(NominalBitTiming::new(1, 55, 8, 1)));
    unwrap!(can.set_layout(layout_fdcan1));
    can.set_automatic_bus_off_recovery(true);
    let mut can = unwrap!(can.into_normal());
    
    can.write_tx_buffer_pend(
        tx_buffers.idx1,
        TxFrameHeader::fd_brs(Id::Standard(unwrap!(StandardId::new(0x123)))),
        &[0xAA, 0xBB, 0xCC],
    );
  7. Test bench

    choreograph

    not on crates.io yet

    Plans and runs jobs over shared instruments and resources, with priorities and deadlines. Says why each waiting job waits.

    [[resource]]
    name = "supply"
    kind = "supply"
    states = ["off", "3V0", "3V3", "3V6"]
    safe = "off"
    
    [[job]]
    name = "a-3V3"
    needs = [{ kind = "probe", state = "fw-a" }, { kind = "supply", state = "3V3" }]
    run = "10s"
  8. GUI

    Fast table viewer and editor that only draws the visible rows. Data from vectors, files, databases or live bus traces.

    let mut table = VariantTable::new([ColumnDef::new("Name", VariantTy::Str)]);
    let mut view = TableView::new(TableViewOptions::default());
    let mut config = TableViewConfig::default();
    
    // Every frame:
    let output = view.show(ui, &mut table, &mut VariantCellUi, &mut config);
  9. GUI

    vhrd_egui

    not on crates.io yet

    egui building blocks: the widget frame every panel sits in, a dock that moves widgets between windows, an HDR phosphor scope.

    let hints = SizeHints::new([90.0, 30.0], [200.0, 80.0], [360.0, 80.0]).tall(200.0);
    WidgetFrame::new("log")
        .sizes(hints)
        .show_area(ui, &mut state, |ui, area| {
            let rows = match area.height {
                Height::Min => 1,
                Height::Nom => 5,
                Height::Tall => 15,
            };
        });