Move uses of sio::Sio to Sio

This commit is contained in:
9names 2021-12-04 15:52:46 +11:00
parent 11aa0b87af
commit dc8ceffd09
30 changed files with 34 additions and 34 deletions

View file

@ -14,9 +14,9 @@ use feather_rp2040::{
hal::{ hal::{
clocks::{init_clocks_and_plls, Clock}, clocks::{init_clocks_and_plls, Clock},
pac, pac,
sio::Sio,
timer::Timer, timer::Timer,
watchdog::Watchdog, watchdog::Watchdog,
Sio,
}, },
Pins, XOSC_CRYSTAL_FREQ, Pins, XOSC_CRYSTAL_FREQ,
}; };

View file

@ -70,7 +70,7 @@ fn main() -> ! {
let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer()); let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer());
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins to their default state // Set the pins to their default state
let pins = hal::gpio::Pins::new( let pins = hal::gpio::Pins::new(

View file

@ -16,8 +16,8 @@ use itsy_bitsy_rp2040::{
hal::{ hal::{
clocks::{init_clocks_and_plls, Clock}, clocks::{init_clocks_and_plls, Clock},
pac, pac,
sio::Sio,
watchdog::Watchdog, watchdog::Watchdog,
Sio,
}, },
Pins, XOSC_CRYSTAL_FREQ, Pins, XOSC_CRYSTAL_FREQ,
}; };

View file

@ -18,9 +18,9 @@ use kb2040::{
hal::{ hal::{
clocks::{init_clocks_and_plls, Clock}, clocks::{init_clocks_and_plls, Clock},
pac, pac,
sio::Sio,
timer::Timer, timer::Timer,
watchdog::Watchdog, watchdog::Watchdog,
Sio,
}, },
XOSC_CRYSTAL_FREQ, XOSC_CRYSTAL_FREQ,
}; };

View file

