From de5760cc81a00966c61d668c41f6e3e4709f0283 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 14 Oct 2025 13:23:50 +0200 Subject: feat: improve nrf54 support using new nrf-pac * Update nrf-pac to version that modifies nrf52 register layout to match nrf54 to reduce the amount of cfg needed for nrf54 support. * Make the following peripherals available on nrf54: twim, twis, spim, spis, uart, buffered uarte, dppi, gpiote, pwm, saadc * Add examples tested on the nrf54 dk Some code is based on or copied from other pull requests, modified to match the new nrf-pac layout. Co-authored-by: Dmitry Tarnyagin --- tests/nrf/.cargo/config.toml | 4 ++-- tests/nrf/src/bin/buffered_uart_spam.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/nrf/.cargo/config.toml b/tests/nrf/.cargo/config.toml index 8f9bccbc0..0192c10ae 100644 --- a/tests/nrf/.cargo/config.toml +++ b/tests/nrf/.cargo/config.toml @@ -1,6 +1,6 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -#runner = "teleprobe local run --chip nRF52840_xxAA --elf" -runner = "teleprobe client run" +runner = "teleprobe local run --chip nRF52840_xxAA --elf" +#runner = "teleprobe client run" [build] #target = "thumbv6m-none-eabi" diff --git a/tests/nrf/src/bin/buffered_uart_spam.rs b/tests/nrf/src/bin/buffered_uart_spam.rs index 24ddd06f3..6d862e19d 100644 --- a/tests/nrf/src/bin/buffered_uart_spam.rs +++ b/tests/nrf/src/bin/buffered_uart_spam.rs @@ -55,14 +55,14 @@ async fn main(_spawner: Spawner) { static mut TX_BUF: [u8; NSPAM] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let _spam = UarteTx::new(peri!(p, UART1), irqs!(UART1), peri!(p, PIN_A), config.clone()); let spam_peri = pac::UARTE1; - let event = unsafe { Event::new_unchecked(NonNull::new_unchecked(spam_peri.events_endtx().as_ptr())) }; - let task = unsafe { Task::new_unchecked(NonNull::new_unchecked(spam_peri.tasks_starttx().as_ptr())) }; + let event = unsafe { Event::new_unchecked(NonNull::new_unchecked(spam_peri.events_dma().tx().end().as_ptr())) }; + let task = unsafe { Task::new_unchecked(NonNull::new_unchecked(spam_peri.tasks_dma().tx().start().as_ptr())) }; let mut spam_ppi = Ppi::new_one_to_one(p.PPI_CH2, event, task); spam_ppi.enable(); let p = (&raw mut TX_BUF) as *mut u8; - spam_peri.txd().ptr().write_value(p as u32); - spam_peri.txd().maxcnt().write(|w| w.set_maxcnt(NSPAM as _)); - spam_peri.tasks_starttx().write_value(1); + spam_peri.dma().tx().ptr().write_value(p as u32); + spam_peri.dma().tx().maxcnt().write(|w| w.set_maxcnt(NSPAM as _)); + spam_peri.tasks_dma().tx().start().write_value(1); let mut i = 0; let mut total = 0; -- cgit