Crates.io | waterman |
lib.rs | waterman |
version | 0.1.0 |
source | src |
created_at | 2024-10-19 16:44:35.978855 |
updated_at | 2024-10-19 16:44:35.978855 |
description | A CLI tool to easily flash code onto AVR microcontrollers using avrdude, enhancing the development workflow for embedded Rust projects. |
homepage | https://github.com/cyberkutti-iedc/Niti-core/tree/main/waterman |
repository | https://github.com/cyberkutti-iedc/Niti-core/tree/main/waterman |
max_upload_size | |
id | 1415543 |
size | 540,966 |
The smoothest way to splash some Rust code into your AVR microcontrollers! π¦π
Waterman is here to wrap around avrdude
and make your Rust development for AVRs as easy as doing a cannonball into a pool on a hot day! π¦ And if youβre used to the Arduino IDE, this tool's got you covered with that same easy access to your target's serial console. It's like diving head-first into coding bliss.
Forget the command-line acrobatics. Waterman turns your cargo run
into a one-stop shop: build, flash, run, repeat β like magic, but with less effort and more water! π§
Did Waterman give you an error about serial ports? No worries! If you see:
Error: no matching serial port found, use -P or set WATERMAN_PORT in your environment
Simply run cargo run
with the environment variable set or adjust your .cargo/config.toml
like so:
runner = "waterman {X} -cb {X} -P /dev/ttyUSB{X}" # Replace {X} with your actual values!
And you're good to dive back in!
Before you dive into the deep end, make sure youβve got the right dependencies!
pacman -S systemd pkgconf
apt install libudev-dev pkg-config
dnf install systemd-devel pkgconf-pkg-config
To install Waterman from crates.io, just run:
cargo install waterman
Or, if you're a fan of Nix and Flakes, just add:
inputs.waterman.url = "github:cyberkutti-iedc/avr-hal?dir=waterman";
and use:
waterman.packages."${system}".default
Time to set Waterman as your default "runner" for AVR projects! For example, if youβre working with an Arduino Uno, tweak your .cargo/config.toml
(not Cargo.toml
!) like this:
[target.'cfg(target_arch = "avr")']
runner = "waterman uno --open-console --baudrate 57600"
Now, every time you run cargo run
, Waterman will handle building, flashing, and running your code with grace.
Hereβs what happens when you type cargo run
:
cargo run --bin uno-i2cdetect
You'll see Waterman work its magic in the terminal like a synchronized swimmer:
Compiling arduino-uno-examples...
Finished dev [optimized + debuginfo] target(s) in 1.26s
Running waterman uno -cb 57600 avr-hal/target/avr-atmega328p/debug/uno-i2cdetect.elf
Board: Arduino Uno π
Programming: avr-hal/target/avr-atmega328p/debug/uno-i2cdetect.elf π§βπ» => /dev/ttyACM0
avrdude: Device signature = 0x1e950f
avrdude: Flashing with style... π«
avrdude: Writing flash... Done in 0.27s!
avrdude: Verifying flash... Perfect match! π§©
Programmed avr-hal/target/avr-atmega328p/debug/uno-i2cdetect.elf
Console: Now open at /dev/ttyACM0 (Baud: 57600) π
Running I2C detect tests...
Waterman is soaked in dual licenses:
Pick whichever you prefer, just like picking your favorite pool floatie! π
Now, go and make a splash with Waterman! π§