From 10493bfc38e89851a0c50c192a5546375fb77f6f Mon Sep 17 00:00:00 2001 From: Jacob Rosenthal Date: Tue, 8 Dec 2020 10:19:04 -0700 Subject: [PATCH] disambiguate pins and sets --- boards/pygamer/examples/button_rtic.rs | 6 +++--- boards/pygamer/examples/ferris_img.rs | 6 +++--- boards/pygamer/examples/neopixel_adc_battery.rs | 6 +++--- boards/pygamer/examples/neopixel_button.rs | 8 ++++---- boards/pygamer/examples/neopixel_easing.rs | 4 ++-- boards/pygamer/examples/neopixel_rainbow_timer.rs | 4 ++-- boards/pygamer/examples/neopixel_tilt.rs | 8 ++++---- boards/pygamer/examples/sd_card.rs | 12 ++++++------ boards/pygamer/examples/usb_poll.rs | 8 ++++---- boards/pygamer/examples/usb_serial.rs | 8 ++++---- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/boards/pygamer/examples/button_rtic.rs b/boards/pygamer/examples/button_rtic.rs index f9af69c7e257..fe95cc0f4207 100644 --- a/boards/pygamer/examples/button_rtic.rs +++ b/boards/pygamer/examples/button_rtic.rs @@ -50,7 +50,7 @@ const APP: () = { &mut device.NVMCTRL, ); - let mut pins = Pins::new(device.PORT).split(); + let mut sets = Pins::new(device.PORT).split(); let gclk0 = clocks.gclk0(); let timer_clock = clocks.tc2_tc3(&gclk0).unwrap(); @@ -61,8 +61,8 @@ const APP: () = { tc3.enable_interrupt(); init::LateResources { - buttons: pins.buttons.init(&mut pins.port), - red_led: pins.led_pin.into_open_drain_output(&mut pins.port), + buttons: sets.buttons.init(&mut sets.port), + red_led: sets.led_pin.into_open_drain_output(&mut sets.port), timer: tc3, } } diff --git a/boards/pygamer/examples/ferris_img.rs b/boards/pygamer/examples/ferris_img.rs index 6eab439f6703..60795bdf1bd8 100644 --- a/boards/pygamer/examples/ferris_img.rs +++ b/boards/pygamer/examples/ferris_img.rs @@ -32,10 +32,10 @@ fn main() -> ! { &mut peripherals.OSCCTRL, &mut peripherals.NVMCTRL, ); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); let mut delay = hal::delay::Delay::new(core.SYST, &mut clocks); - let (mut display, _backlight) = pins + let (mut display, _backlight) = sets .display .init( &mut clocks, @@ -43,7 +43,7 @@ fn main() -> ! { &mut peripherals.MCLK, peripherals.TC2, &mut delay, - &mut pins.port, + &mut sets.port, ) .unwrap(); diff --git a/boards/pygamer/examples/neopixel_adc_battery.rs b/boards/pygamer/examples/neopixel_adc_battery.rs index 81538d5ee086..0d3caf0a9488 100644 --- a/boards/pygamer/examples/neopixel_adc_battery.rs +++ b/boards/pygamer/examples/neopixel_adc_battery.rs @@ -29,14 +29,14 @@ fn main() -> ! { &mut peripherals.OSCCTRL, &mut peripherals.NVMCTRL, ); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); let mut adc0 = Adc::adc0(peripherals.ADC0, &mut peripherals.MCLK, &mut clocks, GCLK11); - let mut battery = pins.battery.init(&mut pins.port); + let mut battery = sets.battery.init(&mut sets.port); // neopixels let timer = SpinTimer::new(4); - let mut neopixel = pins.neopixel.init(timer, &mut pins.port); + let mut neopixel = sets.neopixel.init(timer, &mut sets.port); let mut delay = Delay::new(core.SYST, &mut clocks); diff --git a/boards/pygamer/examples/neopixel_button.rs b/boards/pygamer/examples/neopixel_button.rs index 05a6969cd4b3..e329e20ad378 100644 --- a/boards/pygamer/examples/neopixel_button.rs +++ b/boards/pygamer/examples/neopixel_button.rs @@ -38,17 +38,17 @@ fn main() -> ! { ); let mut delay = Delay::new(core_peripherals.SYST, &mut clocks); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); - let mut buttons = pins.buttons.init(&mut pins.port); + let mut buttons = sets.buttons.init(&mut sets.port); let mut adc1 = Adc::adc1(peripherals.ADC1, &mut peripherals.MCLK, &mut clocks, GCLK11); - let mut joystick = pins.joystick.init(&mut pins.port); + let mut joystick = sets.joystick.init(&mut sets.port); // neopixels let timer = SpinTimer::new(4); - let mut neopixel = pins.neopixel.init(timer, &mut pins.port); + let mut neopixel = sets.neopixel.init(timer, &mut sets.port); const NUM_LEDS: usize = 5; let mut pos_button: usize = 2; diff --git a/boards/pygamer/examples/neopixel_easing.rs b/boards/pygamer/examples/neopixel_easing.rs index f6f82a47548c..f80e3d210613 100644 --- a/boards/pygamer/examples/neopixel_easing.rs +++ b/boards/pygamer/examples/neopixel_easing.rs @@ -33,10 +33,10 @@ fn main() -> ! { &mut peripherals.NVMCTRL, ); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); let timer = SpinTimer::new(4); - let mut neopixel = pins.neopixel.init(timer, &mut pins.port); + let mut neopixel = sets.neopixel.init(timer, &mut sets.port); let mut delay = Delay::new(core.SYST, &mut clocks); let trng = Trng::new(&mut peripherals.MCLK, peripherals.TRNG); diff --git a/boards/pygamer/examples/neopixel_rainbow_timer.rs b/boards/pygamer/examples/neopixel_rainbow_timer.rs index ab8f3cd5a88a..5220cb9084c1 100644 --- a/boards/pygamer/examples/neopixel_rainbow_timer.rs +++ b/boards/pygamer/examples/neopixel_rainbow_timer.rs @@ -30,14 +30,14 @@ fn main() -> ! { &mut peripherals.OSCCTRL, &mut peripherals.NVMCTRL, ); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); let gclk0 = clocks.gclk0(); let timer_clock = clocks.tc2_tc3(&gclk0).unwrap(); let mut timer = TimerCounter::tc3_(&timer_clock, peripherals.TC3, &mut peripherals.MCLK); timer.start(3.mhz()); - let mut neopixel = pins.neopixel.init(timer, &mut pins.port); + let mut neopixel = sets.neopixel.init(timer, &mut sets.port); let mut delay = Delay::new(core.SYST, &mut clocks); loop { diff --git a/boards/pygamer/examples/neopixel_tilt.rs b/boards/pygamer/examples/neopixel_tilt.rs index d11fdbca8266..6c2b111e6aa6 100644 --- a/boards/pygamer/examples/neopixel_tilt.rs +++ b/boards/pygamer/examples/neopixel_tilt.rs @@ -34,19 +34,19 @@ fn main() -> ! { ); let mut delay = Delay::new(core_peripherals.SYST, &mut clocks); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); // neopixels let timer = SpinTimer::new(4); - let mut neopixel = pins.neopixel.init(timer, &mut pins.port); + let mut neopixel = sets.neopixel.init(timer, &mut sets.port); // i2c - let i2c = pins.i2c.init( + let i2c = sets.i2c.init( &mut clocks, KiloHertz(400), peripherals.SERCOM2, &mut peripherals.MCLK, - &mut pins.port, + &mut sets.port, ); let mut lis3dh = Lis3dh::new(i2c, 0x19).unwrap(); diff --git a/boards/pygamer/examples/sd_card.rs b/boards/pygamer/examples/sd_card.rs index a130adf8548e..2e5e76208429 100644 --- a/boards/pygamer/examples/sd_card.rs +++ b/boards/pygamer/examples/sd_card.rs @@ -43,22 +43,22 @@ fn main() -> ! { ); let mut delay = Delay::new(core.SYST, &mut clocks); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); - let mut red_led = pins.led_pin.into_open_drain_output(&mut pins.port); + let mut red_led = sets.led_pin.into_open_drain_output(&mut sets.port); - let sdmmc_cs: OldOutputPin<_> = pins.sd_cs_pin.into_push_pull_output(&mut pins.port).into(); - let sdmmc_spi = pins.spi.init( + let sdmmc_cs: OldOutputPin<_> = sets.sd_cs_pin.into_push_pull_output(&mut sets.port).into(); + let sdmmc_spi = sets.spi.init( &mut clocks, MegaHertz(3), peripherals.SERCOM1, &mut peripherals.MCLK, - &mut pins.port, + &mut sets.port, ); let mut cont = embedded_sdmmc::Controller::new(embedded_sdmmc::SdMmcSpi::new(sdmmc_spi, sdmmc_cs), Clock); - let (mut display, _backlight) = pins + let (mut display, _backlight) = sets .display .init( &mut clocks, diff --git a/boards/pygamer/examples/usb_poll.rs b/boards/pygamer/examples/usb_poll.rs index 868468551726..5dd5e16f8ccc 100644 --- a/boards/pygamer/examples/usb_poll.rs +++ b/boards/pygamer/examples/usb_poll.rs @@ -26,17 +26,17 @@ fn main() -> ! { &mut peripherals.NVMCTRL, ); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); - let usb_bus = pins.usb.init( + let usb_bus = sets.usb.init( peripherals.USB, &mut clocks, &mut peripherals.MCLK, - &mut pins.port, + &mut sets.port, ); let mut serial = SerialPort::new(&usb_bus); - let mut led = pins.led_pin.into_open_drain_output(&mut pins.port); + let mut led = sets.led_pin.into_open_drain_output(&mut sets.port); let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd)) .manufacturer("Fake company") diff --git a/boards/pygamer/examples/usb_serial.rs b/boards/pygamer/examples/usb_serial.rs index ad698f2b15af..0c1a57730939 100644 --- a/boards/pygamer/examples/usb_serial.rs +++ b/boards/pygamer/examples/usb_serial.rs @@ -40,19 +40,19 @@ fn main() -> ! { &mut peripherals.OSCCTRL, &mut peripherals.NVMCTRL, ); - let mut pins = Pins::new(peripherals.PORT).split(); + let mut sets = Pins::new(peripherals.PORT).split(); let timer = SpinTimer::new(4); - let mut neopixel = pins.neopixel.init(timer, &mut pins.port); + let mut neopixel = sets.neopixel.init(timer, &mut sets.port); let _ = neopixel.write((0..5).map(|_| RGB8::default())); let bus_allocator = unsafe { - USB_ALLOCATOR = Some(pins.usb.init( + USB_ALLOCATOR = Some(sets.usb.init( peripherals.USB, &mut clocks, &mut peripherals.MCLK, - &mut pins.port, + &mut sets.port, )); USB_ALLOCATOR.as_ref().unwrap() };