#rp2040 #pi #maker #board #package #bsp #cytron

cytron_maker_pi_rp2040

Board Support Package for the Cytron Maker Pi RP2040

9 releases (5 breaking)

0.6.0 Oct 2, 2023
0.5.0 Dec 11, 2022
0.4.0 Sep 7, 2022
0.3.0 Jun 23, 2022
0.1.2 Dec 25, 2021

#2001 in Hardware support

Apache-2.0 OR MIT

16KB
58 lines

Board Support for the Cytron Maker Pi RP2040

You should include this crate if you are writing code that you want to run on a Cytron Maker Pi RP2040.

This crate includes the rp2040-hal, but also configures each pin of the RP2040 chip according to how it is connected up on the Maker Pi RP2040.

Cytron Maker Pi RP2040

Maker Pi RP2040 is an embedded robot control board by Cytron.
You can find more info about it on the Maker Pi RP2040 product page

Using

To use this crate, your Cargo.toml file should contain:

cytron_maker_pi_rp2040 = "0.5"

In your program, you will need to call cytron_maker_pi_rp2040::Pins::new to create a new Pins structure. This will set up all the GPIOs for any on-board devices. See the examples folder for more details.

Running examples

To compile an example, clone this repository and run:

makerpi_rp2040 $ cargo build --release --example <name>

You will get an ELF file called ./target/thumbv6m-none-eabi/release/examples/<name>, where the target folder is located at the top of the repository checkout. Normally you would also need to specify --target=thumbv6m-none-eabi but when building examples from this git repository, that is set as the default.

If you want to convert the ELF file to a UF2 and automatically copy it to the USB drive exported by the RP2040 bootloader, simply boot your board into bootloader mode and run:

makerpi_rp2040 $ cargo run --release --example <name>

If you get an error about not being able to find elf2uf2-rs, try:

$ cargo install elf2uf2-rs

then try repeating the cargo run command above.

Examples

cycle_leds

Flashes a sequence across the Digital IO Status LEDs
cycle_leds_short

stepper_motor

Rotates a stepper motor through 360 degrees clockwise then anticlockwise.
Note that this requires a specific stepper motor from Seeedstudio
stepper_motor

rgb_leds

Cycle through colors on the pair of onboard RGB LEDs
rgb_leds

pwm_buzzer

Plays a sweeping frequency pitch through the on-board buzzer.
Note: the example uses a short pulse length to keep the volume down - see documentation in the code to make it loud!

SPDX-License-Identifier: Apache-2.0 OR MIT

Dependencies

~7.5MB
~151K SLoC