repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/lptim/channel.rs | embassy-stm32/src/lptim/channel.rs | /// Timer channel.
#[derive(Clone, Copy)]
pub enum Channel {
/// Channel 1.
Ch1,
/// Channel 2.
Ch2,
}
impl Channel {
/// Get the channel index (0..1)
pub fn index(&self) -> usize {
match self {
Channel::Ch1 => 0,
Channel::Ch2 => 1,
}
}
}
| rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/lptim/timer/mod.rs | embassy-stm32/src/lptim/timer/mod.rs | //! Low-level timer driver.
mod prescaler;
use embassy_hal_internal::Peri;
#[cfg(any(lptim_v2a, lptim_v2b))]
use super::channel::Channel;
#[cfg(any(lptim_v2a, lptim_v2b))]
mod channel_direction;
#[cfg(any(lptim_v2a, lptim_v2b))]
pub use channel_direction::ChannelDirection;
use prescaler::Prescaler;
use super::Instan... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/lptim/timer/channel_direction.rs | embassy-stm32/src/lptim/timer/channel_direction.rs | use crate::pac::lptim::vals;
/// Direction of a low-power timer channel
pub enum ChannelDirection {
/// Use channel as a PWM output
OutputPwm,
/// Use channel as an input capture
InputCapture,
}
impl From<ChannelDirection> for vals::Ccsel {
fn from(direction: ChannelDirection) -> Self {
ma... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/lptim/timer/prescaler.rs | embassy-stm32/src/lptim/timer/prescaler.rs | //! Low-level timer driver.
use crate::pac::lptim::vals;
pub enum Prescaler {
Div1,
Div2,
Div4,
Div8,
Div16,
Div32,
Div64,
Div128,
}
impl From<&Prescaler> for vals::Presc {
fn from(prescaler: &Prescaler) -> Self {
match prescaler {
Prescaler::Div1 => vals::Pres... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/xspi/enums.rs | embassy-stm32/src/xspi/enums.rs | //! Enums used in Xspi configuration.
#[derive(Copy, Clone)]
pub(crate) enum XspiMode {
IndirectWrite,
IndirectRead,
#[expect(dead_code)]
AutoPolling,
#[expect(dead_code)]
MemoryMapped,
}
impl Into<u8> for XspiMode {
fn into(self) -> u8 {
match self {
XspiMode::IndirectW... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/xspi/mod.rs | embassy-stm32/src/xspi/mod.rs | //! XSPI Serial Peripheral Interface
//!
#![macro_use]
pub mod enums;
use core::marker::PhantomData;
use embassy_embedded_hal::{GetConfig, SetConfig};
use embassy_hal_internal::PeripheralType;
pub use enums::*;
use crate::dma::{ChannelAndRequest, word};
use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/ospi/enums.rs | embassy-stm32/src/ospi/enums.rs | //! Enums used in Ospi configuration.
#[allow(dead_code)]
#[derive(Copy, Clone)]
pub(crate) enum OspiMode {
IndirectWrite,
IndirectRead,
AutoPolling,
MemoryMapped,
}
impl Into<u8> for OspiMode {
fn into(self) -> u8 {
match self {
OspiMode::IndirectWrite => 0b00,
Osp... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/ospi/mod.rs | embassy-stm32/src/ospi/mod.rs | //! OCTOSPI Serial Peripheral Interface
//!
#![macro_use]
pub mod enums;
use core::marker::PhantomData;
use embassy_embedded_hal::{GetConfig, SetConfig};
use embassy_hal_internal::PeripheralType;
pub use enums::*;
use stm32_metapac::octospi::vals::{PhaseMode, SizeInBits};
use crate::dma::{ChannelAndRequest, word};... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/sdmmc/sd.rs | embassy-stm32/src/sdmmc/sd.rs | use core::default::Default;
use core::ops::{Deref, DerefMut};
use sdio_host::emmc::{EMMC, ExtCSD};
use sdio_host::sd::{BusWidth, CIC, CID, CSD, CardCapacity, CardStatus, CurrentState, OCR, RCA, SCR, SD, SDStatus};
use sdio_host::{common_cmd, emmc_cmd, sd_cmd};
use crate::sdmmc::{
BlockSize, DatapathMode, Error, S... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/sdmmc/mod.rs | embassy-stm32/src/sdmmc/mod.rs | //! Secure Digital / MultiMedia Card (SDMMC)
#![macro_use]
use core::default::Default;
use core::future::poll_fn;
use core::marker::PhantomData;
use core::slice;
use core::task::Poll;
use aligned::{A4, Aligned};
use embassy_hal_internal::{Peri, PeripheralType};
use embassy_sync::waitqueue::AtomicWaker;
use sdio_host:... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/sdmmc/sdio.rs | embassy-stm32/src/sdmmc/sdio.rs | use core::ops::{Deref, DerefMut};
use aligned::{A4, Aligned};
use sdio_host::common_cmd::{R1, Resp, cmd};
use sdio_host::sd::{BusWidth, OCR, RCA, SD};
use sdio_host::{Cmd, sd_cmd};
use crate::sdmmc::{
CommandResponse, DatapathMode, Error, Sdmmc, TypedResp, aligned_mut, aligned_ref, block_size, slice8_mut,
sli... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/qspi/enums.rs | embassy-stm32/src/qspi/enums.rs | //! Enums used in QSPI configuration.
#[allow(dead_code)]
#[derive(Copy, Clone)]
pub(crate) enum QspiMode {
IndirectWrite,
IndirectRead,
AutoPolling,
MemoryMapped,
}
impl From<QspiMode> for u8 {
fn from(val: QspiMode) -> Self {
match val {
QspiMode::IndirectWrite => 0b00,
... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/qspi/mod.rs | embassy-stm32/src/qspi/mod.rs | //! Quad Serial Peripheral Interface (QSPI)
#![macro_use]
pub mod enums;
use core::marker::PhantomData;
use embassy_hal_internal::PeripheralType;
use enums::*;
use crate::dma::ChannelAndRequest;
use crate::gpio::{AfType, AnyPin, OutputType, Pull, Speed};
use crate::mode::{Async, Blocking, Mode as PeriMode};
use cr... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/cryp/mod.rs | embassy-stm32/src/cryp/mod.rs | //! Crypto Accelerator (CRYP)
#[cfg(any(cryp_v2, cryp_v3, cryp_v4))]
use core::cmp::min;
use core::marker::PhantomData;
use embassy_hal_internal::{Peri, PeripheralType};
use embassy_sync::waitqueue::AtomicWaker;
use crate::dma::{ChannelAndRequest, TransferOptions};
use crate::interrupt::typelevel::Interrupt;
use crat... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/hsem/mod.rs | embassy-stm32/src/hsem/mod.rs | //! Hardware Semaphore (HSEM)
use core::future::poll_fn;
use core::marker::PhantomData;
use core::sync::atomic::{Ordering, compiler_fence};
use core::task::Poll;
#[cfg(all(stm32wb, feature = "low-power"))]
use critical_section::CriticalSection;
use embassy_hal_internal::PeripheralType;
use embassy_sync::waitqueue::At... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/input_capture.rs | embassy-stm32/src/timer/input_capture.rs | //! Input capture driver.
use core::future::Future;
use core::marker::PhantomData;
use core::pin::Pin;
use core::task::{Context, Poll};
use super::low_level::{CountingMode, FilterValue, InputCaptureMode, InputTISelection, Timer};
use super::{CaptureCompareInterruptHandler, Channel, GeneralInstance4Channel, TimerPin};... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/pwm_input.rs | embassy-stm32/src/timer/pwm_input.rs | //! PWM Input driver.
use super::low_level::{CountingMode, InputCaptureMode, InputTISelection, SlaveMode, Timer, TriggerSource};
use super::{Ch1, Ch2, Channel, GeneralInstance4Channel, TimerPin};
use crate::Peri;
use crate::gpio::{AfType, Pull};
use crate::time::Hertz;
/// PWM Input driver.
///
/// Only works with CH... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/simple_pwm.rs | embassy-stm32/src/timer/simple_pwm.rs | //! Simple PWM driver.
use core::marker::PhantomData;
use core::mem::ManuallyDrop;
use super::low_level::{CountingMode, OutputCompareMode, OutputPolarity, Timer};
use super::ringbuffered::RingBufferedPwmChannel;
use super::{Ch1, Ch2, Ch3, Ch4, Channel, GeneralInstance4Channel, TimerChannel, TimerPin};
use crate::Peri... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/qei.rs | embassy-stm32/src/timer/qei.rs | //! Quadrature decoder using a timer.
use stm32_metapac::timer::vals::{self, Sms};
use super::low_level::Timer;
pub use super::{Ch1, Ch2};
use super::{GeneralInstance4Channel, TimerPin};
use crate::Peri;
use crate::gpio::{AfType, AnyPin, Pull};
use crate::timer::TimerChannel;
/// Qei driver config.
#[cfg_attr(featur... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/one_pulse.rs | embassy-stm32/src/timer/one_pulse.rs | //! One pulse mode driver.
use core::future::Future;
use core::marker::PhantomData;
use core::mem::ManuallyDrop;
use core::pin::Pin;
use core::task::{Context, Poll};
use super::low_level::{
CountingMode, FilterValue, InputCaptureMode, InputTISelection, SlaveMode, Timer, TriggerSource as Ts,
};
use super::{Capture... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/mod.rs | embassy-stm32/src/timer/mod.rs | //! Timers, PWM, quadrature decoder.
use core::marker::PhantomData;
use embassy_hal_internal::PeripheralType;
use embassy_sync::waitqueue::AtomicWaker;
#[cfg(not(stm32l0))]
pub mod complementary_pwm;
pub mod input_capture;
pub mod low_level;
pub mod one_pulse;
pub mod pwm_input;
pub mod qei;
pub mod ringbuffered;
pu... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/low_level.rs | embassy-stm32/src/timer/low_level.rs | //! Low-level timer driver.
//!
//! This is an unopinionated, very low-level driver for all STM32 timers. It allows direct register
//! manipulation with the `regs_*()` methods, and has utility functions that are thin wrappers
//! over the registers.
//!
//! The available functionality depends on the timer type.
use c... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/complementary_pwm.rs | embassy-stm32/src/timer/complementary_pwm.rs | //! PWM driver with complementary output support.
use core::marker::PhantomData;
use super::low_level::{CountingMode, OutputPolarity, Timer};
use super::simple_pwm::PwmPin;
use super::{AdvancedInstance4Channel, Ch1, Ch2, Ch3, Ch4, Channel, TimerComplementaryPin};
use crate::Peri;
use crate::dma::word::Word;
use crate... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/timer/ringbuffered.rs | embassy-stm32/src/timer/ringbuffered.rs | //! RingBuffered PWM driver.
use core::mem::ManuallyDrop;
use core::task::Waker;
use super::low_level::Timer;
use super::{Channel, GeneralInstance4Channel};
use crate::dma::WritableRingBuffer;
use crate::dma::ringbuffer::Error;
use crate::dma::word::Word;
/// A PWM channel that uses a DMA ring buffer for continuous ... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/cordic/errors.rs | embassy-stm32/src/cordic/errors.rs | use super::{Function, Scale};
/// Error for [Cordic](super::Cordic)
#[derive(Debug)]
pub enum CordicError {
/// Config error
ConfigError(ConfigError),
/// Argument length is incorrect
ArgumentLengthIncorrect,
/// Result buffer length error
ResultLengthNotEnough,
/// Input value is out of ra... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/cordic/enums.rs | embassy-stm32/src/cordic/enums.rs | /// CORDIC function
#[allow(missing_docs)]
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Function {
Cos = 0,
Sin,
Phase,
Modulus,
Arctan,
Cosh,
Sinh,
Arctanh,
Ln,
Sqrt,
}
/// CORDIC precision
#[allow(missing_docs)]
#[derive(Debug, C... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/cordic/utils.rs | embassy-stm32/src/cordic/utils.rs | //! Common math utils
use super::errors::NumberOutOfRange;
macro_rules! floating_fixed_convert {
($f_to_q:ident, $q_to_f:ident, $unsigned_bin_typ:ty, $signed_bin_typ:ty, $float_ty:ty, $offset:literal, $min_positive:literal) => {
/// convert float point to fixed point format
pub fn $f_to_q(value: $f... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/cordic/mod.rs | embassy-stm32/src/cordic/mod.rs | //! coordinate rotation digital computer (CORDIC)
use embassy_hal_internal::drop::OnDrop;
use embassy_hal_internal::{Peri, PeripheralType};
use crate::pac::cordic::vals;
use crate::{dma, peripherals, rcc};
mod enums;
pub use enums::*;
mod errors;
pub use errors::*;
pub mod utils;
/// CORDIC driver
pub struct Cord... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/dac/tsel.rs | embassy-stm32/src/dac/tsel.rs | #![allow(missing_docs)]
/// Trigger selection for STM32F0.
#[cfg(stm32f0)]
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TriggerSel {
Tim6 = 0,
Tim3 = 1,
Tim7 = 2,
Tim15 = 3,
Tim2 = 4,
Exti9 = 6,
Software = 7,
}
/// Trigger sele... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/dac/mod.rs | embassy-stm32/src/dac/mod.rs | //! Digital to Analog Converter (DAC)
#![macro_use]
use core::marker::PhantomData;
use crate::dma::ChannelAndRequest;
use crate::mode::{Async, Blocking, Mode as PeriMode};
#[cfg(any(dac_v3, dac_v4, dac_v5, dac_v6, dac_v7))]
use crate::pac::dac;
use crate::rcc::{self, RccPeripheral};
use crate::{Peri, peripherals};
m... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/usart/buffered.rs | embassy-stm32/src/usart/buffered.rs | use core::future::poll_fn;
use core::marker::PhantomData;
use core::slice;
use core::sync::atomic::{AtomicBool, AtomicU8, AtomicUsize, Ordering};
use core::task::Poll;
use embassy_embedded_hal::SetConfig;
use embassy_hal_internal::Peri;
use embassy_hal_internal::atomic_ring_buffer::RingBuffer;
use embassy_sync::waitqu... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/usart/mod.rs | embassy-stm32/src/usart/mod.rs | //! Universal Synchronous/Asynchronous Receiver Transmitter (USART, UART, LPUART)
#![macro_use]
#![warn(missing_docs)]
use core::future::poll_fn;
use core::marker::PhantomData;
use core::sync::atomic::{AtomicU8, AtomicUsize, Ordering, compiler_fence};
use core::task::Poll;
use embassy_embedded_hal::SetConfig;
use emb... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/usart/ringbuffered.rs | embassy-stm32/src/usart/ringbuffered.rs | use core::future::poll_fn;
use core::mem;
use core::sync::atomic::{Ordering, compiler_fence};
use core::task::Poll;
use embassy_embedded_hal::SetConfig;
use embedded_io_async::ReadReady;
use futures_util::future::{Either, select};
use super::{
Config, ConfigError, Error, Info, State, UartRx, clear_interrupt_flags... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/enums.rs | embassy-stm32/src/can/enums.rs | //! Enums shared between CAN controller types.
/// Bus error
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum BusError {
/// Bit stuffing error - more than 5 equal bits
Stuff,
/// Form error - A fixed format part of a received message has wrong format
Form,
/// The me... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/util.rs | embassy-stm32/src/can/util.rs | //! Utility functions shared between CAN controller types.
use core::num::{NonZeroU8, NonZeroU16};
use crate::can::enums::TimingCalcError;
/// Shared struct to represent bit timings used by calc_can_timings.
#[derive(Clone, Copy, Debug)]
pub struct NominalBitTiming {
/// Value by which the oscillator frequency i... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/mod.rs | embassy-stm32/src/can/mod.rs | //! Controller Area Network (CAN)
#![macro_use]
#[cfg_attr(can_bxcan, path = "bxcan/mod.rs")]
#[cfg_attr(any(can_fdcan_v1, can_fdcan_h7), path = "fdcan.rs")]
mod _version;
pub use _version::*;
mod common;
pub mod enums;
pub mod frame;
pub mod util;
pub use frame::Frame;
| rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/frame.rs | embassy-stm32/src/can/frame.rs | //! Definition for CAN Frames
use bit_field::BitField;
use crate::can::enums::FrameCreateError;
/// Calculate proper timestamp when available.
#[cfg(feature = "time")]
pub type Timestamp = embassy_time::Instant;
/// Raw register timestamp
#[cfg(not(feature = "time"))]
pub type Timestamp = u16;
/// CAN Header, witho... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/common.rs | embassy-stm32/src/can/common.rs | use embassy_sync::channel::{SendDynamicReceiver, SendDynamicSender};
use super::enums::*;
use super::frame::*;
pub(crate) struct ClassicBufferedRxInner {
pub rx_sender: SendDynamicSender<'static, Result<Envelope, BusError>>,
}
pub(crate) struct ClassicBufferedTxInner {
pub tx_receiver: SendDynamicReceiver<'st... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fdcan.rs | embassy-stm32/src/can/fdcan.rs | #[allow(unused_variables)]
use core::future::poll_fn;
use core::marker::PhantomData;
use core::task::Poll;
use embassy_hal_internal::PeripheralType;
use embassy_hal_internal::interrupt::InterruptExt;
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::channel::Channel;
use embassy_sync::w... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/bxcan/registers.rs | embassy-stm32/src/can/bxcan/registers.rs | use core::cmp::Ordering;
use core::convert::Infallible;
pub use embedded_can::{ExtendedId, Id, StandardId};
use stm32_metapac::can::vals::{Lec, Rtr};
use super::{Mailbox, TransmitStatus};
use crate::can::enums::BusError;
use crate::can::frame::{Envelope, Frame, Header};
pub(crate) struct Registers(pub crate::pac::ca... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/bxcan/filter.rs | embassy-stm32/src/can/bxcan/filter.rs | //! Filter bank API.
use core::marker::PhantomData;
use super::{ExtendedId, Fifo, Id, StandardId};
const F32_RTR: u32 = 0b010; // set the RTR bit to match remote frames
const F32_IDE: u32 = 0b100; // set the IDE bit to match extended identifiers
const F16_RTR: u16 = 0b10000;
const F16_IDE: u16 = 0b01000;
/// A 16-b... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/bxcan/mod.rs | embassy-stm32/src/can/bxcan/mod.rs | pub mod filter;
mod registers;
use core::future::poll_fn;
use core::marker::PhantomData;
use core::task::Poll;
use embassy_hal_internal::PeripheralType;
use embassy_hal_internal::interrupt::InterruptExt;
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::channel::Channel;
use embassy_sy... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/config.rs | embassy-stm32/src/can/fd/config.rs | //! Configuration for FDCAN Module
// Note: This file is copied and modified from fdcan crate by Richard Meadows
use core::num::{NonZeroU8, NonZeroU16};
/// Configures the bit timings.
///
/// You can use <http://www.bittiming.can-wiki.info/> to calculate the `btr` parameter. Enter
/// parameters as follows:
///
/// ... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/filter.rs | embassy-stm32/src/can/fd/filter.rs | //! Definition of Filter structs for FDCAN Module
// Note: This file is copied and modified from fdcan crate by Richard Meadows
use embedded_can::{ExtendedId, StandardId};
use crate::can::fd::message_ram;
pub use crate::can::fd::message_ram::{EXTENDED_FILTER_MAX, STANDARD_FILTER_MAX};
/// A Standard Filter
pub type ... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/peripheral.rs | embassy-stm32/src/can/fd/peripheral.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
use core::convert::Infallible;
use core::slice;
use cfg_if::cfg_if;
use crate::can::enums::*;
use crate::can::fd::config::*;
use crate::can::fd::message_ram::enums::*;
use crate::can::fd::message_ram::{RegisterBlock, RxFifoElement, TxBuffe... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/mod.rs | embassy-stm32/src/can/fd/mod.rs | //! Module containing that which is specific to fdcan hardware variant
pub mod config;
pub mod filter;
pub(crate) mod message_ram;
pub(crate) mod peripheral;
| rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/txbuffer_element.rs | embassy-stm32/src/can/fd/message_ram/txbuffer_element.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused)]
use super::common::{BRS_R, DLC_R, ESI_R, FDF_R, ID_R, RTR_R, XTD_R};
use super::enums::{
BitRateSwitching, DataLength, ErrorStateIndicator, Event, EventControl,... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/extended_filter.rs | embassy-stm32/src/can/fd/message_ram/extended_filter.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused)]
use super::common::{ESFEC_R, ESFT_R};
use super::enums::{FilterElementConfig, FilterType};
use super::generic;
#[doc = "Reader of register ExtendedFilter"]
pub(cra... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/txevent_element.rs | embassy-stm32/src/can/fd/message_ram/txevent_element.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused)]
use super::common::{BRS_R, DLC_R, ESI_R, RTR_R, XTD_R};
use super::generic;
#[doc = "Reader of register TxEventElement"]
pub(crate) type R = generic::R<super::TxEv... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/rxfifo_element.rs | embassy-stm32/src/can/fd/message_ram/rxfifo_element.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused)]
use super::common::{BRS_R, DLC_R, ESI_R, FDF_R, ID_R, RTR_R, XTD_R};
use super::enums::{DataLength, FilterFrameMatch, FrameFormat};
use super::generic;
#[doc = "Re... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/enums.rs | embassy-stm32/src/can/fd/message_ram/enums.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
/// Datalength is the message length generalised over
/// the Standard (Classic) and FDCAN message types
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DataLength {
Classic(u8),
Fdcan(u8),
}
impl DataLength {
/// Creates a Da... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/mod.rs | embassy-stm32/src/can/fd/message_ram/mod.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
use volatile_register::RW;
pub(crate) mod common;
pub(crate) mod enums;
pub(crate) mod generic;
/// Number of Receive Fifos configured by this module
pub const RX_FIFOS_MAX: u8 = 2;
/// Number of Receive Messages per RxFifo configured by t... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/standard_filter.rs | embassy-stm32/src/can/fd/message_ram/standard_filter.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused)]
use super::common::{ESFEC_R, ESFT_R};
use super::enums::{FilterElementConfig, FilterType};
use super::generic;
#[doc = "Reader of register StandardFilter"]
pub(cra... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/common.rs | embassy-stm32/src/can/fd/message_ram/common.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused)]
use super::enums::{
BitRateSwitching, ErrorStateIndicator, FilterElementConfig, FilterType, FrameFormat, IdType,
RemoteTransmissionRequest,
};
use super::gen... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/can/fd/message_ram/generic.rs | embassy-stm32/src/can/fd/message_ram/generic.rs | // Note: This file is copied and modified from fdcan crate by Richard Meadows
use core::marker;
///This trait shows that register has `read` method
///
///Registers marked with `Writable` can be also `modify`'ed
pub trait Readable {}
///This trait shows that register has `write`, `write_with_zero` and `reset` method... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/f2.rs | embassy-stm32/src/flash/f2.rs | use core::ptr::write_volatile;
use core::sync::atomic::{AtomicBool, Ordering, fence};
use pac::flash::regs::Sr;
use super::{FlashBank, FlashSector, WRITE_SIZE, get_flash_regions};
use crate::flash::Error;
use crate::pac;
static DATA_CACHE_WAS_ENABLED: AtomicBool = AtomicBool::new(false);
impl FlashSector {
cons... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/eeprom.rs | embassy-stm32/src/flash/eeprom.rs | use embassy_hal_internal::drop::OnDrop;
use super::{Blocking, EEPROM_BASE, EEPROM_SIZE, Error, Flash, family};
#[cfg(eeprom)]
impl<'d> Flash<'d, Blocking> {
// --- Internal helpers ---
/// Checks if the given offset and size are within the EEPROM bounds.
fn check_eeprom_offset(&self, offset: u32, size: u... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/c.rs | embassy-stm32/src/flash/c.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use cortex_m::interrupt;
use super::{FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
pub(crate) unsafe fn lock() {
pac::FLASH.cr().modify(|w| w.set_lock(true));
}
pub(crate) unsafe fn unlock() {
// Wait, while the me... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/f7.rs | embassy-stm32/src/flash/f7.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use super::{FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
impl FlashSector {
const fn snb(&self) -> u8 {
((self.bank as u8) << 4) + self.index_in_bank
}
}
pub(crate) unsafe fn lock() {
pac::FLASH.cr().m... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/asynch.rs | embassy-stm32/src/flash/asynch.rs | use core::marker::PhantomData;
use core::sync::atomic::{Ordering, fence};
use embassy_hal_internal::drop::OnDrop;
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::mutex::Mutex;
use super::{
Async, Error, FLASH_BASE, FLASH_SIZE, Flash, FlashLayout, WRITE_SIZE, blocking_read, ensure... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/h5.rs | embassy-stm32/src/flash/h5.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use super::{FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
pub(crate) unsafe fn lock() {
if !pac::FLASH.nscr().read().lock() {
pac::FLASH.nscr().modify(|r| {
r.set_lock(true);
});
}
}
pub... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/f1f3.rs | embassy-stm32/src/flash/f1f3.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use super::{FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
pub(crate) unsafe fn lock() {
pac::FLASH.cr().modify(|w| w.set_lock(true));
}
pub(crate) unsafe fn unlock() {
if pac::FLASH.cr().read().lock() {
pac... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/mod.rs | embassy-stm32/src/flash/mod.rs | //! Flash memory (FLASH)
use embedded_storage::nor_flash::{NorFlashError, NorFlashErrorKind};
#[cfg(any(flash_f4, flash_h7, flash_h7ab))]
mod asynch;
#[cfg(flash)]
mod common;
#[cfg(eeprom)]
mod eeprom;
#[cfg(any(flash_f4, flash_h7, flash_h7ab))]
pub use asynch::InterruptHandler;
#[cfg(flash)]
pub use common::*;
#[cf... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/other.rs | embassy-stm32/src/flash/other.rs | #![allow(unused)]
use super::{Error, FlashSector, WRITE_SIZE};
pub(crate) unsafe fn lock() {
unimplemented!();
}
pub(crate) unsafe fn unlock() {
unimplemented!();
}
pub(crate) unsafe fn enable_blocking_write() {
unimplemented!();
}
pub(crate) unsafe fn disable_blocking_write() {
unimplemented!();
}
pu... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/common.rs | embassy-stm32/src/flash/common.rs | use core::marker::PhantomData;
use core::sync::atomic::{Ordering, fence};
use embassy_hal_internal::drop::OnDrop;
use super::{
Async, Blocking, Error, FLASH_SIZE, FlashBank, FlashLayout, FlashRegion, FlashSector, MAX_ERASE_SIZE, READ_SIZE,
WRITE_SIZE, family, get_flash_regions,
};
use crate::_generated::FLASH... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/h7.rs | embassy-stm32/src/flash/h7.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use embassy_sync::waitqueue::AtomicWaker;
use pac::flash::regs::Sr;
use super::{BANK1_REGION, FLASH_REGIONS, FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
static WAKER: AtomicWaker = AtomicWaker::new();
pub(crate) unsafe ... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/u0.rs | embassy-stm32/src/flash/u0.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use cortex_m::interrupt;
use super::{FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
pub(crate) unsafe fn lock() {
pac::FLASH.cr().modify(|w| w.set_lock(true));
}
pub(crate) unsafe fn unlock() {
// Wait, while the me... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/f0.rs | embassy-stm32/src/flash/f0.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use super::{FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
pub(crate) unsafe fn lock() {
pac::FLASH.cr().modify(|w| w.set_lock(true));
}
pub(crate) unsafe fn unlock() {
if pac::FLASH.cr().read().lock() {
pac... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/u5.rs | embassy-stm32/src/flash/u5.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use super::{FlashBank, FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
pub(crate) unsafe fn lock() {
#[cfg(feature = "trustzone-secure")]
pac::FLASH.seccr().modify(|w| w.set_lock(true));
#[cfg(not(feature = "trust... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/h50.rs | embassy-stm32/src/flash/h50.rs | /// STM32H50 series flash impl. See RM0492
use core::{
ptr::write_volatile,
sync::atomic::{Ordering, fence},
};
use cortex_m::interrupt;
use pac::flash::regs::Nssr;
use pac::flash::vals::Bksel;
use super::{Error, FlashBank, FlashSector, WRITE_SIZE};
use crate::pac;
pub(crate) unsafe fn lock() {
pac::FLAS... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/f4.rs | embassy-stm32/src/flash/f4.rs | use core::ptr::write_volatile;
use core::sync::atomic::{AtomicBool, Ordering, fence};
use embassy_sync::waitqueue::AtomicWaker;
use pac::flash::regs::Sr;
use super::{FlashBank, FlashSector, WRITE_SIZE, get_flash_regions};
use crate::_generated::FLASH_SIZE;
use crate::flash::Error;
use crate::pac;
static WAKER: Atomi... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/g.rs | embassy-stm32/src/flash/g.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use cortex_m::interrupt;
use super::{FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
pub(crate) unsafe fn lock() {
pac::FLASH.cr().modify(|w| w.set_lock(true));
}
pub(crate) unsafe fn unlock() {
// Wait, while the me... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/flash/l.rs | embassy-stm32/src/flash/l.rs | use core::ptr::write_volatile;
use core::sync::atomic::{Ordering, fence};
use super::{FlashSector, WRITE_SIZE};
use crate::flash::Error;
use crate::pac;
pub(crate) unsafe fn lock() {
#[cfg(any(flash_wl, flash_wb, flash_l4))]
pac::FLASH.cr().modify(|w| w.set_lock(true));
#[cfg(any(flash_l0))]
pac::FLA... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rtc/datetime.rs | embassy-stm32/src/rtc/datetime.rs | #[cfg(feature = "chrono")]
use chrono::{Datelike, NaiveDate, Timelike, Weekday};
/// Errors regarding the [`DateTime`] struct.
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
/// The [DateTime] contains an invalid year value. Must be between `0..=4095`.... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rtc/v2.rs | embassy-stm32/src/rtc/v2.rs | use stm32_metapac::rtc::vals::{Osel, Pol};
use super::SealedInstance;
use crate::pac::rtc::Rtc;
use crate::peripherals::RTC;
#[allow(dead_code)]
impl super::Rtc {
/// Applies the RTC config
/// It this changes the RTC clock source the time will be reset
pub(super) fn configure(&mut self, async_psc: u8, sy... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rtc/low_power.rs | embassy-stm32/src/rtc/low_power.rs | use chrono::{DateTime, NaiveDateTime, TimeDelta, Utc};
use embassy_time::{Duration, Instant, TICK_HZ};
use super::Rtc;
use crate::interrupt::typelevel::Interrupt;
use crate::pac::rtc::vals::Wucksel;
use crate::peripherals::RTC;
use crate::rtc::{RtcTimeProvider, SealedInstance};
fn wucksel_compute_min(val: u32) -> (Wu... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rtc/mod.rs | embassy-stm32/src/rtc/mod.rs | //! Real Time Clock (RTC)
mod datetime;
#[cfg(feature = "low-power")]
mod low_power;
#[cfg(feature = "low-power")]
use core::cell::{RefCell, RefMut};
#[cfg(feature = "low-power")]
use core::ops;
#[cfg(feature = "low-power")]
use critical_section::CriticalSection;
#[cfg(feature = "low-power")]
use embassy_sync::block... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rtc/v3.rs | embassy-stm32/src/rtc/v3.rs | use stm32_metapac::rtc::vals::{Calp, Calw8, Calw16, Fmt, Key, Osel, Pol, TampalrmType};
use super::RtcCalibrationCyclePeriod;
use crate::pac::rtc::Rtc;
use crate::peripherals::RTC;
use crate::rtc::SealedInstance;
impl super::Rtc {
/// Applies the RTC config
/// It this changes the RTC clock source the time wi... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/generic_phy.rs | embassy-stm32/src/eth/generic_phy.rs | //! Generic SMI Ethernet PHY
use core::task::Context;
#[cfg(feature = "time")]
use embassy_time::{Duration, Timer};
#[cfg(feature = "time")]
use futures_util::FutureExt;
use super::{Phy, StationManagement};
use crate::block_for_us as blocking_delay_us;
#[allow(dead_code)]
mod phy_consts {
pub const PHY_REG_BCR:... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/mod.rs | embassy-stm32/src/eth/mod.rs | //! Ethernet (ETH)
#![macro_use]
#[cfg_attr(any(eth_v1a, eth_v1b, eth_v1c), path = "v1/mod.rs")]
#[cfg_attr(eth_v2, path = "v2/mod.rs")]
mod _version;
mod generic_phy;
mod sma;
use core::mem::MaybeUninit;
use core::task::Context;
use embassy_hal_internal::PeripheralType;
use embassy_net_driver::{Capabilities, Hardwa... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/v1/tx_desc.rs | embassy-stm32/src/eth/v1/tx_desc.rs | use core::sync::atomic::{Ordering, compiler_fence, fence};
use vcell::VolatileCell;
use crate::eth::TX_BUFFER_SIZE;
use crate::pac::ETH;
/// Transmit and Receive Descriptor fields
#[allow(dead_code)]
mod tx_consts {
pub const TXDESC_0_OWN: u32 = 1 << 31;
pub const TXDESC_0_IOC: u32 = 1 << 30;
// First se... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/v1/mod.rs | embassy-stm32/src/eth/v1/mod.rs | // The v1c ethernet driver was ported to embassy from the awesome stm32-eth project (https://github.com/stm32-rs/stm32-eth).
mod rx_desc;
mod tx_desc;
use core::sync::atomic::{Ordering, fence};
use embassy_hal_internal::Peri;
use stm32_metapac::eth::vals::{Apcs, Dm, DmaomrSr, Fes, Ftf, Ifg, Pbl, Rsf, St, Tsf};
pub(... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/v1/rx_desc.rs | embassy-stm32/src/eth/v1/rx_desc.rs | use core::sync::atomic::{Ordering, compiler_fence, fence};
use stm32_metapac::eth::vals::{Rpd, Rps};
use vcell::VolatileCell;
use crate::eth::RX_BUFFER_SIZE;
use crate::pac::ETH;
mod rx_consts {
/// Owned by DMA engine
pub const RXDESC_0_OWN: u32 = 1 << 31;
/// First descriptor
pub const RXDESC_0_FS:... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/v2/descriptors.rs | embassy-stm32/src/eth/v2/descriptors.rs | use core::sync::atomic::{Ordering, fence};
use vcell::VolatileCell;
use crate::eth::{Packet, RX_BUFFER_SIZE, TX_BUFFER_SIZE};
use crate::pac::ETH;
/// Transmit and Receive Descriptor fields
#[allow(dead_code)]
mod emac_consts {
pub const EMAC_DES3_OWN: u32 = 0x8000_0000;
pub const EMAC_DES3_CTXT: u32 = 0x400... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/v2/mod.rs | embassy-stm32/src/eth/v2/mod.rs | mod descriptors;
use core::sync::atomic::{Ordering, fence};
use embassy_hal_internal::Peri;
use stm32_metapac::syscfg::vals::EthSelPhy;
pub(crate) use self::descriptors::{RDes, RDesRing, TDes, TDesRing};
use super::*;
use crate::gpio::{AfType, AnyPin, OutputType, SealedPin as _, Speed};
use crate::interrupt;
use cra... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/sma/v2.rs | embassy-stm32/src/eth/sma/v2.rs | use embassy_hal_internal::Peri;
pub(crate) use regs::{Macmdioar as AddressRegister, Macmdiodr as DataRegister};
use stm32_metapac::eth::regs;
use super::{Instance, StationManagement};
use crate::eth::{MDCPin, MDIOPin};
use crate::gpio::{AfType, AnyPin, OutputType, SealedPin, Speed};
/// Station Management Agent.
///
... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/sma/mod.rs | embassy-stm32/src/eth/sma/mod.rs | //! Station Management Agent (also known as MDIO or SMI).
#![macro_use]
#[cfg_attr(eth_v2, path = "v2.rs")]
#[cfg_attr(any(eth_v1a, eth_v1b, eth_v1c), path = "v1.rs")]
mod _version;
use embassy_hal_internal::PeripheralType;
use stm32_metapac::common::{RW, Reg};
pub use self::_version::*;
/// Station Management Int... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/eth/sma/v1.rs | embassy-stm32/src/eth/sma/v1.rs | use embassy_hal_internal::Peri;
pub(crate) use regs::{Macmiiar as AddressRegister, Macmiidr as DataRegister};
use stm32_metapac::eth::regs;
use stm32_metapac::eth::vals::{Cr, MbProgress, Mw};
use super::{Instance, StationManagement};
use crate::eth::{MDCPin, MDIOPin};
use crate::gpio::{AfType, AnyPin, OutputType, Seal... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/wba.rs | embassy-stm32/src/rcc/wba.rs | pub use crate::pac::pwr::vals::Vos as VoltageScale;
use crate::pac::rcc::regs::Cfgr1;
#[cfg(all(peri_usb_otg_hs))]
pub use crate::pac::rcc::vals::Otghssel;
use crate::pac::rcc::vals::Pllrge;
pub use crate::pac::rcc::vals::{
Hdiv5, Hpre as AHBPrescaler, Hpre5 as AHB5Prescaler, Hsepre as HsePrescaler, Plldiv as PllDi... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/bd.rs | embassy-stm32/src/rcc/bd.rs | #[cfg(not(stm32n6))]
use core::sync::atomic::{Ordering, compiler_fence};
#[cfg(not(stm32n6))]
use crate::pac::common::{RW, Reg};
#[cfg(backup_sram)]
use crate::pac::pwr::vals::Retention;
pub use crate::pac::rcc::vals::Rtcsel as RtcClockSource;
use crate::time::Hertz;
#[cfg(any(stm32f0, stm32f1, stm32f3))]
pub const L... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/hsi48.rs | embassy-stm32/src/rcc/hsi48.rs | #![allow(unused)]
use crate::pac::crs::vals::Syncsrc;
use crate::pac::{CRS, RCC};
use crate::rcc::{self, SealedRccPeripheral};
use crate::time::Hertz;
/// HSI48 speed
pub const HSI48_FREQ: Hertz = Hertz(48_000_000);
/// Configuration for the HSI48 clock
#[derive(Clone, Copy, Debug)]
pub struct Hsi48Config {
/// ... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/h.rs | embassy-stm32/src/rcc/h.rs | use core::ops::RangeInclusive;
#[cfg(stm32h7rs)]
use stm32_metapac::rcc::vals::{Plldivst, Xspisel};
use crate::pac;
pub use crate::pac::rcc::vals::{
Hsidiv as HSIPrescaler, Plldiv as PllDiv, Pllm as PllPreDiv, Plln as PllMul, Pllsrc as PllSource, Sw as Sysclk,
};
use crate::pac::rcc::vals::{Pllrge, Pllvcosel, Tim... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | true |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/f013.rs | embassy-stm32/src/rcc/f013.rs | use crate::pac::flash::vals::Latency;
#[cfg(stm32f1)]
pub use crate::pac::rcc::vals::Adcpre as ADCPrescaler;
#[cfg(stm32f3)]
pub use crate::pac::rcc::vals::Adcpres as AdcPllPrescaler;
use crate::pac::rcc::vals::Pllsrc;
#[cfg(all(stm32f1, not(stm32f107)))]
pub use crate::pac::rcc::vals::Pllxtpre as PllPreDiv;
#[cfg(any(... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/g4.rs | embassy-stm32/src/rcc/g4.rs | use crate::pac::flash::vals::Latency;
pub use crate::pac::rcc::vals::{
Hpre as AHBPrescaler, Pllm as PllPreDiv, Plln as PllMul, Pllp as PllPDiv, Pllq as PllQDiv, Pllr as PllRDiv,
Pllsrc as PllSource, Ppre as APBPrescaler, Sw as Sysclk,
};
use crate::pac::{FLASH, PWR, RCC};
use crate::time::Hertz;
/// HSI speed... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/c0.rs | embassy-stm32/src/rcc/c0.rs | use crate::pac::flash::vals::Latency;
pub use crate::pac::rcc::vals::{
Hpre as AHBPrescaler, Hsidiv as HsiSysDiv, Hsikerdiv as HsiKerDiv, Ppre as APBPrescaler, Sw as Sysclk,
};
use crate::pac::{FLASH, RCC};
use crate::rcc::LSI_FREQ;
use crate::time::Hertz;
/// HSI speed
pub const HSI_FREQ: Hertz = Hertz(48_000_000... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/g0.rs | embassy-stm32/src/rcc/g0.rs | use crate::pac::flash::vals::Latency;
pub use crate::pac::pwr::vals::Vos as VoltageRange;
pub use crate::pac::rcc::vals::{
Hpre as AHBPrescaler, Hsidiv as HsiSysDiv, Pllm as PllPreDiv, Plln as PllMul, Pllp as PllPDiv, Pllq as PllQDiv,
Pllr as PllRDiv, Pllsrc as PllSource, Ppre as APBPrescaler, Sw as Sysclk,
};
... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/n6.rs | embassy-stm32/src/rcc/n6.rs | use stm32_metapac::rcc::vals::{
Cpusw, Cpusws, Hseext, Hsitrim, Icint, Icsel, Msifreqsel, Plldivm, Pllmodssdis, Pllpdiv, Pllsel, Syssw, Syssws,
Timpre,
};
pub use stm32_metapac::rcc::vals::{
Hpre as AhbPrescaler, Hsidiv as HsiPrescaler, Hsitrim as HsiCalibration, Ppre as ApbPrescaler,
};
use crate::pac::{P... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/f247.rs | embassy-stm32/src/rcc/f247.rs | use stm32_metapac::flash::vals::Latency;
#[cfg(any(stm32f4, stm32f7))]
use crate::pac::PWR;
#[cfg(any(stm32f413, stm32f423, stm32f412))]
pub use crate::pac::rcc::vals::Plli2ssrc as Plli2sSource;
pub use crate::pac::rcc::vals::{
Hpre as AHBPrescaler, Pllm as PllPreDiv, Plln as PllMul, Pllp as PllPDiv, Pllq as PllQD... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/mod.rs | embassy-stm32/src/rcc/mod.rs | //! Reset and Clock Control (RCC)
#![macro_use]
#![allow(missing_docs)] // TODO
use core::mem::MaybeUninit;
use core::ops;
mod bd;
pub use bd::*;
#[cfg(any(mco, mco1, mco2))]
mod mco;
use critical_section::CriticalSection;
use embassy_hal_internal::{Peri, PeripheralType};
#[cfg(any(mco, mco1, mco2))]
pub use mco::*... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
embassy-rs/embassy | https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-stm32/src/rcc/u3.rs | embassy-stm32/src/rcc/u3.rs | use stm32_metapac::rcc::vals::{Msikdiv, Msisdiv, Msissel};
// pub use crate::pac::pwr::vals::Vosr as VoltageScale;
pub use crate::pac::rcc::vals::{Hpre as AHBPrescaler, Ppre as APBPrescaler, Sw as Sysclk};
use crate::pac::rcc::vals::{Hseext, Msipllsel, Msirgsel};
use crate::pac::{FLASH, PWR, RCC};
use crate::rcc::LSI_... | rust | Apache-2.0 | f242d794e3325bc9b3559e50d2ea7fc293e1d574 | 2026-01-04T15:48:40.485023Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.