[−][src]Struct esp_01::Esp8266
Struct for interracting with an esp8266 wifi module over USART
Implementations
impl<Tx, Rx, Timer, Rst> Esp8266<Tx, Rx, Timer, Rst> where
Tx: Write<u8>,
Rx: Read<u8>,
Timer: LongTimer,
Rst: OutputPin,
[src]
Tx: Write<u8>,
Rx: Read<u8>,
Timer: LongTimer,
Rst: OutputPin,
pub fn new(
tx: Tx,
rx: Rx,
timer: Timer,
chip_enable_pin: Rst
) -> Result<Self, Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]
tx: Tx,
rx: Rx,
timer: Timer,
chip_enable_pin: Rst
) -> Result<Self, Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
Sets up the esp8266 struct and configures the device for future use
tx
and rx
are the pins used for serial communication, timer
is
a hardware timer for dealing with things like serial timeout and
chip_enable_pin
is a pin which must be connected to the CHIP_EN pin
of the device
pub fn send_data(
&mut self,
connection_type: ConnectionType,
address: &str,
port: u16,
data: &str
) -> Result<(), TransmissionError<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]
&mut self,
connection_type: ConnectionType,
address: &str,
port: u16,
data: &str
) -> Result<(), TransmissionError<Error<Rx::Error>, Tx::Error, Rst::Error>>
pub fn close_connection(
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
pub fn power_down(
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
Turns off the device by setting chip_enable to 0
pub fn reset(
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
Resets the device by setting chip_enable to 0 and then back to 1
pub fn power_up(
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
Turns the device back on by setting chip_enable to high
pub fn pull_some_current(
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]
&mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
Auto Trait Implementations
impl<Tx, Rx, Timer, Rst> Send for Esp8266<Tx, Rx, Timer, Rst> where
Rst: Send,
Rx: Send,
Timer: Send,
Tx: Send,
Rst: Send,
Rx: Send,
Timer: Send,
Tx: Send,
impl<Tx, Rx, Timer, Rst> Sync for Esp8266<Tx, Rx, Timer, Rst> where
Rst: Sync,
Rx: Sync,
Timer: Sync,
Tx: Sync,
Rst: Sync,
Rx: Sync,
Timer: Sync,
Tx: Sync,
impl<Tx, Rx, Timer, Rst> Unpin for Esp8266<Tx, Rx, Timer, Rst> where
Rst: Unpin,
Rx: Unpin,
Timer: Unpin,
Tx: Unpin,
Rst: Unpin,
Rx: Unpin,
Timer: Unpin,
Tx: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,