{"id":19476494,"url":"https://github.com/frankkkkk/rust-ramlink","last_synced_at":"2026-06-15T19:31:47.214Z","repository":{"id":224827503,"uuid":"764325249","full_name":"Frankkkkk/rust-ramlink","owner":"Frankkkkk","description":"RAM-based, producer-consumer, one-way communication, using a ring buffer","archived":false,"fork":false,"pushed_at":"2024-03-03T16:07:21.000Z","size":13,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-13T02:47:21.989Z","etag":null,"topics":["communication","embedded","ringbuffer","rust","updi"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Frankkkkk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-27T21:53:03.000Z","updated_at":"2024-02-27T21:53:48.000Z","dependencies_parsed_at":"2024-02-27T23:33:22.875Z","dependency_job_id":"38710b42-c0fd-4bae-8f08-a741b8befbe4","html_url":"https://github.com/Frankkkkk/rust-ramlink","commit_stats":null,"previous_names":["frankkkkk/rust-ramlink"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Frankkkkk/rust-ramlink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frankkkkk%2Frust-ramlink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frankkkkk%2Frust-ramlink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frankkkkk%2Frust-ramlink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frankkkkk%2Frust-ramlink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Frankkkkk","download_url":"https://codeload.github.com/Frankkkkk/rust-ramlink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frankkkkk%2Frust-ramlink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34377872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["communication","embedded","ringbuffer","rust","updi"],"created_at":"2024-11-10T19:40:30.752Z","updated_at":"2026-06-15T19:31:47.199Z","avatar_url":"https://github.com/Frankkkkk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust-ramlink\n\n\u003c!-- cargo-rdme start --\u003e\n\nRAM-based, producer-consumer, one-way communication using a ring buffer\n\nThis no-std crate provides a way to transmit information from a producer (for example\na microcontroller) to a consumer (a debbuging host) using a shared RAM memory.\nUsually, it is possible to read the RAM of microcontrollers using debugging\ninterfaces (JTAG, UPDI, ..).\n\nThis way, it's possible to transmit information through the debugging interface\nwithout relying on an additional UART.\n## Example\n### Producer (AVR, PIC, microcontroller, ...)\nAdd this crate to your project, don't forget to enable the `producer` feature\n`cargo add ramlink -F producer`\n\nThen create an ring buffer of size 5:\nIn order to access it safely, we wrap it around a Mutex and a RefCell:\n```rust\n  use avr_device::interrupt::{self, Mutex};\n  use core::cell::{Cell, RefCell};\n  use ramlink::producer::RB;\n\n  static RING_BUF: Mutex\u003cRefCell\u003cRB\u003c5\u003e\u003e\u003e = Mutex::new(RefCell::new(RB::\u003c5\u003e::new()));\n```\nyou can then send data to your consumer:\n```rust\n  interrupt::free(|cs| {\n    RING_BUF\n    .borrow(cs)\n    .borrow_mut()\n    .send_bytes_blocking(\u0026[temperature, current]);\n  });\n```\n### Consumer (laptop with JTAG/UPDI/… interface)\nAdd this crate to you project, don't forget to enable the `consumer` feature\n`cargo add ramlink -F consumer`\nImplement the trait for your specific device\n```rust\n struct mk2\u003c'a\u003e {\n     dev: JtagIceMkii\u003c'a\u003e,\n }\n\n impl\u003c'a\u003e ramlink::consumer::MemoryReader for mk2\u003c'a\u003e {\n     fn read_memory(\u0026mut self, address: usize, buffer: \u0026mut [u8]) -\u003e Result\u003c(), String\u003e {\n         for i in 0..buffer.len() {\n             let byte = self.dev.read_ram_byte((address + i) as u16).unwrap();\n             buffer[i] = byte;\n         }\n         Ok(())\n     }\n     fn write_memory(\u0026mut self, address: usize, value: u8) -\u003e Result\u003c(), String\u003e {\n         self.dev.write_ram_byte(address as u16, value);\n         Ok(())\n     }\n }\n```\nInitialize it. In this example, the producer device is an AVR Attiny402, and the RB struct\nis stored at address `0x3f0e`\n```rust\n   let mm = mk2 { dev: dgr };\n\n   let mut rb = ramlink::consumer::ProducerDevice::new(Box::new(mm), 0x3f0e).unwrap();\n```\nand start reading:\n```rust\n   while true {\n       let r = rb.read_bytes();\n       if r.len() \u003e 0 {\n           println!(\"I READ {:02x?}\", r);\n       }\n  }\n```\n\n\u003c!-- cargo-rdme end --\u003e\n\n# Contributing\n\nGiven that I'm a rust noob, don't hesitate to raise issues or propose merge requests to make this code better and make me improve :-). Suggestions welcome !\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankkkkk%2Frust-ramlink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrankkkkk%2Frust-ramlink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankkkkk%2Frust-ramlink/lists"}