Struct enc424j600::Enc424j600

source ·
pub struct Enc424j600<SPI: Transfer<u8>, NSS: OutputPin> { /* private fields */ }
Expand description

ENC424J600 controller in SPI mode

Implementations§

source§

impl<SPI: Transfer<u8>, NSS: OutputPin> Enc424j600<SPI, NSS>

source

pub fn new(spi: SPI, nss: NSS) -> Self

source

pub fn init(&mut self, delay: &mut impl DelayUs<u16>) -> Result<(), Error>

source

pub fn reset(&mut self, delay: &mut impl DelayUs<u16>) -> Result<(), Error>

source

pub fn init_rxbuf(&mut self) -> Result<(), Error>

source

pub fn init_txbuf(&mut self) -> Result<(), Error>

source

pub fn set_promiscuous(&mut self) -> Result<(), Error>

Set controller to Promiscuous Mode

source

pub fn read_mac_addr(&mut self, mac: &mut [u8]) -> Result<(), Error>

Read MAC to [u8; 6]

source

pub fn write_mac_addr(&mut self, mac: &[u8]) -> Result<(), Error>

Trait Implementations§

source§

impl<SPI: Transfer<u8>, NSS: OutputPin> EthPhy for Enc424j600<SPI, NSS>

source§

fn recv_packet(&mut self, is_poll: bool) -> Result<RxPacket, Error>

Receive the next packet and return it Set is_poll to true for returning until PKTIF is set; Set is_poll to false for returning Err when PKTIF is not set

source§

fn send_packet(&mut self, packet: &TxPacket) -> Result<(), Error>

Send an established packet

Auto Trait Implementations§

§

impl<SPI, NSS> RefUnwindSafe for Enc424j600<SPI, NSS>where NSS: RefUnwindSafe, SPI: RefUnwindSafe,

§

impl<SPI, NSS> Send for Enc424j600<SPI, NSS>where NSS: Send, SPI: Send,

§

impl<SPI, NSS> Sync for Enc424j600<SPI, NSS>where NSS: Sync, SPI: Sync,

§

impl<SPI, NSS> Unpin for Enc424j600<SPI, NSS>where NSS: Unpin, SPI: Unpin,

§

impl<SPI, NSS> UnwindSafe for Enc424j600<SPI, NSS>where NSS: UnwindSafe, SPI: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.