Expand description

Board Support Package for the SparkFun MicroMod RP2040.

This crate serves as a HAL (Hardware Abstraction Layer) for the SparkFun MicroMod RP2040. Since the SparkFun MicroMod RP2040 is based on the RP2040 chip, it re-exports the rp2040_hal crate which contains the tooling to work with the rp2040 chip.

§Examples:

The following example turns on the onboard LED. Note that most of the logic works through the rp2040_hal crate.

#![no_main]
use sparkfun_micromod_rp2040::entry;
use panic_halt as _;
use embedded_hal::digital::v2::OutputPin;
use sparkfun_micromod_rp2040::hal::pac;
use sparkfun_micromod_rp2040::hal;
#[entry]
fn does_not_have_to_be_main() -> ! {
  let mut pac = pac::Peripherals::take().unwrap();
  let sio = hal::Sio::new(pac.SIO);
  let pins = rp_pico::Pins::new(
       pac.IO_BANK0,
       pac.PADS_BANK0,
       sio.gpio_bank0,
       &mut pac.RESETS,
  );
  let mut led_pin = pins.led.into_push_pull_output();
  led_pin.set_high().unwrap();
  loop {
  }
}

Re-exports§

Structs§

Constants§

Statics§

  • The linker will place this boot block at the start of our program image. We need this to help the ROM bootloader get our code up and running.

Type Aliases§

Attribute Macros§

  • The entry macro declares the starting function to the linker. This is similar to the main function in console applications.