aboutsummaryrefslogtreecommitdiff
path: root/tests/stm32/src/common.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stm32/src/common.rs')
-rw-r--r--tests/stm32/src/common.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/stm32/src/common.rs b/tests/stm32/src/common.rs
index 07c61956f..4e0231858 100644
--- a/tests/stm32/src/common.rs
+++ b/tests/stm32/src/common.rs
@@ -62,6 +62,8 @@ teleprobe_meta::target!(b"nucleo-stm32f091rc");
62teleprobe_meta::target!(b"nucleo-stm32h503rb"); 62teleprobe_meta::target!(b"nucleo-stm32h503rb");
63#[cfg(feature = "stm32h7s3l8")] 63#[cfg(feature = "stm32h7s3l8")]
64teleprobe_meta::target!(b"nucleo-stm32h7s3l8"); 64teleprobe_meta::target!(b"nucleo-stm32h7s3l8");
65#[cfg(feature = "stm32u083rc")]
66teleprobe_meta::target!(b"nucleo-stm32u083rc");
65 67
66macro_rules! define_peris { 68macro_rules! define_peris {
67 ($($name:ident = $peri:ident,)* $(@irq $irq_name:ident = $irq_code:tt,)*) => { 69 ($($name:ident = $peri:ident,)* $(@irq $irq_name:ident = $irq_code:tt,)*) => {
@@ -258,6 +260,12 @@ define_peris!(
258 SPI = SPI1, SPI_SCK = PA5, SPI_MOSI = PB5, SPI_MISO = PA6, SPI_TX_DMA = GPDMA1_CH0, SPI_RX_DMA = GPDMA1_CH1, 260 SPI = SPI1, SPI_SCK = PA5, SPI_MOSI = PB5, SPI_MISO = PA6, SPI_TX_DMA = GPDMA1_CH0, SPI_RX_DMA = GPDMA1_CH1,
259 @irq UART = {USART1 => embassy_stm32::usart::InterruptHandler<embassy_stm32::peripherals::USART1>;}, 261 @irq UART = {USART1 => embassy_stm32::usart::InterruptHandler<embassy_stm32::peripherals::USART1>;},
260); 262);
263#[cfg(feature = "stm32u083rc")]
264define_peris!(
265 UART = USART1, UART_TX = PA9, UART_RX = PA10, UART_TX_DMA = DMA1_CH1, UART_RX_DMA = DMA1_CH2,
266 SPI = SPI1, SPI_SCK = PA5, SPI_MOSI = PA7, SPI_MISO = PA6, SPI_TX_DMA = DMA1_CH1, SPI_RX_DMA = DMA1_CH2,
267 @irq UART = {USART1 => embassy_stm32::usart::InterruptHandler<embassy_stm32::peripherals::USART1>;},
268);
261 269
262pub fn config() -> Config { 270pub fn config() -> Config {
263 #[allow(unused_mut)] 271 #[allow(unused_mut)]
@@ -673,5 +681,21 @@ pub fn config() -> Config {
673 config.rcc.voltage_scale = VoltageScale::HIGH; 681 config.rcc.voltage_scale = VoltageScale::HIGH;
674 config.rcc.mux.spi1sel = mux::Spi123sel::PLL1_Q; 682 config.rcc.mux.spi1sel = mux::Spi123sel::PLL1_Q;
675 } 683 }
684 #[cfg(any(feature = "stm32u083rc"))]
685 {
686 config.rcc.hsi = true;
687 config.rcc.pll = Some(Pll {
688 source: PllSource::HSI, // 16 MHz
689 prediv: PllPreDiv::DIV1,
690 mul: PllMul::MUL7,
691 divp: None,
692 divq: None,
693 divr: Some(PllRDiv::DIV2), // 56 MHz
694 });
695 config.rcc.sys = Sysclk::PLL1_R;
696 config.rcc.hsi48 = Some(Hsi48Config { sync_from_usb: true }); // needed for USB
697 config.rcc.mux.clk48sel = mux::Clk48sel::HSI48; // USB uses ICLK
698 }
699
676 config 700 config
677} 701}