Struct esp_idf_sys::esp_eth_phy_s

source ·
#[repr(C)]
pub struct esp_eth_phy_s {
Show 17 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 autonego_ctrl: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, cmd: eth_phy_autoneg_cmd_t, autonego_en_stat: *mut bool) -> esp_err_t>, pub get_link: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t) -> esp_err_t>, pub set_link: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, link: eth_link_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 set_speed: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, speed: eth_speed_t) -> esp_err_t>, pub set_duplex: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, duplex: eth_duplex_t) -> esp_err_t>, pub custom_ioctl: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, cmd: u32, data: *mut c_void) -> 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] phy: Ethernet PHY instance

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

§autonego_ctrl: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, cmd: eth_phy_autoneg_cmd_t, autonego_en_stat: *mut bool) -> esp_err_t>

@brief Configure auto negotiation

@param[in] phy: Ethernet PHY instance @param[in] cmd: Configuration command, it is possible to Enable (restart), Disable or get current status of PHY auto negotiation @param[out] autonego_en_stat: Address where to store current status of auto negotiation configuration

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

§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

§set_link: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, link: eth_link_t) -> esp_err_t>

@brief Set Ethernet PHY link status

@param[in] phy: Ethernet PHY instance @param[in] link new link status

@return - ESP_OK: set Ethernet PHY link status successfully - ESP_FAIL: set 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 Sets the PHY to loopback mode

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

@return - ESP_OK: PHY instance loopback mode has been configured successfully - ESP_FAIL: PHY instance loopback configuration failed because some error occurred

§set_speed: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, speed: eth_speed_t) -> esp_err_t>

@brief Sets PHY speed mode

@note Autonegotiation feature needs to be disabled prior to calling this function for the new setting to be applied

@param[in] phy: Ethernet PHY instance @param[in] speed: Speed mode to be set

@return - ESP_OK: PHY instance speed mode has been configured successfully - ESP_FAIL: PHY instance speed mode configuration failed because some error occurred

§set_duplex: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, duplex: eth_duplex_t) -> esp_err_t>

@brief Sets PHY duplex mode

@note Autonegotiation feature needs to be disabled prior to calling this function for the new setting to be applied

@param[in] phy: Ethernet PHY instance @param[in] duplex: Duplex mode to be set

@return - ESP_OK: PHY instance duplex mode has been configured successfully - ESP_FAIL: PHY instance duplex mode configuration failed because some error occurred

§custom_ioctl: Option<unsafe extern "C" fn(phy: *mut esp_eth_phy_t, cmd: u32, data: *mut c_void) -> esp_err_t>

@brief Custom IO function of PHY driver. This function is intended to extend common options of esp_eth_ioctl to cover specifics of PHY chip.

@note This function may not be assigned when the PHY chip supports only most common set of configuration options.

@param[in] phy: Ethernet PHY instance @param[in] cmd: IO control command @param[in, out] data: address of data for set command or address where to store the data when used with get command

@return - ESP_OK: process io command successfully - ESP_ERR_INVALID_ARG: process io command failed because of some invalid argument - ESP_FAIL: process io command failed because some other error occurred - ESP_ERR_NOT_SUPPORTED: requested feature is not supported

§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§

source§

impl Clone for esp_eth_phy_s

source§

fn clone(&self) -> esp_eth_phy_s

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for esp_eth_phy_s

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for esp_eth_phy_s

source§

fn default() -> esp_eth_phy_s

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

impl Copy for esp_eth_phy_s

Auto Trait Implementations§

§

impl Freeze for esp_eth_phy_s

§

impl RefUnwindSafe for esp_eth_phy_s

§

impl Send for esp_eth_phy_s

§

impl Sync for esp_eth_phy_s

§

impl Unpin for esp_eth_phy_s

§

impl UnwindSafe for esp_eth_phy_s

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Copy,

§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.