Skip to content

Instantly share code, notes, and snippets.

@9names
9names / Cargo.toml
Created April 4, 2023 13:31
basic PAC blinky for ch32v003
[package]
name = "hello-wch"
version = "0.1.0"
edition = "2021"
[dependencies]
panic-halt = "0.2.0"
riscv-rt = "0.11.0"
embedded-hal = "0.2.7"
@9names
9names / 2serial4u.rs
Last active June 20, 2023 11:25
implementing 2 cdc serial ports on rp2040
//! # Pico USB Two Serial port Example
//!
//! Creates two USB Serial devices on a Pico board, with the USB driver running in
//! the main thread.
//!
//! This will create two USB Serial device echoing anything they receives.
//! On the first port incoming ASCII characters are converted to uppercase.
//! On the second port incoming ASCII characters are converted to lowercase.
//!
//! See the `Cargo.toml` file for Copyright and license details.
@9names
9names / Cargo.toml
Created November 29, 2023 12:45
Testing probe-rs attach with LPC55S69
[package]
name = "attach_test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
probe-rs = { git = "https://github.com/9names/probe-rs", rev = "d9ab28d43c72790ac066b771e8391fa3bae043bc" }
@9names
9names / i2c.rs
Created January 2, 2024 22:40
rp2040-hal i2c0 on gpio24/gpio25
//! # I²C Example
//!
//! This application demonstrates how to talk to I²C devices with an RP2040.
//!
//! It may need to be adapted to your particular board layout and/or pin assignment.
//!
//! See the `Cargo.toml` file for Copyright and license details.
#![no_std]
#![no_main]
@9names
9names / Si917_Flashloader.yaml
Created December 31, 2024 03:40
probe-rs algo for Si917, SiWG917M111
instructions: pQAAAEECAACxAAAAxQAAAD0BAADRAAAAMQEAAPUAAADxAAAAAAAAAM0BAAAdAQAAAAAAAAgJAAB/AAAAdQAAAHcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeQAAAAAAAAAAAAAAewAAAH0AAAD+5/7n/uf+5/7nBkmNRgZJgfMJiAAghkbsRgAgACEDSpBHAAAICQAAEAkAAH0CAAABSxtocEfARvQHAAABIQNKACATaItDE2BwR8BGEOAA4AFLACAbaHBH9AcAAAZLQRgbaAN4ATCTQgPRiEL50QAgcEcBIPznwEb0BwAAcEcAAAMAQBgHSRC1i0IH2dIaHHjRXIxCA9EBM4NC+NEQvRgA/OfARv//IAgDSxAAGmgBOBpoACj70XBH9AcAABC1TSAA8Oz5EL0AAPC1IE8NADtoFADDsAArJtFAIiEAAqgA8Dv7G0sbaAArEtAEmRlOyhcSBRMNWxgbEwEiKQAgADNgAPBy+jNoATszYAEjO2AI4AKbQiDbBwDVNCAA8L/5ACjj0EOw8L0LTjNoAZMAKwXRAiIgAADwWPoBm+fnACIgAADwUvozaAE7M2Dq5wAIAAD4BwAA/AcAAPe1gCcGAAUAAZIMC38BAZs5AJobKABSGf/3qv8AKAXbgCMBPFsB7RgALPDR/r0AABC1BAAcIgAhAPDt+gdLI2AHS2NgB0tjgSojo3MGSyNhBktjYQZLo2EQvcBGqHLrKDF6AwACQAAA2AB4AMcAIAABAAUAELWKsAOo//fZ/wEjAJMIS5AgXGsAIwOpGgBABaBHBUsFSgAgWmAFIphgGmAKsBC9nAIwABDgAOBNdQAAACBwRwtoA2AAIHBHA2gAIAtgcEc3tWpGAwAAIAIyAZAQgNUrFdjQKwjYQis80A7YIytY0DErT9ACOD690TsYAAQrBtgA8Hr6CA0FIhEAcStG0AIgQELw5ytLG2gLgAAg6+cKaClLGmD558AkgCAAI2QCQAHNWB
@9names
9names / main.rs
Created January 15, 2026 08:20
2MHz PWM on rp2040
#![no_std]
#![no_main]
use defmt::*;
use defmt_rtt as _;
use embedded_hal::pwm::SetDutyCycle;
use panic_probe as _;
use rp2040_hal::{
clocks::{init_clocks_and_plls, Clock},
entry, pac,
@9names
9names / main.rs
Created January 15, 2026 09:41
GPOUT on gpio25 on pico
#![no_std]
#![no_main]
use defmt::*;
use defmt_rtt as _;
use panic_probe as _;
use rp2040_hal::{
clocks::{init_clocks_and_plls, Clock},
entry,
gpio::FunctionClock,