Compare commits
2 Commits
cf031b16e1
...
d84f4ba08f
| Author | SHA1 | Date | |
|---|---|---|---|
| d84f4ba08f | |||
| 359617ad67 |
29
src/webee.rs
29
src/webee.rs
@@ -1,24 +1,41 @@
|
||||
use arduino_hal::Usart;
|
||||
use arduino_hal::usart::UsartOps;
|
||||
use arduino_hal::clock::Clock;
|
||||
use arduino_hal::hal::Atmega;
|
||||
use arduino_hal::port;
|
||||
use arduino_hal::port::mode::{Input, Output};
|
||||
// use arduino_hal::port;
|
||||
// use arduino_hal::port::mode::{Input, Output};
|
||||
use arduino_hal::usart::{Usart, UsartOps};
|
||||
use arduino_hal::prelude::*;
|
||||
use avr_device::atmega2560::{USART1, USART2, USART3};
|
||||
|
||||
use embedded_hal::serial::{Read};
|
||||
|
||||
mod vector;
|
||||
|
||||
pub use vector::Vector;
|
||||
|
||||
pub struct Webee<USART, RX, TX> where
|
||||
USART: UsartOps<H, RX, TX>
|
||||
|
||||
pub struct Webee<USART: UsartOps<Atmega, RX, TX>, RX, TX>
|
||||
{
|
||||
webee: Usart<USART, RX, TX>,
|
||||
}
|
||||
|
||||
enum SEND_CMD {}
|
||||
|
||||
impl<USART, RX, TX> Webee<USART, RX, TX> {
|
||||
impl<USART, RX, TX>
|
||||
Webee<
|
||||
USART,
|
||||
port::Pin<Input, RX>,
|
||||
port::Pin<Output, TX>
|
||||
>
|
||||
where
|
||||
USART: UsartOps<Atmega, port::Pin<Input, RX>, port::Pin<Output, TX>>,
|
||||
RX: port::PinOps,
|
||||
TX: port::PinOps
|
||||
{
|
||||
const STOP: u8 = 0xFF;
|
||||
|
||||
pub fn new(device: USART, rx: RX, tx: TX) -> Self {
|
||||
pub fn new(device: USART, rx: port::Pin<Input, RX>, tx: port::Pin<Output, TX>) -> Self {
|
||||
Self {
|
||||
webee: Usart::new(device, rx, tx, 38400.into_baudrate())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user