pub struct SpiEventSource<'d> { /* private fields */ }
Expand description
Source/mechanism to use for getting notifications/events from the emac.
§Availability
Pre version v5.1.4
of esp-idf, only an interrupt pin could be used as source:
- v4.4: https://github.com/espressif/esp-idf/blob/e499576efdb086551abe309a72899302f82077b7/components/esp_eth/include/esp_eth_mac.h#L461-L464
- v5.0: https://github.com/espressif/esp-idf/blob/bcca689866db3dfda47f77670bf8df2a7ec94721/components/esp_eth/include/esp_eth_mac.h#L513-L517
- v5.1.3: https://github.com/espressif/esp-idf/blob/e7771c75bd1dbbfb7b3c5381be7e063b197c9734/components/esp_eth/include/esp_eth_mac.h#L612-L617
- V5.2.0: https://github.com/espressif/esp-idf/blob/11eaf41b37267ad7709c0899c284e3683d2f0b5e/components/esp_eth/include/esp_eth_mac.h#L612-L617
Starting with v5.1.4
, v5.2.1
and >= v5.3
the option of poll_period_ms
became available:
- v5.1.4: https://github.com/espressif/esp-idf/blob/d7b0a45ddbddbac53afb4fc28168f9f9259dbb79/components/esp_eth/include/esp_eth_mac.h#L614-L620
- v5.2.1: https://github.com/espressif/esp-idf/blob/a322e6bdad4b6675d4597fb2722eea2851ba88cb/components/esp_eth/include/esp_eth_mac.h#L614-L620
- v5.3-dev: https://github.com/espressif/esp-idf/blob/ea010f84ef878dda07146244e166930738c1c103/components/esp_eth/include/esp_eth_mac.h#L694-L700
Implementations§
Source§impl<'d> SpiEventSource<'d>
impl<'d> SpiEventSource<'d>
Sourcepub fn polling(interval: Duration) -> Result<Self, TryFromIntError>
pub fn polling(interval: Duration) -> Result<Self, TryFromIntError>
Instead of getting informed by an interrupt pin about updates/changes from the emac, the MCU polls the emac periodically for updates.
In most cases, Self::polling
should be used as it is more efficient.
But this source makes e.g. sense if the interrupt pin of the emac is not connected to the MCU.
Sourcepub fn interrupt(pin: impl Peripheral<P = impl InputPin> + 'd) -> Self
pub fn interrupt(pin: impl Peripheral<P = impl InputPin> + 'd) -> Self
Get status updates/changes from the emac by way of an interrupt pin.
If the interrupt pin is not connected, see Self::polling
for an alternative.
Trait Implementations§
Source§impl<'d> Clone for SpiEventSource<'d>
impl<'d> Clone for SpiEventSource<'d>
Source§fn clone(&self) -> SpiEventSource<'d>
fn clone(&self) -> SpiEventSource<'d>
Returns a copy of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'d> Debug for SpiEventSource<'d>
impl<'d> Debug for SpiEventSource<'d>
Source§impl<'d> PartialEq for SpiEventSource<'d>
impl<'d> PartialEq for SpiEventSource<'d>
impl<'d> Copy for SpiEventSource<'d>
impl<'d> Eq for SpiEventSource<'d>
impl<'d> StructuralPartialEq for SpiEventSource<'d>
Auto Trait Implementations§
impl<'d> Freeze for SpiEventSource<'d>
impl<'d> RefUnwindSafe for SpiEventSource<'d>
impl<'d> Send for SpiEventSource<'d>
impl<'d> Sync for SpiEventSource<'d>
impl<'d> Unpin for SpiEventSource<'d>
impl<'d> !UnwindSafe for SpiEventSource<'d>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut u8)
unsafe fn clone_to_uninit(&self, dst: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)