@ -76,7 +76,7 @@ fn main() -> ! {
let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer()); let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer());
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins up according to their function on this particular board // Set the pins up according to their function on this particular board
let pins = pico::Pins::new( let pins = pico::Pins::new(

View file

@ -65,7 +65,7 @@ fn main() -> ! {
let mut count_down = timer.count_down(); let mut count_down = timer.count_down();
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins up according to their function on this particular board // Set the pins up according to their function on this particular board
let pins = pico::Pins::new( let pins = pico::Pins::new(

View file

@ -52,7 +52,7 @@ fn main() -> ! {
// at it's default clock speed. // at it's default clock speed.
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins up according to their function on this particular board // Set the pins up according to their function on this particular board
let pins = pico::Pins::new( let pins = pico::Pins::new(

View file

@ -31,8 +31,8 @@ use hal::{
gpio::{bank0, FunctionI2C, Pin}, gpio::{bank0, FunctionI2C, Pin},
i2c::{peripheral::I2CPeripheralEventIterator, I2C}, i2c::{peripheral::I2CPeripheralEventIterator, I2C},
pac, pac,
sio::Sio,
watchdog::Watchdog, watchdog::Watchdog,
Sio,
}; };
use pico::{hal, Pins, XOSC_CRYSTAL_FREQ}; use pico::{hal, Pins, XOSC_CRYSTAL_FREQ};

View file

@ -84,7 +84,7 @@ fn main() -> ! {
.unwrap(); .unwrap();
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins up according to their function on this particular board // Set the pins up according to their function on this particular board
let pins = pico::Pins::new( let pins = pico::Pins::new(

View file

@ -78,7 +78,7 @@ fn main() -> ! {
.unwrap(); .unwrap();
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins up according to their function on this particular board // Set the pins up according to their function on this particular board
let pins = pico::Pins::new( let pins = pico::Pins::new(

View file

@ -13,7 +13,7 @@ mod app {
use embedded_hal::digital::v2::OutputPin; use embedded_hal::digital::v2::OutputPin;
use pico::{ use pico::{
hal::{self, clocks::init_clocks_and_plls, pac, sio::Sio, watchdog::Watchdog}, hal::{self, clocks::init_clocks_and_plls, pac, watchdog::Watchdog, Sio},
XOSC_CRYSTAL_FREQ, XOSC_CRYSTAL_FREQ,
}; };

View file

@ -140,7 +140,7 @@ fn main() -> ! {
let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer()); let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer());
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins up according to their function on this particular board // Set the pins up according to their function on this particular board
let pins = pico::Pins::new( let pins = pico::Pins::new(

View file

@ -12,7 +12,7 @@ use embedded_graphics::{
}; };
use embedded_hal::digital::v2::OutputPin; use embedded_hal::digital::v2::OutputPin;
use embedded_time::rate::*; use embedded_time::rate::*;
use hal::{adc::Adc, clocks::*, sio::Sio, watchdog::Watchdog}; use hal::{adc::Adc, clocks::*, watchdog::Watchdog, Sio};
use panic_halt as _; use panic_halt as _;
use pico_explorer::{hal, pac, Button, PicoExplorer, XOSC_CRYSTAL_FREQ}; use pico_explorer::{hal, pac, Button, PicoExplorer, XOSC_CRYSTAL_FREQ};

View file

@ -76,7 +76,7 @@ fn main() -> ! {
let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer()); let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer());
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins up according to their function on this particular board // Set the pins up according to their function on this particular board
let pins = pico_lipo_16_mb::Pins::new( let pins = pico_lipo_16_mb::Pins::new(

View file

@ -18,9 +18,9 @@ use pro_micro_rp2040::{
hal::{ hal::{
clocks::{init_clocks_and_plls, Clock}, clocks::{init_clocks_and_plls, Clock},
pac, pac,
sio::Sio,
timer::Timer, timer::Timer,
watchdog::Watchdog, watchdog::Watchdog,
Sio,
}, },
XOSC_CRYSTAL_FREQ, XOSC_CRYSTAL_FREQ,
}; };

View file

@ -16,8 +16,8 @@ use qt_py_rp2040::{
hal::{ hal::{
clocks::{init_clocks_and_plls, Clock}, clocks::{init_clocks_and_plls, Clock},
pac, pac,
sio::Sio,
watchdog::Watchdog, watchdog::Watchdog,
Sio,
}, },
Pins, XOSC_CRYSTAL_FREQ, Pins, XOSC_CRYSTAL_FREQ,
}; };

View file

@ -65,7 +65,7 @@ fn main() -> ! {
.unwrap(); .unwrap();
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins to their default state // Set the pins to their default state
let pins = hal::gpio::Pins::new( let pins = hal::gpio::Pins::new(

View file

@ -8,7 +8,7 @@ use cortex_m_rt::entry;
use hal::gpio::{FunctionPio0, Pin}; use hal::gpio::{FunctionPio0, Pin};
use hal::pac; use hal::pac;
use hal::pio::PIOExt; use hal::pio::PIOExt;
use hal::sio::Sio; use hal::Sio;
use panic_halt as _; use panic_halt as _;
use rp2040_hal as hal; use rp2040_hal as hal;

View file

@ -8,7 +8,7 @@ use cortex_m_rt::entry;
use hal::gpio::{FunctionPio0, Pin}; use hal::gpio::{FunctionPio0, Pin};
use hal::pac; use hal::pac;
use hal::pio::PIOExt; use hal::pio::PIOExt;
use hal::sio::Sio; use hal::Sio;
use panic_halt as _; use panic_halt as _;
use rp2040_hal as hal; use rp2040_hal as hal;

View file

@ -73,7 +73,7 @@ fn main() -> ! {
let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer()); let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer());
// The single-cycle I/O block controls our GPIO pins // The single-cycle I/O block controls our GPIO pins
let sio = hal::sio::Sio::new(pac.SIO); let sio = hal::Sio::new(pac.SIO);
// Set the pins to their default state // Set the pins to their default state
let pins = hal::gpio::Pins::new( let pins = hal::gpio::Pins::new(

View file

@ -7,7 +7,7 @@
//! Capture ADC reading from a pin //! Capture ADC reading from a pin
//! ```no_run //! ```no_run
//! use embedded_hal::adc::OneShot; //! use embedded_hal::adc::OneShot;
//! use rp2040_hal::{adc::Adc, gpio::Pins, pac, sio::Sio}; //! use rp2040_hal::{adc::Adc, gpio::Pins, pac, Sio};
//! let mut peripherals = pac::Peripherals::take().unwrap(); //! let mut peripherals = pac::Peripherals::take().unwrap();
//! let sio = Sio::new(peripherals.SIO); //! let sio = Sio::new(peripherals.SIO);
//! let pins = Pins::new(peripherals.IO_BANK0, peripherals.PADS_BANK0, sio.gpio_bank0, &mut peripherals.RESETS); //! let pins = Pins::new(peripherals.IO_BANK0, peripherals.PADS_BANK0, sio.gpio_bank0, &mut peripherals.RESETS);
@ -22,7 +22,7 @@
//! Capture ADC reading from temperature sensor. Note that this needs conversion to be a real-world temperature. //! Capture ADC reading from temperature sensor. Note that this needs conversion to be a real-world temperature.
//! ```no_run //! ```no_run
//! use embedded_hal::adc::OneShot; //! use embedded_hal::adc::OneShot;
//! use rp2040_hal::{adc::Adc, gpio::Pins, pac, sio::Sio}; //! use rp2040_hal::{adc::Adc, gpio::Pins, pac, Sio};
//! let mut peripherals = pac::Peripherals::take().unwrap(); //! let mut peripherals = pac::Peripherals::take().unwrap();
//! let sio = Sio::new(peripherals.SIO); //! let sio = Sio::new(peripherals.SIO);
//! let pins = Pins::new(peripherals.IO_BANK0, peripherals.PADS_BANK0, sio.gpio_bank0, &mut peripherals.RESETS); //! let pins = Pins::new(peripherals.IO_BANK0, peripherals.PADS_BANK0, sio.gpio_bank0, &mut peripherals.RESETS);

View file

@ -15,7 +15,7 @@
//! ## Usage extended //! ## Usage extended
//! ```no_run //! ```no_run
//! use embedded_time::rate::*; //! use embedded_time::rate::*;
//! use rp2040_hal::{clocks::{Clock, ClocksManager, ClockSource, InitError}, gpio::Pins, pac, pll::{common_configs::{PLL_SYS_125MHZ, PLL_USB_48MHZ}, setup_pll_blocking}, sio::Sio, watchdog::Watchdog, xosc::setup_xosc_blocking}; //! use rp2040_hal::{clocks::{Clock, ClocksManager, ClockSource, InitError}, gpio::Pins, pac, pll::{common_configs::{PLL_SYS_125MHZ, PLL_USB_48MHZ}, setup_pll_blocking}, Sio, watchdog::Watchdog, xosc::setup_xosc_blocking};
//! //!
//! # fn func() -> Result<(), InitError> { //! # fn func() -> Result<(), InitError> {
//! let mut peripherals = pac::Peripherals::take().unwrap(); //! let mut peripherals = pac::Peripherals::take().unwrap();

View file

@ -18,7 +18,7 @@
//! //!
//! ```no_run //! ```no_run
//! // Move a pin out of the Pins struct and convert to a DynPin //! // Move a pin out of the Pins struct and convert to a DynPin
//! # use rp2040_hal::{pac, gpio::{DynPin, bank0::Gpio12, Pins}, sio::Sio}; //! # use rp2040_hal::{pac, gpio::{DynPin, bank0::Gpio12, Pins}, Sio};
//! # let mut peripherals = pac::Peripherals::take().unwrap(); //! # let mut peripherals = pac::Peripherals::take().unwrap();
//! # let sio = Sio::new(peripherals.SIO); //! # let sio = Sio::new(peripherals.SIO);
//! # let pins = Pins::new(peripherals.IO_BANK0,peripherals.PADS_BANK0,sio.gpio_bank0, &mut peripherals.RESETS); //! # let pins = Pins::new(peripherals.IO_BANK0,peripherals.PADS_BANK0,sio.gpio_bank0, &mut peripherals.RESETS);
@ -30,7 +30,7 @@
//! API. //! API.
//! //!
//! ```no_run //! ```no_run
//! # use rp2040_hal::{pac, gpio::{DynPin, Pins}, sio::Sio}; //! # use rp2040_hal::{pac, gpio::{DynPin, Pins}, Sio};
//! # let mut peripherals = pac::Peripherals::take().unwrap(); //! # let mut peripherals = pac::Peripherals::take().unwrap();
//! # let sio = Sio::new(peripherals.SIO); //! # let sio = Sio::new(peripherals.SIO);
//! # let pins = Pins::new(peripherals.IO_BANK0,peripherals.PADS_BANK0,sio.gpio_bank0, &mut peripherals.RESETS); //! # let pins = Pins::new(peripherals.IO_BANK0,peripherals.PADS_BANK0,sio.gpio_bank0, &mut peripherals.RESETS);
@ -54,7 +54,7 @@
//! //!
//! ```no_run //! ```no_run
//! # use core::convert::TryInto; //! # use core::convert::TryInto;
//! # use rp2040_hal::{pac, gpio::{DynPin, bank0::Gpio12, Pin, Pins, FloatingInput}, sio::Sio}; //! # use rp2040_hal::{pac, gpio::{DynPin, bank0::Gpio12, Pin, Pins, FloatingInput}, Sio};
//! # let mut peripherals = pac::Peripherals::take().unwrap(); //! # let mut peripherals = pac::Peripherals::take().unwrap();
//! # let sio = Sio::new(peripherals.SIO); //! # let sio = Sio::new(peripherals.SIO);
//! # let pins = Pins::new(peripherals.IO_BANK0,peripherals.PADS_BANK0,sio.gpio_bank0, &mut peripherals.RESETS); //! # let pins = Pins::new(peripherals.IO_BANK0,peripherals.PADS_BANK0,sio.gpio_bank0, &mut peripherals.RESETS);

View file

@ -5,7 +5,7 @@
//! ## Basic usage //! ## Basic usage
//! ```no_run //! ```no_run
//! use embedded_hal::digital::v2::{InputPin, OutputPin}; //! use embedded_hal::digital::v2::{InputPin, OutputPin};
//! use rp2040_hal::{clocks::init_clocks_and_plls, gpio::Pins, watchdog::Watchdog, pac, sio::Sio}; //! use rp2040_hal::{clocks::init_clocks_and_plls, gpio::Pins, watchdog::Watchdog, pac, Sio};
//! let mut peripherals = pac::Peripherals::take().unwrap(); //! let mut peripherals = pac::Peripherals::take().unwrap();
//! let mut watchdog = Watchdog::new(peripherals.WATCHDOG); //! let mut watchdog = Watchdog::new(peripherals.WATCHDOG);
//! const XOSC_CRYSTAL_FREQ: u32 = 12_000_000; // Typically found in BSP crates //! const XOSC_CRYSTAL_FREQ: u32 = 12_000_000; // Typically found in BSP crates

View file

@ -5,7 +5,7 @@
//! ## Usage //! ## Usage
//! ```no_run //! ```no_run
//! use embedded_time::rate::Extensions; //! use embedded_time::rate::Extensions;
//! use rp2040_hal::{i2c::I2C, gpio::Pins, pac, sio::Sio}; //! use rp2040_hal::{i2c::I2C, gpio::Pins, pac, Sio};
//! let mut peripherals = pac::Peripherals::take().unwrap(); //! let mut peripherals = pac::Peripherals::take().unwrap();
//! let sio = Sio::new(peripherals.SIO); //! let sio = Sio::new(peripherals.SIO);
//! let pins = Pins::new(peripherals.IO_BANK0, peripherals.PADS_BANK0, sio.gpio_bank0, &mut peripherals.RESETS); //! let pins = Pins::new(peripherals.IO_BANK0, peripherals.PADS_BANK0, sio.gpio_bank0, &mut peripherals.RESETS);

View file

@ -63,7 +63,7 @@ pub struct Multicore<'p> {
impl<'p> Multicore<'p> { impl<'p> Multicore<'p> {
/// Create a new |Multicore| instance. /// Create a new |Multicore| instance.
pub fn new(psm: &'p mut pac::PSM, ppb: &'p mut pac::PPB, sio: &'p mut crate::sio::Sio) -> Self { pub fn new(psm: &'p mut pac::PSM, ppb: &'p mut pac::PPB, sio: &'p mut crate::Sio) -> Self {
Self { Self {
cores: [ cores: [
Core { inner: None }, Core { inner: None },
@ -82,7 +82,7 @@ impl<'p> Multicore<'p> {
/// A handle for controlling a logical core. /// A handle for controlling a logical core.
pub struct Core<'p> { pub struct Core<'p> {
inner: Option<(&'p mut pac::PSM, &'p mut pac::PPB, &'p mut crate::sio::Sio)>, inner: Option<(&'p mut pac::PSM, &'p mut pac::PPB, &'p mut crate::Sio)>,
} }
impl<'p> Core<'p> { impl<'p> Core<'p> {

View file

@ -23,7 +23,7 @@
//! Once you have the PWM slice struct, you can add individual pins: //! Once you have the PWM slice struct, you can add individual pins:
//! //!
//! ```no_run //! ```no_run
//! # use rp2040_hal::{prelude::*, gpio::Pins, sio::Sio, pwm::{InputHighRunning, Slices}}; //! # use rp2040_hal::{prelude::*, gpio::Pins, Sio, pwm::{InputHighRunning, Slices}};
//! # let mut pac = rp2040_pac::Peripherals::take().unwrap(); //! # let mut pac = rp2040_pac::Peripherals::take().unwrap();
//! # let pwm_slices = Slices::new(pac.PWM, &mut pac.RESETS); //! # let pwm_slices = Slices::new(pac.PWM, &mut pac.RESETS);
//! # let mut pwm = pwm_slices.pwm4.into_mode::<InputHighRunning>(); //! # let mut pwm = pwm_slices.pwm4.into_mode::<InputHighRunning>();

View file

@ -7,7 +7,7 @@
//! ```no_run //! ```no_run
//! use embedded_hal::spi::MODE_0; //! use embedded_hal::spi::MODE_0;
//! use embedded_time::rate::*; //! use embedded_time::rate::*;
//! use rp2040_hal::{spi::Spi, gpio::{Pins, FunctionSpi}, pac, sio::Sio}; //! use rp2040_hal::{spi::Spi, gpio::{Pins, FunctionSpi}, pac, Sio};
//! //!
//! let mut peripherals = pac::Peripherals::take().unwrap(); //! let mut peripherals = pac::Peripherals::take().unwrap();
//! let sio = Sio::new(peripherals.SIO); //! let sio = Sio::new(peripherals.SIO);

View file

@ -6,7 +6,7 @@
//! //!
//! See [examples/uart.rs](https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal/examples/uart.rs) for a more complete example //! See [examples/uart.rs](https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal/examples/uart.rs) for a more complete example
//! ```no_run //! ```no_run
//! use rp2040_hal::{clocks::init_clocks_and_plls, gpio::{Pins, FunctionUart}, pac, sio::Sio, uart::{self, UartPeripheral}, watchdog::Watchdog}; //! use rp2040_hal::{clocks::init_clocks_and_plls, gpio::{Pins, FunctionUart}, pac, Sio, uart::{self, UartPeripheral}, watchdog::Watchdog};
//! //!
//! const XOSC_CRYSTAL_FREQ: u32 = 12_000_000; // Typically found in BSP crates //! const XOSC_CRYSTAL_FREQ: u32 = 12_000_000; // Typically found in BSP crates
//! //!

View file

@ -4,7 +4,7 @@
//! //!
//! Initialize the Usb Bus forcing the VBUS detection. //! Initialize the Usb Bus forcing the VBUS detection.
//! ```no_run //! ```no_run
//! use rp2040_hal::{clocks::init_clocks_and_plls, pac, sio::Sio, usb::UsbBus, watchdog::Watchdog}; //! use rp2040_hal::{clocks::init_clocks_and_plls, pac, Sio, usb::UsbBus, watchdog::Watchdog};
//! use usb_device::class_prelude::UsbBusAllocator; //! use usb_device::class_prelude::UsbBusAllocator;
//! //!
//! const XOSC_CRYSTAL_FREQ: u32 = 12_000_000; // Typically found in BSP crates //! const XOSC_CRYSTAL_FREQ: u32 = 12_000_000; // Typically found in BSP crates