mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-27 08:18:07 +00:00
correct uarte peripheral
This commit is contained in:
parent
16fbd1c39c
commit
166550667b
1 changed files with 7 additions and 7 deletions
|
@ -13,14 +13,14 @@ use core::{
|
||||||
use cortex_m::asm;
|
use cortex_m::asm;
|
||||||
use embedded_hal::digital::v2::{OutputPin as _, StatefulOutputPin};
|
use embedded_hal::digital::v2::{OutputPin as _, StatefulOutputPin};
|
||||||
use nrf52840_hal as hal;
|
use nrf52840_hal as hal;
|
||||||
pub use hal::pac::{
|
pub use hal::pac::uarte0::{
|
||||||
UARTE1, uarte0::{
|
baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity};
|
||||||
baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}};
|
|
||||||
|
|
||||||
|
|
||||||
use hal::{
|
use hal::{
|
||||||
gpio::{p0, Level, Output, Input, PullUp, Pin, Port, PushPull},
|
gpio::{p0, Level, Output, Input, PullUp, Pin, Port, PushPull},
|
||||||
timer::OneShot, prelude::InputPin,
|
timer::OneShot, prelude::InputPin,
|
||||||
|
uarte,
|
||||||
};
|
};
|
||||||
|
|
||||||
use defmt;
|
use defmt;
|
||||||
|
@ -186,7 +186,7 @@ impl ops::DerefMut for Timer {
|
||||||
|
|
||||||
/// Uarte peripheral
|
/// Uarte peripheral
|
||||||
pub struct Uarte {
|
pub struct Uarte {
|
||||||
inner: hal::Uarte<hal::pac::UARTE0>,
|
inner: hal::Uarte<hal::pac::UARTE1>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Write for Uarte {
|
impl fmt::Write for Uarte {
|
||||||
|
@ -240,7 +240,7 @@ pub fn init() -> Result<Board, ()> {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
let uarte = hal::uarte::Uarte::new(periph.UARTE0, pins, Parity::INCLUDED, Baudrate::BAUD115200);
|
let uarte = hal::uarte::Uarte::new(periph.UARTE1, pins, Parity::INCLUDED, Baudrate::BAUD115200);
|
||||||
// --- Exercise --- 🔼
|
// --- Exercise --- 🔼
|
||||||
|
|
||||||
Ok(Board {
|
Ok(Board {
|
||||||
|
|
Loading…
Reference in a new issue