RA Flexible Software Package Documentation
Release v5.6.0
|
|
Interface for Ethernet PHY functions.
The Ethernet PHY module (r_ether_phy) provides an API for standard Ethernet PHY communications applications that use the ETHERC peripheral.
The Ethernet PHY interface supports the following features:
Data Structures | |
struct | ether_phy_cfg_t |
struct | ether_phy_api_t |
struct | ether_phy_instance_t |
Typedefs | |
typedef void | ether_phy_ctrl_t |
Enumerations | |
enum | ether_phy_lsi_type_t |
enum | ether_phy_flow_control_t |
enum | ether_phy_link_speed_t |
enum | ether_phy_mii_type_t |
struct ether_phy_cfg_t |
Configuration parameters.
Data Fields | ||
---|---|---|
uint8_t | channel | Channel. |
uint8_t | phy_lsi_address | Address of PHY-LSI. |
uint32_t | phy_reset_wait_time | Wait time for PHY-LSI reboot. |
int32_t | mii_bit_access_wait_time | Wait time for MII/RMII access. |
ether_phy_lsi_type_t | phy_lsi_type | Phy LSI type. |
ether_phy_flow_control_t | flow_control | Flow control functionally enable or disable. |
ether_phy_mii_type_t | mii_type | Interface type is MII or RMII. |
void const * | p_context |
Placeholder for user data. Passed to the user callback in ether_phy_callback_args_t. |
void const * | p_extend | Placeholder for user extension. |
struct ether_phy_api_t |
Functions implemented at the HAL layer will follow this API.
Data Fields | |
fsp_err_t(* | open )(ether_phy_ctrl_t *const p_ctrl, ether_phy_cfg_t const *const p_cfg) |
fsp_err_t(* | close )(ether_phy_ctrl_t *const p_ctrl) |
fsp_err_t(* | chipInit )(ether_phy_ctrl_t *const p_ctrl, ether_phy_cfg_t const *const p_cfg) |
fsp_err_t(* | read )(ether_phy_ctrl_t *const p_ctrl, uint32_t reg_addr, uint32_t *const p_data) |
fsp_err_t(* | write )(ether_phy_ctrl_t *const p_ctrl, uint32_t reg_addr, uint32_t data) |
fsp_err_t(* | startAutoNegotiate )(ether_phy_ctrl_t *const p_ctrl) |
fsp_err_t(* | linkPartnerAbilityGet )(ether_phy_ctrl_t *const p_ctrl, uint32_t *const p_line_speed_duplex, uint32_t *const p_local_pause, uint32_t *const p_partner_pause) |
fsp_err_t(* | linkStatusGet )(ether_phy_ctrl_t *const p_ctrl) |
fsp_err_t(* ether_phy_api_t::open) (ether_phy_ctrl_t *const p_ctrl, ether_phy_cfg_t const *const p_cfg) |
Open driver.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to pin configuration structure. |
fsp_err_t(* ether_phy_api_t::close) (ether_phy_ctrl_t *const p_ctrl) |
Close driver.
[in] | p_ctrl | Pointer to control structure. |
fsp_err_t(* ether_phy_api_t::chipInit) (ether_phy_ctrl_t *const p_ctrl, ether_phy_cfg_t const *const p_cfg) |
Initialize PHY-LSI.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to pin configuration structure. |
fsp_err_t(* ether_phy_api_t::read) (ether_phy_ctrl_t *const p_ctrl, uint32_t reg_addr, uint32_t *const p_data) |
Read register value of PHY-LSI.
[in] | p_ctrl | Pointer to control structure. |
[in] | reg_addr | Register address. |
[out] | p_data | Pointer to the location to store read data. |
fsp_err_t(* ether_phy_api_t::write) (ether_phy_ctrl_t *const p_ctrl, uint32_t reg_addr, uint32_t data) |
Write data to register of PHY-LSI.
[in] | p_ctrl | Pointer to control structure. |
[in] | reg_addr | Register address. |
[in] | data | Data written to register. |
fsp_err_t(* ether_phy_api_t::startAutoNegotiate) (ether_phy_ctrl_t *const p_ctrl) |
Start auto negotiation.
[in] | p_ctrl | Pointer to control structure. |
fsp_err_t(* ether_phy_api_t::linkPartnerAbilityGet) (ether_phy_ctrl_t *const p_ctrl, uint32_t *const p_line_speed_duplex, uint32_t *const p_local_pause, uint32_t *const p_partner_pause) |
Get the partner ability.
[in] | p_ctrl | Pointer to control structure. |
[out] | p_line_speed_duplex | Pointer to the location of both the line speed and the duplex. |
[out] | p_local_pause | Pointer to the location to store the local pause bits. |
[out] | p_partner_pause | Pointer to the location to store the partner pause bits. |
fsp_err_t(* ether_phy_api_t::linkStatusGet) (ether_phy_ctrl_t *const p_ctrl) |
Get Link status from PHY-LSI interface.
[in] | p_ctrl | Pointer to control structure. |
struct ether_phy_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields | ||
---|---|---|
ether_phy_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
ether_phy_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
ether_phy_api_t const * | p_api | Pointer to the API structure for this instance. |
typedef void ether_phy_ctrl_t |
Control block. Allocate an instance specific control block to pass into the API calls.
enum ether_phy_lsi_type_t |
Phy LSI
Link speed
enum ether_phy_mii_type_t |