#[repr(C)]
pub struct esp_eth_mediator_s { pub phy_reg_read: Option<unsafe extern "C" fn(eth: *mut esp_eth_mediator_t, phy_addr: u32, phy_reg: u32, reg_value: *mut u32) -> esp_err_t>, pub phy_reg_write: Option<unsafe extern "C" fn(eth: *mut esp_eth_mediator_t, phy_addr: u32, phy_reg: u32, reg_value: u32) -> esp_err_t>, pub stack_input: Option<unsafe extern "C" fn(eth: *mut esp_eth_mediator_t, buffer: *mut u8, length: u32) -> esp_err_t>, pub on_state_changed: Option<unsafe extern "C" fn(eth: *mut esp_eth_mediator_t, state: esp_eth_state_t, args: *mut c_void) -> esp_err_t>, }
Expand description

@brief Ethernet mediator

Fields

phy_reg_read: Option<unsafe extern "C" fn(eth: *mut esp_eth_mediator_t, phy_addr: u32, phy_reg: u32, reg_value: *mut u32) -> esp_err_t>

@brief Read PHY register

@param[in] eth: mediator of Ethernet driver @param[in] phy_addr: PHY Chip address (0~31) @param[in] phy_reg: PHY register index code @param[out] reg_value: PHY register value

@return - ESP_OK: read PHY register successfully - ESP_FAIL: read PHY register failed because some error occurred

phy_reg_write: Option<unsafe extern "C" fn(eth: *mut esp_eth_mediator_t, phy_addr: u32, phy_reg: u32, reg_value: u32) -> esp_err_t>

@brief Write PHY register

@param[in] eth: mediator of Ethernet driver @param[in] phy_addr: PHY Chip address (0~31) @param[in] phy_reg: PHY register index code @param[in] reg_value: PHY register value

@return - ESP_OK: write PHY register successfully - ESP_FAIL: write PHY register failed because some error occurred

stack_input: Option<unsafe extern "C" fn(eth: *mut esp_eth_mediator_t, buffer: *mut u8, length: u32) -> esp_err_t>

@brief Deliver packet to upper stack

@param[in] eth: mediator of Ethernet driver @param[in] buffer: packet buffer @param[in] length: length of the packet

@return - ESP_OK: deliver packet to upper stack successfully - ESP_FAIL: deliver packet failed because some error occurred

on_state_changed: Option<unsafe extern "C" fn(eth: *mut esp_eth_mediator_t, state: esp_eth_state_t, args: *mut c_void) -> esp_err_t>

@brief Callback on Ethernet state changed

@param[in] eth: mediator of Ethernet driver @param[in] state: new state @param[in] args: optional argument for the new state

@return - ESP_OK: process the new state successfully - ESP_FAIL: process the new state failed because some error occurred

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.