![]() |
CMSIS Driver
Version 1.10 - Preliminary
Middleware Driver API for microcontroller peripherals
|
Driver API for Ethernet PHY Peripheral (Driver_ETH_PHY.h) More...
Data Structures | |
struct | ARM_DRIVER_ETH_PHY |
Access structure of the Ethernet PHY Driver. More... | |
Typedefs | |
typedef ARM_ETH_STATUS(* | ARM_ETH_PHY_Read_t )(uint8_t phy_addr, uint8_t reg_addr, uint16_t *data) |
Pointer to ARM_ETH_MAC_PHY_Read : Read Ethernet PHY Register. | |
typedef ARM_ETH_STATUS(* | ARM_ETH_PHY_Write_t )(uint8_t phy_addr, uint8_t reg_addr, uint16_t data) |
Pointer to ARM_ETH_MAC_PHY_Write : Write Ethernet PHY Register. | |
Functions | |
ARM_DRV_VERSION | ARM_ETH_PHY_GetVersion (void) |
Get driver version. | |
ARM_ETH_STATUS | ARM_ETH_PHY_Initialize (ARM_ETH_PHY_Read_t fn_read, ARM_ETH_PHY_Write_t fn_write) |
Initialize Ethernet PHY Device. | |
ARM_ETH_STATUS | ARM_ETH_PHY_Uninitialize (void) |
De-initialize Ethernet PHY Device. | |
ARM_ETH_STATUS | ARM_ETH_PHY_PowerControl (ARM_POWER_STATE state) |
Control Ethernet PHY Device Power. | |
ARM_ETH_STATUS | ARM_ETH_PHY_SetInterface (ARM_ETH_INTERFACE interface) |
Set Ethernet Media Interface. | |
ARM_ETH_STATUS | ARM_ETH_PHY_SetMode (ARM_ETH_MODE mode) |
Set Ethernet PHY Device Operation mode. | |
ARM_ETH_LINK_STATE | ARM_ETH_PHY_GetLinkState (void) |
Get Ethernet PHY Device Link state. | |
ARM_ETH_LINK_INFO | ARM_ETH_PHY_GetLinkInfo (void) |
Get Ethernet PHY Device Link information. | |
Driver API for Ethernet PHY Peripheral (Driver_ETH_PHY.h)
The following section describes the Ethernet PHY Interface as defined in the Driver_ETH_PHY.h header file.
struct ARM_DRIVER_ETH_PHY |
Access structure of the Ethernet PHY Driver.
The functions of the Ethernet PHY are accessed by function pointers exposed by this structure. Refer to Driver Functions for overview information.
Each instance of an Ethernet PHY provides such an access struct. The instance is identified by a postfix number in the symbol name of the access struct, for example:
A configuration setting in the middleware allows connecting the middleware to a specific driver instance ARM_Driver_ETH_PHYn. The default is 0, which connects a middleware to the first instance of a driver.
Data Fields | |
ARM_DRV_VERSION(* | GetVersion )(void) |
Pointer to ARM_ETH_PHY_GetVersion : Get driver version. | |
ARM_ETH_STATUS(* | Initialize )(ARM_ETH_PHY_Read_t fn_read, ARM_ETH_PHY_Write_t fn_write) |
Pointer to ARM_ETH_PHY_Initialize : Initialize PHY Device. | |
ARM_ETH_STATUS(* | Uninitialize )(void) |
Pointer to ARM_ETH_PHY_Uninitialize : De-initialize PHY Device. | |
ARM_ETH_STATUS(* | PowerControl )(ARM_POWER_STATE state) |
Pointer to ARM_ETH_PHY_PowerControl : Control PHY Device Power. | |
ARM_ETH_STATUS(* | SetInterface )(ARM_ETH_INTERFACE interface) |
Pointer to ARM_ETH_PHY_SetInterface : Set Ethernet Media Interface. | |
ARM_ETH_STATUS(* | SetMode )(ARM_ETH_MODE mode) |
Pointer to ARM_ETH_PHY_SetMode : Set Ethernet PHY Device Operation mode. | |
ARM_ETH_LINK_STATE(* | GetLinkState )(void) |
Pointer to ARM_ETH_PHY_GetLinkState : Get Ethernet PHY Device Link state. | |
ARM_ETH_LINK_INFO(* | GetLinkInfo )(void) |
Pointer to ARM_ETH_PHY_GetLinkInfo : Get Ethernet PHY Device Link information. | |
ARM_ETH_LINK_INFO(* GetLinkInfo)(void) |
Pointer to ARM_ETH_PHY_GetLinkInfo : Get Ethernet PHY Device Link information.
ARM_ETH_LINK_STATE(* GetLinkState)(void) |
Pointer to ARM_ETH_PHY_GetLinkState : Get Ethernet PHY Device Link state.
ARM_DRV_VERSION(* GetVersion)(void) |
Pointer to ARM_ETH_PHY_GetVersion : Get driver version.
ARM_ETH_STATUS(* Initialize)(ARM_ETH_PHY_Read_t fn_read, ARM_ETH_PHY_Write_t fn_write) |
Pointer to ARM_ETH_PHY_Initialize : Initialize PHY Device.
ARM_ETH_STATUS(* PowerControl)(ARM_POWER_STATE state) |
Pointer to ARM_ETH_PHY_PowerControl : Control PHY Device Power.
ARM_ETH_STATUS(* SetInterface)(ARM_ETH_INTERFACE interface) |
Pointer to ARM_ETH_PHY_SetInterface : Set Ethernet Media Interface.
ARM_ETH_STATUS(* SetMode)(ARM_ETH_MODE mode) |
Pointer to ARM_ETH_PHY_SetMode : Set Ethernet PHY Device Operation mode.
ARM_ETH_STATUS(* Uninitialize)(void) |
Pointer to ARM_ETH_PHY_Uninitialize : De-initialize PHY Device.
ARM_ETH_PHY_Read_t |
Pointer to ARM_ETH_MAC_PHY_Read : Read Ethernet PHY Register.
Provides the typedef for the register read function ARM_ETH_MAC_PHY_Read.
Parameter for:
ARM_ETH_PHY_Write_t |
Pointer to ARM_ETH_MAC_PHY_Write : Write Ethernet PHY Register.
Provides the typedef for the register write function ARM_ETH_MAC_PHY_Write.
Parameter for:
ARM_ETH_LINK_INFO ARM_ETH_PHY_GetLinkInfo | ( | void | ) |
Get Ethernet PHY Device Link information.
The function ARM_ETH_PHY_GetLinkInfo retrieves information about the current established communication mode (half/full duplex) and communication speed.
Example:
ARM_ETH_LINK_STATE ARM_ETH_PHY_GetLinkState | ( | void | ) |
Get Ethernet PHY Device Link state.
The function ARM_ETH_PHY_GetLinkState retrieves the connection status of the physical Ethernet link.
Example:
ARM_DRV_VERSION ARM_ETH_PHY_GetVersion | ( | void | ) |
Get driver version.
Returns version information of the driver implementation in ARM_DRV_VERSION
Example:
ARM_ETH_STATUS ARM_ETH_PHY_Initialize | ( | ARM_ETH_PHY_Read_t | fn_read, |
ARM_ETH_PHY_Write_t | fn_write | ||
) |
Initialize Ethernet PHY Device.
[in] | fn_read | Pointer to ARM_ETH_MAC_PHY_Read |
[in] | fn_write | Pointer to ARM_ETH_MAC_PHY_Write |
The function ARM_ETH_PHY_Initialize starts the Ethernet PHY interface. It is called when the middleware component starts operation.
The ARM_ETH_PHY_Initialize function performs the following operations:
Example:
ARM_ETH_STATUS ARM_ETH_PHY_PowerControl | ( | ARM_POWER_STATE | state | ) |
Control Ethernet PHY Device Power.
[in] | state | Power state |
Allows to control the power modes of the Ethernet PHY interface.
state can be:
If state specifies an unsupported mode, the function returns ARM_ETH_ERROR_UNSUPPORTED.
Example:
ARM_ETH_STATUS ARM_ETH_PHY_SetInterface | ( | ARM_ETH_INTERFACE | interface | ) |
Set Ethernet Media Interface.
[in] | interface | ARM_ETH_INTERFACE |
The function ARM_ETH_PHY_SetInterface specifies the Media Independent Interface type that is used by the interface between Ethernet MAC and Ethernet PHY. The Media Independent Interface type is obtained by the function ARM_ETH_MAC_GetCapabilities.
Example:
ARM_ETH_STATUS ARM_ETH_PHY_SetMode | ( | ARM_ETH_MODE | mode | ) |
Set Ethernet PHY Device Operation mode.
[in] | mode | ARM_ETH_MODE |
The function ARM_ETH_PHY_SetMode defines the operation mode of the Ethernet PHY.
Example:
ARM_ETH_STATUS ARM_ETH_PHY_Uninitialize | ( | void | ) |
De-initialize Ethernet PHY Device.
The function ARM_ETH_PHY_Uninitialize de-initializes the resources of Ethernet PHY interface and sets the peripheral to ARM_POWER_OFF power mode.
It is called when the middleware component stops operation and releases the software resources used by the interface.