#rp2040 #tiny-circuits

no-std thumby

Library for TinyCircuits Thumby device

1 unstable release

0.0.3 Jan 16, 2023
0.0.2 Jan 12, 2023
0.0.1 Jan 9, 2023

#951 in Embedded development

GPL-3.0 license

26KB
241 lines

thumby-rs

This is a Rust crate that may be used to interface with the TinyCircuits Thumby device.

Downloading an installing the binary

  1. Navigate to the releases page.
  2. Download the .uf2 file from the Assets dropdown.
  3. Make sure your Thumby is in BOOTSEL mode
    • Power on your Thumby by toggling the switch on top to the right.
    • While holding the down button on the D-pad, switch your Thumby off by toggling the switch to the left.
    • While continuing to hold the down button, power on your Thumby again.
    • Your Thumby should now be mounted on your system.
  4. Move the downloaded .uf2 file to your mounted Thumby. It should automatically unmount itself.

Instructions for downloading and running examples

  1. Download Rust.
  2. Run the setup.sh script. This requires Bash CLI, which on Windows may be obtained through Git Bash.
  3. Make sure your Thumby is in BOOTSEL mode
    • Power on your Thumby by toggling the switch on top to the right.
    • While holding the down button on the D-pad, switch your Thumby off by toggling the switch to the left.
    • While continuing to hold the down button, power on your Thumby again.
    • Your Thumby should now be mounted on your system.
  4. Optional: Install Visual Studio Code.
  5. Clone this repository:
    git clone https://github.com/jngo102/thumby-rs
  6. If you installed Visual Studio Code, you can quickly deploy to your mounted Thumby by opening the command palette (Ctrl/Cmd+Shift+P), executing the Deploy to Thumby task, then answering the prompts.
  7. If you did not install Visual Studio Code, you may open a terminal, navigate to the path of the cloned repository: cd /path/to/thumby-rs, and run the command cargo build --example {exampleName}, where {exampleName} should be replaced with the name of an example that may be found in the examples folder.
  8. After the build is complete, navigate to the produced binary: cd ./target/thumbv6m-none-eabi/debug/examples/{exampleName}
  9. Run the command elf2uf2-rs {exampleName} to turn the ELF binary into a UF2 binary that may be used by the Thumby.
  10. Copy the resulting UF2 file into the location of your mounted Thumby. It should automatically unmount itself.

Using this crate in a project

  1. Clone the rp2040-hal template project to your computer.
  2. Open the cloned folder in an IDE.
  3. In the Cargo.toml file, under [dependencies], add thumby = "^0".
  4. You may now start importing thumby-rs modules to use in your game.
  5. If you have Visual Studio Code, it is recommended to have the rust-analyzer extension installed.

Dependencies

~9MB
~174K SLoC