Skip to content

Commit

Permalink
Merge pull request #450 from quartiq/hal-0.22
Browse files Browse the repository at this point in the history
hal 0.22
  • Loading branch information
jordens authored Oct 11, 2024
2 parents e7ba047 + ecbb97e commit d641f61
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 26 deletions.
74 changes: 64 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ enc424j600 = "0.4"
embedded-hal = "1"
smoltcp-nal = { version = "0.5", features=["shared-stack"] }
serial-settings = "0.1"
stm32f4xx-hal = {version = "0.21.0", features = ["stm32f407", "usb_fs"] }
stm32f4xx-hal = {version = "0.22.0", features = ["stm32f407", "usb_fs"] }

postcard = "1"

Expand Down
8 changes: 4 additions & 4 deletions src/hardware/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ pub fn shutdown_channels() {
unsafe {
// Disable all SIG_ON outputs. Note that the upper 16 bits of this register are the ODR
// reset bits.
gpiog.bsrr.write(|w| w.bits(0xFF00_0000));
gpiog.bsrr().write(|w| w.bits(0xFF00_0000));

// Disable all EN_PWR outputs. Note that the upper 16 bits of this register are the ODR
// reset bits.
gpiod.bsrr.write(|w| w.bits(0x00FF_0000));
gpiod.bsrr().write(|w| w.bits(0x00FF_0000));
}
}

Expand Down Expand Up @@ -105,14 +105,14 @@ pub fn i2c_bus_reset(sda: &mut impl OutputPin, scl: &mut impl OutputPin, delay:
pub fn watchdog_detected() -> bool {
let rcc = unsafe { &*hal::pac::RCC::ptr() };

rcc.csr.read().wdgrstf().bit_is_set()
rcc.csr().read().wdgrstf().bit_is_set()
}

/// Clear all of the reset flags in the device.
pub fn clear_reset_flags() {
let rcc = unsafe { &*hal::pac::RCC::ptr() };

rcc.csr.modify(|_, w| w.rmvf().set_bit());
rcc.csr().modify(|_, w| w.rmvf().set_bit());
}

pub fn start_dfu_reboot() {
Expand Down
20 changes: 10 additions & 10 deletions src/hardware/rf_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,18 @@ impl Devices {

/// Represents the control and status pins for an RF channel.
pub struct ChannelPins {
enable_power: hal::gpio::EPin<Output>,
enable_power: hal::gpio::ErasedPin<Output>,

// The alert and input overdrive pins have external pull resistors, so we don't need to pull
// them internally.
alert: hal::gpio::EPin<Input>,
alert: hal::gpio::ErasedPin<Input>,

reflected_overdrive: hal::gpio::EPin<Input>,
reflected_overdrive: hal::gpio::ErasedPin<Input>,

// There are no pullup/pulldown resistors on this input, so we will pull it down internally.
output_overdrive: hal::gpio::EPin<Input>,
output_overdrive: hal::gpio::ErasedPin<Input>,

signal_on: hal::gpio::EPin<Output>,
signal_on: hal::gpio::ErasedPin<Output>,

output_power: AdcPin,
reflected_power: AdcPin,
Expand All @@ -228,11 +228,11 @@ impl ChannelPins {
/// * `output_power` - The pin to use for measuring transmitted power.
/// * `reflected_power` - The pin to use for measuring reflected power.
pub fn new(
enable_power: hal::gpio::EPin<Output>,
alert: hal::gpio::EPin<Input>,
reflected_overdrive: hal::gpio::EPin<Input>,
output_overdrive: hal::gpio::EPin<Input>,
signal_on: hal::gpio::EPin<Output>,
enable_power: hal::gpio::ErasedPin<Output>,
alert: hal::gpio::ErasedPin<Input>,
reflected_overdrive: hal::gpio::ErasedPin<Input>,
output_overdrive: hal::gpio::ErasedPin<Input>,
signal_on: hal::gpio::ErasedPin<Output>,
output_power: AdcPin,
reflected_power: AdcPin,
) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn setup(
clock: SystemTimer,
) -> BoosterDevices {
// Configure RTT logging.
device.DBGMCU.cr.modify(|_, w| w.dbg_sleep().set_bit());
device.DBGMCU.cr().modify(|_, w| w.dbg_sleep().set_bit());
rtt_target::rtt_init_print!();

// Install the logger
Expand Down

0 comments on commit d641f61

Please sign in to comment.