#[repr(C)]
pub struct esp_eth_phy_s {
Show 13 fields pub set_mediator: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, mediator: *mut esp_eth_mediator_t) -> esp_err_t>, pub reset: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>, pub reset_hw: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>, pub init: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>, pub deinit: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>, pub negotiate: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>, pub get_link: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>, pub pwrctl: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, enable: bool) -> esp_err_t>, pub set_addr: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, addr: u32) -> esp_err_t>, pub get_addr: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, addr: *mut u32) -> esp_err_t>, pub advertise_pause_ability: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, ability: u32) -> esp_err_t>, pub loopback: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, enable: bool) -> esp_err_t>, pub del: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>,
}
Expand description

@brief Ethernet PHY

Fields

set_mediator: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, mediator: *mut esp_eth_mediator_t) -> esp_err_t>

@brief Set mediator for PHY

@param[in] phy: Ethernet PHY instance @param[in] mediator: mediator of Ethernet driver

@return - ESP_OK: set mediator for Ethernet PHY instance successfully - ESP_ERR_INVALID_ARG: set mediator for Ethernet PHY instance failed because of some invalid arguments

reset: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>

@brief Software Reset Ethernet PHY

@param[in] phy: Ethernet PHY instance

@return - ESP_OK: reset Ethernet PHY successfully - ESP_FAIL: reset Ethernet PHY failed because some error occurred

reset_hw: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>

@brief Hardware Reset Ethernet PHY

@note Hardware reset is mostly done by pull down and up PHY’s nRST pin

@param[in] phy: Ethernet PHY instance

@return - ESP_OK: reset Ethernet PHY successfully - ESP_FAIL: reset Ethernet PHY failed because some error occurred

init: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>

@brief Initialize Ethernet PHY

@param[in] phy: Ethernet PHY instance

@return - ESP_OK: initialize Ethernet PHY successfully - ESP_FAIL: initialize Ethernet PHY failed because some error occurred

deinit: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>

@brief Deinitialize Ethernet PHY

@param[in] phyL Ethernet PHY instance

@return - ESP_OK: deinitialize Ethernet PHY successfully - ESP_FAIL: deinitialize Ethernet PHY failed because some error occurred

negotiate: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>

@brief Start auto negotiation

@param[in] phy: Ethernet PHY instance

@return - ESP_OK: restart auto negotiation successfully - ESP_FAIL: restart auto negotiation failed because some error occurred

get_link: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>

@brief Get Ethernet PHY link status

@param[in] phy: Ethernet PHY instance

@return - ESP_OK: get Ethernet PHY link status successfully - ESP_FAIL: get Ethernet PHY link status failed because some error occurred

pwrctl: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, enable: bool) -> esp_err_t>

@brief Power control of Ethernet PHY

@param[in] phy: Ethernet PHY instance @param[in] enable: set true to power on Ethernet PHY; ser false to power off Ethernet PHY

@return - ESP_OK: control Ethernet PHY power successfully - ESP_FAIL: control Ethernet PHY power failed because some error occurred

set_addr: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, addr: u32) -> esp_err_t>

@brief Set PHY chip address

@param[in] phy: Ethernet PHY instance @param[in] addr: PHY chip address

@return - ESP_OK: set Ethernet PHY address successfully - ESP_FAIL: set Ethernet PHY address failed because some error occurred

get_addr: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, addr: *mut u32) -> esp_err_t>

@brief Get PHY chip address

@param[in] phy: Ethernet PHY instance @param[out] addr: PHY chip address

@return - ESP_OK: get Ethernet PHY address successfully - ESP_ERR_INVALID_ARG: get Ethernet PHY address failed because of invalid argument

advertise_pause_ability: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, ability: u32) -> esp_err_t>

@brief Advertise pause function supported by MAC layer

@param[in] phy: Ethernet PHY instance @param[out] addr: Pause ability

@return - ESP_OK: Advertise pause ability successfully - ESP_ERR_INVALID_ARG: Advertise pause ability failed because of invalid argument

loopback: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, enable: bool) -> esp_err_t>

@brief

@param[in] phy: Ethernet PHY instance @param[in] enable: enables or disables PHY loopback

@return - ESP_OK: configures PHY instance loopback function successfully - ESP_FAIL: PHY instance loopback configuration failed because some error occurred

del: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>

@brief Free memory of Ethernet PHY instance

@param[in] phy: Ethernet PHY instance

@return - ESP_OK: free PHY instance successfully - ESP_FAIL: free PHY instance 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.