hc14_at_rs/driver/
mod.rs

1pub use at_commands::parser::CommandParser;
2use core::marker::PhantomData;
3use embedded_hal::{
4    blocking::delay::DelayUs,
5    digital::v2::OutputPin,
6    serial::{Read, Write},
7};
8pub use nb::*;
9
10/// AT配置模式(AT Configuration Mode)
11pub mod configure;
12
13/// 正常模式(Normal Mode)
14pub mod normal;
15
16/// 正常模式标记(Normal Mode Flags)
17#[derive(Debug)]
18pub struct Normal;
19
20/// 配置模式标记(Configuration Mode Flags)
21#[derive(Debug)]
22pub struct Configuration;
23
24/// Hc14 资源:串行端口、输出引脚和延迟。Hc14 Resources: serial ports, output pins, and delays.
25#[derive(Debug, Clone, Copy)]
26pub struct Hc14<S, P, D, M>
27where
28    S: Read<u8> + Write<u8>,
29    P: OutputPin,
30    D: DelayUs<u32>,
31{
32    serial: S,
33    key_pin: P,
34    delay: D,
35    pub(crate) mode: PhantomData<M>,
36}