rp-hal-boards/boards/pico/src/lib.rs
9names 0e7abdc705
Make BSPs provide boot2 as a default feature (#153)
* Add boot2 feature. Add boot2 linkage into each BSP optional on feature

* Enable boot2 feature in BSPs by default. Remove boot2 decl from all BSP examples

* Add EXTERN in memory.x for BOOT2_FIRMWARE, rename bootloader static slice to BOOT2_FIRMWARE

* Update new examples and itsy_bitsy BSP to use boot2 feature

* Remove boot2 as a dev-dependency for the BSPs, no longer needed

* Add no_mangle BOOT2_FIRMWARE to adafruit_macropad

* Fix itsy-bitsy blinky - it wasn't using the BSP, so it didn't get BOOT2_FIRMWARE linked in
2021-12-05 01:00:09 +11:00

56 lines
1.4 KiB
Rust

#![no_std]
pub extern crate rp2040_hal as hal;
#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;
//// 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.
#[cfg(feature = "boot2")]
#[link_section = ".boot2"]
#[no_mangle]
#[used]
pub static BOOT2_FIRMWARE: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080;
pub use hal::pac;
hal::bsp_pins!(
Gpio0 { name: gpio0 },
Gpio1 { name: gpio1 },
Gpio2 { name: gpio2 },
Gpio3 { name: gpio3 },
Gpio4 { name: gpio4 },
Gpio5 { name: gpio5 },
Gpio6 { name: gpio6 },
Gpio7 { name: gpio7 },
Gpio8 { name: gpio8 },
Gpio9 { name: gpio9 },
Gpio10 { name: gpio10 },
Gpio11 { name: gpio11 },
Gpio12 { name: gpio12 },
Gpio13 { name: gpio13 },
Gpio14 { name: gpio14 },
Gpio15 { name: gpio15 },
Gpio16 { name: gpio16 },
Gpio17 { name: gpio17 },
Gpio18 { name: gpio18 },
Gpio19 { name: gpio19 },
Gpio20 { name: gpio20 },
Gpio21 { name: gpio21 },
Gpio22 { name: gpio22 },
Gpio23 { name: b_power_save },
Gpio24 { name: vbus_detect },
Gpio25 { name: led },
Gpio26 { name: gpio26 },
Gpio27 { name: gpio27 },
Gpio28 { name: gpio28 },
Gpio29 {
name: voltage_monitor
},
);
pub const XOSC_CRYSTAL_FREQ: u32 = 12_000_000;