starting uart and refactoring

This commit is contained in:
J / Jacob Babich
2022-04-22 03:11:45 -04:00
parent e809e84afc
commit 18e9a5d7de
12 changed files with 436 additions and 228 deletions

View File

@@ -5,19 +5,20 @@ use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch
use cortex_m_rt::entry;
use driver_and_task_library::{
setup_board, Function, Pin, Port, PortOptions, ReadablePinOptions, WritablePinOptions, H, L,
setup_board, Function, GPIOPortOptions, Pin, Port, Pull, ReadablePinOptions,
WritablePinOptions, H, L,
};
#[entry]
fn main() -> ! {
let board = setup_board();
let port_f = board.setup_gpio_port(Port::F, PortOptions);
let port_f = board.setup_gpio_port(Port::F, GPIOPortOptions);
let switches = port_f.setup_readable_pins(
[Pin::Zero, Pin::Four],
ReadablePinOptions {
function: Function::Digital,
pull_up: Some(true),
pull: Pull::Up,
},
);
let [_sw1, _sw2] = switches.pins();