aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/buffered_uarte.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-07-23 14:00:19 +0200
committerDario Nieuwenhuis <[email protected]>2022-07-23 14:00:19 +0200
commit4901c34d9c4cd326ab9bca02dd099a663da2567f (patch)
tree8225afebb595fb10c1d67148c0d19b7b732853da /embassy-nrf/src/buffered_uarte.rs
parent8a9d2f59af004902d3978a2922843833b98bcce0 (diff)
Rename Unborrowed -> PeripheralRef, Unborrow -> Peripheral
Diffstat (limited to 'embassy-nrf/src/buffered_uarte.rs')
-rw-r--r--embassy-nrf/src/buffered_uarte.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs
index d251ce347..48ffe5c29 100644
--- a/embassy-nrf/src/buffered_uarte.rs
+++ b/embassy-nrf/src/buffered_uarte.rs
@@ -22,7 +22,7 @@ use core::task::Poll;
22use embassy::waitqueue::WakerRegistration; 22use embassy::waitqueue::WakerRegistration;
23use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; 23use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage};
24use embassy_hal_common::ring_buffer::RingBuffer; 24use embassy_hal_common::ring_buffer::RingBuffer;
25use embassy_hal_common::{low_power_wait_until, unborrow}; 25use embassy_hal_common::{into_ref, low_power_wait_until};
26use futures::future::poll_fn; 26use futures::future::poll_fn;
27// Re-export SVD variants to allow user to directly set values 27// Re-export SVD variants to allow user to directly set values
28pub use pac::uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; 28pub use pac::uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity};
@@ -32,7 +32,7 @@ use crate::interrupt::InterruptExt;
32use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; 32use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task};
33use crate::timer::{Frequency, Instance as TimerInstance, Timer}; 33use crate::timer::{Frequency, Instance as TimerInstance, Timer};
34use crate::uarte::{apply_workaround_for_enable_anomaly, Config, Instance as UarteInstance}; 34use crate::uarte::{apply_workaround_for_enable_anomaly, Config, Instance as UarteInstance};
35use crate::{pac, Unborrow}; 35use crate::{pac, Peripheral};
36 36
37#[derive(Copy, Clone, Debug, PartialEq)] 37#[derive(Copy, Clone, Debug, PartialEq)]
38enum RxState { 38enum RxState {
@@ -78,20 +78,20 @@ impl<'d, U: UarteInstance, T: TimerInstance> Unpin for BufferedUarte<'d, U, T> {
78impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { 78impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> {
79 pub fn new( 79 pub fn new(
80 state: &'d mut State<'d, U, T>, 80 state: &'d mut State<'d, U, T>,
81 _uarte: impl Unborrow<Target = U> + 'd, 81 _uarte: impl Peripheral<P = U> + 'd,
82 timer: impl Unborrow<Target = T> + 'd, 82 timer: impl Peripheral<P = T> + 'd,
83 ppi_ch1: impl Unborrow<Target = impl ConfigurableChannel + 'd> + 'd, 83 ppi_ch1: impl Peripheral<P = impl ConfigurableChannel + 'd> + 'd,
84 ppi_ch2: impl Unborrow<Target = impl ConfigurableChannel + 'd> + 'd, 84 ppi_ch2: impl Peripheral<P = impl ConfigurableChannel + 'd> + 'd,
85 irq: impl Unborrow<Target = U::Interrupt> + 'd, 85 irq: impl Peripheral<P = U::Interrupt> + 'd,
86 rxd: impl Unborrow<Target = impl GpioPin> + 'd, 86 rxd: impl Peripheral<P = impl GpioPin> + 'd,
87 txd: impl Unborrow<Target = impl GpioPin> + 'd, 87 txd: impl Peripheral<P = impl GpioPin> + 'd,
88 cts: impl Unborrow<Target = impl GpioPin> + 'd, 88 cts: impl Peripheral<P = impl GpioPin> + 'd,
89 rts: impl Unborrow<Target = impl GpioPin> + 'd, 89 rts: impl Peripheral<P = impl GpioPin> + 'd,
90 config: Config, 90 config: Config,
91 rx_buffer: &'d mut [u8], 91 rx_buffer: &'d mut [u8],
92 tx_buffer: &'d mut [u8], 92 tx_buffer: &'d mut [u8],
93 ) -> Self { 93 ) -> Self {
94 unborrow!(ppi_ch1, ppi_ch2, irq, rxd, txd, cts, rts); 94 into_ref!(ppi_ch1, ppi_ch2, irq, rxd, txd, cts, rts);
95 95
96 let r = U::regs(); 96 let r = U::regs();
97 97