mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-02-23 23:57:43 +11:00
Make trait comments more consistent.
This commit is contained in:
parent
8876159687
commit
d251627e47
8 changed files with 20 additions and 11 deletions
rp2040-hal/examples
|
@ -20,7 +20,7 @@ use panic_halt as _;
|
||||||
// Alias for our HAL crate
|
// Alias for our HAL crate
|
||||||
use rp2040_hal as hal;
|
use rp2040_hal as hal;
|
||||||
|
|
||||||
// The traits we need
|
// Some traits we need
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
use embedded_hal::adc::OneShot;
|
use embedded_hal::adc::OneShot;
|
||||||
use embedded_time::fixed_point::FixedPoint;
|
use embedded_time::fixed_point::FixedPoint;
|
||||||
|
|
|
@ -23,7 +23,7 @@ use rp2040_hal as hal;
|
||||||
// register access
|
// register access
|
||||||
use hal::pac;
|
use hal::pac;
|
||||||
|
|
||||||
// A GPIO trait we need
|
// Some traits we need
|
||||||
use embedded_hal::digital::v2::OutputPin;
|
use embedded_hal::digital::v2::OutputPin;
|
||||||
use embedded_time::fixed_point::FixedPoint;
|
use embedded_time::fixed_point::FixedPoint;
|
||||||
use rp2040_hal::clocks::Clock;
|
use rp2040_hal::clocks::Clock;
|
||||||
|
|
|
@ -23,7 +23,7 @@ use rp2040_hal as hal;
|
||||||
// register access
|
// register access
|
||||||
use hal::pac;
|
use hal::pac;
|
||||||
|
|
||||||
// The traits we need
|
// Some traits we need
|
||||||
use embedded_hal::digital::v2::InputPin;
|
use embedded_hal::digital::v2::InputPin;
|
||||||
use embedded_hal::digital::v2::OutputPin;
|
use embedded_hal::digital::v2::OutputPin;
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,8 @@ use cortex_m_rt::entry;
|
||||||
// be linked)
|
// be linked)
|
||||||
use panic_halt as _;
|
use panic_halt as _;
|
||||||
|
|
||||||
// The I²C trait from Embedded HAL we need
|
// Some traits we need
|
||||||
use embedded_hal::blocking::i2c::Write;
|
use embedded_hal::blocking::i2c::Write;
|
||||||
|
|
||||||
// A frequency/time related trait we need
|
|
||||||
use embedded_time::rate::Extensions;
|
use embedded_time::rate::Extensions;
|
||||||
|
|
||||||
// Alias for our HAL crate
|
// Alias for our HAL crate
|
||||||
|
|
|
@ -25,7 +25,7 @@ use rp2040_hal as hal;
|
||||||
// Our LCD driver
|
// Our LCD driver
|
||||||
use hd44780_driver as hd44780;
|
use hd44780_driver as hd44780;
|
||||||
|
|
||||||
// Traits we need
|
// Some traits we need
|
||||||
use embedded_time::fixed_point::FixedPoint;
|
use embedded_time::fixed_point::FixedPoint;
|
||||||
use rp2040_hal::clocks::Clock;
|
use rp2040_hal::clocks::Clock;
|
||||||
|
|
||||||
|
@ -118,3 +118,5 @@ fn main() -> ! {
|
||||||
// Empty loop
|
// Empty loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of file
|
||||||
|
|
|
@ -22,7 +22,7 @@ use panic_halt as _;
|
||||||
// Alias for our HAL crate
|
// Alias for our HAL crate
|
||||||
use rp2040_hal as hal;
|
use rp2040_hal as hal;
|
||||||
|
|
||||||
// Traits we need
|
// Some traits we need
|
||||||
use cortex_m::prelude::*;
|
use cortex_m::prelude::*;
|
||||||
use embedded_time::rate::Extensions;
|
use embedded_time::rate::Extensions;
|
||||||
use rp2040_hal::clocks::Clock;
|
use rp2040_hal::clocks::Clock;
|
||||||
|
@ -122,5 +122,9 @@ fn main() -> ! {
|
||||||
};
|
};
|
||||||
|
|
||||||
#[allow(clippy::empty_loop)]
|
#[allow(clippy::empty_loop)]
|
||||||
loop {}
|
loop {
|
||||||
|
// Empty loop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of file
|
|
@ -104,3 +104,5 @@ fn main() -> ! {
|
||||||
value += 1
|
value += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of file
|
||||||
|
|
|
@ -23,7 +23,7 @@ use rp2040_hal as hal;
|
||||||
// register access
|
// register access
|
||||||
use hal::pac;
|
use hal::pac;
|
||||||
|
|
||||||
// Traits we need
|
// Some traits we need
|
||||||
use embedded_hal::digital::v2::OutputPin;
|
use embedded_hal::digital::v2::OutputPin;
|
||||||
use embedded_hal::watchdog::{Watchdog, WatchdogEnable};
|
use embedded_hal::watchdog::{Watchdog, WatchdogEnable};
|
||||||
use embedded_time::duration::Extensions;
|
use embedded_time::duration::Extensions;
|
||||||
|
@ -46,7 +46,8 @@ const XTAL_FREQ_HZ: u32 = 12_000_000u32;
|
||||||
/// as soon as all global variables are initialised.
|
/// as soon as all global variables are initialised.
|
||||||
///
|
///
|
||||||
/// The function configures the RP2040 peripherals, then toggles a GPIO pin in
|
/// The function configures the RP2040 peripherals, then toggles a GPIO pin in
|
||||||
/// an infinite loop. If there is an LED connected to that pin, it will blink.
|
/// an infinite loop. After a period of time, the watchdog will kick in to reset
|
||||||
|
/// the CPU.
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
// Grab our singleton objects
|
// Grab our singleton objects
|
||||||
|
@ -110,3 +111,5 @@ fn main() -> ! {
|
||||||
delay.delay_ms(100);
|
delay.delay_ms(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of file
|
Loading…
Add table
Reference in a new issue