High level interface for interacting with the Ethernet.
This driver supports initializing and configuring Infineon Ethernet MAC along with third party Ethernet PHY. The driver implements the functions for transmitting and receiveing Ethernet frames over the LAN network.
The following snippet transmits an ethernet frame
The following snippet receives an ethernet frame
The following snippet demonstrates using pause frames for flow control
The following snippet demonstrates filtering packets by MAC address
The following snippet demonstrates setting the 1588 timer value
The following snippet demonstrates getting the 1588 timer value
The following snippet demonstrates writing a low-level PHY register
The following snippet demonstrates reading a low-level PHY register
API Reference | |
Ethernet HAL Results | |
Ethernet specific return codes. | |
Group_hal_ethernet_header | |
Some Ethernet Header types (see IEEE 802.3 for full list) | |
Data Structures | |
struct | cyhal_ethernet_mii_pins_t |
Pins to use for MAC to PHY interface for MII drive mode. More... | |
struct | cyhal_ethernet_rmii_pins_t |
Pins to use for MAC to PHY interface for RMII drive mode. More... | |
struct | cyhal_ethernet_gmii_pins_t |
Pins to use for MAC to PHY interface for GMII drive mode. More... | |
struct | cyhal_ethernet_rgmii_pins_t |
Pins to use for MAC to PHY interface for RGMII drive mode. More... | |
union | cyhal_ethernet_pins_t |
Pin selection according to MAC to PHY drive mode. More... | |
struct | cyhal_ethernet_1588_timer_val_t |
Configuring 1588 TSU (Time Stamp Unit) timer in the MAC as part of IEEE 1588 (Precision Timing Protocol) enablement. More... | |
struct | cyhal_ethernet_config_t |
Ethernet configuration. More... | |
struct | cyhal_ethernet_filter_config_t |
Ethernet MAC filter configuration. More... | |
struct | cyhal_ether_header_t |
Ethernet Header. More... | |
Macros | |
#define | CYHAL_ETHERNET_OBJ_TAG (0xC025520C) |
< cyhal_ethernet_t field 'tag' set to this value when when initialized | |
#define | CYHAL_ETHER_IS_NULL_ADDR(ea) |
Return true for NULL Ethernet address (all 0x00) More... | |
#define | CYHAL_ETHER_IS_UNICAST(ea) ( ( (uint8 *)(ea)[0]) & 0x01) |
Return true for Unicast Ethernet address. | |
#define | CYHAL_ETHER_IS_MULTICAST(ea) ( ( (const uint8 *)(ea) )[0] & 1) |
Return true for Multicast Ethernet address (also returns true for Broadcast address) | |
#define | CYHAL_ETHER_IS_BROADCAST(ea) |
Return true for Broadcast Ethernet Address (all 0xFF) More... | |
#define | CYHAL_ETHER_ADDR_CMP(a, b) |
Compare two Ethernet addresses - assumes the pointers can be referenced as shorts. More... | |
#define | CYHAL_ETHER_ADDR_CPY(s, d) |
Copy an Ethernet address - assumes the pointers can be referenced as shorts. More... | |
Typedefs | |
typedef void(* | cyhal_ethernet_event_callback_t) (void *callback_arg, cyhal_ethernet_event_t event) |
Callback handler for Ethernet events. | |
Enumerations | |
enum | cyhal_ethernet_clk_src_t { CYHAL_ETHERNET_CLK_EXT , CYHAL_ETHERNET_CLK_INT } |
Reference clock input selection for the Ethernet MAC. More... | |
enum | cyhal_ethernet_mac_drive_mode_t { CYHAL_ETHERNET_MII_10 , CYHAL_ETHERNET_MII_100 , CYHAL_ETHERNET_GMII_1000 , CYHAL_ETHERNET_RGMII_10 , CYHAL_ETHERNET_RGMII_100 , CYHAL_ETHERNET_RGMII_1000 , CYHAL_ETHERNET_RMII_10 , CYHAL_ETHERNET_RMII_100 , CYHAL_ETHERNET_MODE_UNKNOWN } |
Ethernet MAC to PHY drive modes. More... | |
enum | cyhal_ethernet_filter_type_t { CYHAL_ETHERNET_FILTER_TYPE_DESTINATION , CYHAL_ETHERNET_FILTER_TYPE_SOURCE } |
Configuration to filter Ethernet packets matching MAC address. More... | |
enum | cyhal_ethernet_event_t { CYHAL_ETHERNET_EVENT_NONE = 0 , CYHAL_ETHERNET_TX_COMPLETE_EVENT = 1 << 1 , CYHAL_ETHERNET_TX_ERR_OCCURED_EVENT = 1 << 2 , CYHAL_ETHERNET_RX_FRAME_EVENT = 1 << 3 , CYHAL_ETHERNET_TSU_SECOND_INC_EVENT = 1 << 4 , CYHAL_ETHERNET_DMA_ERR_OCCURED_EVENT = 1 << 5 } |
Enum for Ethernet events More... | |
Functions | |
cy_rslt_t | cyhal_ethernet_init (cyhal_ethernet_t *obj, const cyhal_ethernet_config_t *eth_config, const cyhal_ethernet_pins_t *eth_pins, const cyhal_clock_t *clk) |
Initialize the Ethernet MAC and PHY. More... | |
void | cyhal_ethernet_free (cyhal_ethernet_t *obj) |
Deinitialize an Ethernet object. More... | |
cy_rslt_t | cyhal_ethernet_init_cfg (cyhal_uart_t *obj, const cyhal_ethernet_configurator_t *cfg) |
Initialize the Ethernet peripheral using a configurator generated configuration struct. More... | |
void | cyhal_ethernet_register_callback (cyhal_ethernet_t *obj, cyhal_ethernet_event_callback_t callback, void *callback_arg) |
Register an Ethernet callback handler. More... | |
void | cyhal_ethernet_enable_event (cyhal_ethernet_t *obj, cyhal_ethernet_event_t event, uint8_t intr_priority, bool enable) |
Configure Ethernet events. More... | |
cy_rslt_t | cyhal_ethernet_transmit_frame (cyhal_ethernet_t *obj, uint8_t *frame_data, uint16_t size) |
Transmits ethernet frame data. More... | |
cy_rslt_t | cyhal_ethernet_read_frame (cyhal_ethernet_t *obj, uint8_t *frame_data, uint16_t *size) |
Read ethernet frame data. More... | |
cy_rslt_t | cyhal_ethernet_get_1588_timer_value (cyhal_ethernet_t *obj, cyhal_ethernet_1588_timer_val_t *timer_val) |
Read IEEE 1588 TSU (Time Stamp Unit) programmed timer value. More... | |
cy_rslt_t | cyhal_ethernet_set_1588_timer_value (cyhal_ethernet_t *obj, const cyhal_ethernet_1588_timer_val_t *timer_val) |
Program IEEE 1588 TSU (Time Stamp Unit) timer programmed. More... | |
cy_rslt_t | cyhal_ethernet_config_pause (cyhal_ethernet_t *obj, const uint16_t pause_quanta) |
A pause frame includes the period of pause time being requested, in the form of a two-byte (16-bit), unsigned integer (0 through 65535). More... | |
cy_rslt_t | cyhal_ethernet_transmit_pause_frame (cyhal_ethernet_t *obj, const bool start_pause) |
Transmit a pause frame. More... | |
uint8_t | cyhal_ethernet_get_num_filter (cyhal_ethernet_t *obj) |
Get the number of MAC filters supported by the device. More... | |
cy_rslt_t | cyhal_ethernet_set_filter_address (cyhal_ethernet_t *obj, const uint8_t filter_num, const cyhal_ethernet_filter_config_t *config) |
Configure a source or destination MAC filter. More... | |
cy_rslt_t | cyhal_ethernet_set_promiscuous_mode (cyhal_ethernet_t *obj, const bool enable_promiscuous) |
Enable or disable receiving Ethernet traffic that would normally be excluded by MAC filters. More... | |
cy_rslt_t | cyhal_ethernet_enable_broadcast_receive (cyhal_ethernet_t *obj, const bool enable_broadcast) |
Enable/disable receiving of broadcast type ethernet frames. More... | |
cy_rslt_t | cyhal_ethernet_phy_reg_write (cyhal_ethernet_t *obj, const uint8_t reg_number, const uint32_t value) |
Write low level PHY register. More... | |
cy_rslt_t | cyhal_ethernet_phy_reg_read (cyhal_ethernet_t *obj, const uint8_t reg_number, uint32_t *value) |
Read low level PHY register, cyhal_ethernet_phy_reg_write() for more details on the register access. More... | |
struct cyhal_ethernet_mii_pins_t |
Data Fields | ||
---|---|---|
cyhal_gpio_t | mdc | MDC (Management Clock) pin. |
cyhal_gpio_t | mdio | MDIO (Management Data) pin bi-direction. |
cyhal_gpio_t | tx_clk | Transmit clock PHY to MAC. |
cyhal_gpio_t | tx_d0 | Transmit data line 0. |
cyhal_gpio_t | tx_d1 | Transmit data line 1. |
cyhal_gpio_t | tx_d2 | Transmit data line 2. |
cyhal_gpio_t | tx_d3 | Transmit data line 3. |
cyhal_gpio_t | tx_en | Transmit enable. |
cyhal_gpio_t | tx_err | Transmit error signal (Option), make it NULL when not used. |
cyhal_gpio_t | rx_clk | Receive clock from PHY to MAC. |
cyhal_gpio_t | rx_d0 | Receive data line 0. |
cyhal_gpio_t | rx_d1 | Receive data line 1. |
cyhal_gpio_t | rx_d2 | Receive data line 2. |
cyhal_gpio_t | rx_d3 | Receive data line 3. |
cyhal_gpio_t | rx_dv | Receive data valid line. |
cyhal_gpio_t | rx_err | Receive error signal. |
cyhal_gpio_t | rx_crs | Receive carrier sense signal. |
cyhal_gpio_t | rx_col | Receive collision detect signal. |
struct cyhal_ethernet_rmii_pins_t |
Data Fields | ||
---|---|---|
cyhal_gpio_t | mdc | MDC (Management Clock) pin. |
cyhal_gpio_t | mdio | MDIO (Management Data) pin bi-direction. |
cyhal_gpio_t | ref_clk | Reference clock signal. |
cyhal_gpio_t | tx_d0 | Transmit data line 0. |
cyhal_gpio_t | tx_d1 | Transmit data line 1. |
cyhal_gpio_t | tx_en | Transmit enable. |
cyhal_gpio_t | rx_d0 | Receive data line 0. |
cyhal_gpio_t | rx_d1 | Receive data line 1. |
cyhal_gpio_t | rx_dv_crs | Receive data valid and carrier sense signal. |
cyhal_gpio_t | rx_err | Receive error signal. |
struct cyhal_ethernet_gmii_pins_t |
Data Fields | ||
---|---|---|
cyhal_gpio_t | mdc | MDC (Management Clock) pin. |
cyhal_gpio_t | mdio | MDIO (Management Data) pin bi-direction. |
cyhal_gpio_t | gtx_clk | Transmit clock. |
cyhal_gpio_t | tx_d0 | Transmit data line 0. |
cyhal_gpio_t | tx_d1 | Transmit data line 1. |
cyhal_gpio_t | tx_d2 | Transmit data line 2. |
cyhal_gpio_t | tx_d3 | Transmit data line 3. |
cyhal_gpio_t | tx_d4 | Transmit data line 4. |
cyhal_gpio_t | tx_d5 | Transmit data line 5. |
cyhal_gpio_t | tx_d6 | Transmit data line 6. |
cyhal_gpio_t | tx_d7 | Transmit data line 7. |
cyhal_gpio_t | tx_en | Transmit enable. |
cyhal_gpio_t | tx_err | Transmit error signal. |
cyhal_gpio_t | rx_clk | Receive clock signal. |
cyhal_gpio_t | rx_d0 | Receive data line 0. |
cyhal_gpio_t | rx_d1 | Receive data line 1. |
cyhal_gpio_t | rx_d2 | Receive data line 2. |
cyhal_gpio_t | rx_d3 | Receive data line 3. |
cyhal_gpio_t | rx_d4 | Receive data line 4. |
cyhal_gpio_t | rx_d5 | Receive data line 5. |
cyhal_gpio_t | rx_d6 | Receive data line 6. |
cyhal_gpio_t | rx_d7 | Receive data line 7. |
cyhal_gpio_t | rx_dv | Receive data valid line. |
cyhal_gpio_t | rx_err | Receive error signal. |
cyhal_gpio_t | rx_crs | Receive carrier sense signal. |
cyhal_gpio_t | rx_col | Receive collision detect signal. |
struct cyhal_ethernet_rgmii_pins_t |
Data Fields | ||
---|---|---|
cyhal_gpio_t | mdc | MDC (Management Clock) pin. |
cyhal_gpio_t | mdio | MDIO (Management Data) pin bi-direction. |
cyhal_gpio_t | gtx_clk | Transmit clock. |
cyhal_gpio_t | tx_d0 | Transmit data line 0. |
cyhal_gpio_t | tx_d1 | Transmit data line 1. |
cyhal_gpio_t | tx_d2 | Transmit data line 2. |
cyhal_gpio_t | tx_d3 | Transmit data line 3. |
cyhal_gpio_t | tx_ctl | Transmit control signal used for both transmit enable and transmit error indication. |
cyhal_gpio_t | rx_clk | Receive clock. |
cyhal_gpio_t | rx_d0 | Receive data line 0. |
cyhal_gpio_t | rx_d1 | Receive data line 1. |
cyhal_gpio_t | rx_d2 | Receive data line 2. |
cyhal_gpio_t | rx_d3 | Receive data line 3. |
cyhal_gpio_t | rx_ctl | Receive control signal used for both receive enable and receive error indication. |
union cyhal_ethernet_pins_t |
Data Fields | ||
---|---|---|
cyhal_ethernet_mii_pins_t | eth_type_mii | Pin information when drive mode is CYHAL_ETHERNET_MII_10 or CYHAL_ETHERNET_MII_100. |
cyhal_ethernet_gmii_pins_t | eth_type_gmii | Pin information when drive mode is CYHAL_ETHERNET_GMII_1000. |
cyhal_ethernet_gmii_pins_t | eth_type_rgmii |
Pin information when drive mode is CYHAL_ETHERNET_RGMII_10 or CYHAL_ETHERNET_RGMII_100 or CYHAL_ETHERNET_RGMII_1000 |
cyhal_ethernet_rmii_pins_t | eth_type_rmii | Pin information when drive mode is CYHAL_ETHERNET_RMII_10 or CYHAL_ETHERNET_RMII_100. |
struct cyhal_ethernet_1588_timer_val_t |
struct cyhal_ethernet_config_t |
Data Fields | ||
---|---|---|
cyhal_ethernet_mac_drive_mode_t | drive_mode | Ethernet drive mode configuration. |
cyhal_ethernet_clk_src_t | clk_source | Ethernet reference clock source. |
uint32_t | ext_clk_freq |
External off chip clock source frequency information in Hz If clk_source is CYHAL_ETHERNET_CLK_EXT, this must be non-zero If clk_source is CYHAL_ETHERNET_CLK_INT, this must be zero. |
struct cyhal_ethernet_filter_config_t |
Data Fields | ||
---|---|---|
cyhal_ethernet_filter_type_t | filter_type | Ethernet MAC filter for source/destination MAC adress. |
uint8_t | mac_addr[6] | Store 6byte Ethernet MAC address. |
uint8_t | ignore_bytes | Ignore number of bytes for in the received packet before comparing (filtering) ignore_bytes = 0x01 implies first byte received should not be compared. |
struct cyhal_ether_header_t |
Data Fields | ||
---|---|---|
uint8_t | preamble[CYHAL_ETHER_PREAMBLE_LEN] | Preamble 0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA, and 0xAB. |
uint8_t | ether_dhost[CYHAL_ETHER_ADDR_LEN] | Destination host ethernet MAC. |
uint8_t | ether_shost[CYHAL_ETHER_ADDR_LEN] | Source host ethernet MAC. |
uint16_t | ether_type | Ethernet Packet Type. |
#define CYHAL_ETHER_IS_NULL_ADDR | ( | ea | ) |
Return true for NULL Ethernet address (all 0x00)
#define CYHAL_ETHER_IS_BROADCAST | ( | ea | ) |
Return true for Broadcast Ethernet Address (all 0xFF)
#define CYHAL_ETHER_ADDR_CMP | ( | a, | |
b | |||
) |
Compare two Ethernet addresses - assumes the pointers can be referenced as shorts.
#define CYHAL_ETHER_ADDR_CPY | ( | s, | |
d | |||
) |
Copy an Ethernet address - assumes the pointers can be referenced as shorts.
Ethernet MAC to PHY drive modes.
Enum for Ethernet events
cy_rslt_t cyhal_ethernet_init | ( | cyhal_ethernet_t * | obj, |
const cyhal_ethernet_config_t * | eth_config, | ||
const cyhal_ethernet_pins_t * | eth_pins, | ||
const cyhal_clock_t * | clk | ||
) |
Initialize the Ethernet MAC and PHY.
It sets the default parameters for Ethernet peripheral, and configures the specifies pins. There multiple drive mode configuration between Ethernet MAC and PHY so the appropriate pin information union member must be populated. The Ethernet MAC can operate either internal clock (PLL) or external clock source via HSIO.
[in,out] | obj | Pointer to an Ethernet object. The caller must allocate the memory for this object but the init function will initialize its contents. |
[in] | eth_config | Initial ethernet block configuration contains information regarding the drive mode, reference clock, and reference clock frequency |
[in] | eth_pins | Pins for MAC to PHY interface. |
[in] | clk | Clock source to use for this instance. If NULL, a dedicated clock divider will be allocated for this instance. If eth_config.clk_source is CYHAL_ETHERNET_CLK_EXT, this must be NULL |
void cyhal_ethernet_free | ( | cyhal_ethernet_t * | obj | ) |
Deinitialize an Ethernet object.
[in] | obj | Pointer to an Ethernet object |
cy_rslt_t cyhal_ethernet_init_cfg | ( | cyhal_uart_t * | obj, |
const cyhal_ethernet_configurator_t * | cfg | ||
) |
Initialize the Ethernet peripheral using a configurator generated configuration struct.
[in] | obj | The Ethernet peripheral to configure |
[in] | cfg | Configuration structure generated by a configurator. |
void cyhal_ethernet_register_callback | ( | cyhal_ethernet_t * | obj, |
cyhal_ethernet_event_callback_t | callback, | ||
void * | callback_arg | ||
) |
Register an Ethernet callback handler.
This function will be called when one of the events enabled by cyhal_ethernet_enable_event occurs.
[in] | obj | Pointer to an Ethernet object |
[in] | callback | The callback handler which will be invoked when the interrupt fires |
[in] | callback_arg | Generic argument that will be provided to the callback when called |
void cyhal_ethernet_enable_event | ( | cyhal_ethernet_t * | obj, |
cyhal_ethernet_event_t | event, | ||
uint8_t | intr_priority, | ||
bool | enable | ||
) |
Configure Ethernet events.
When an enabled event occurs, the function specified by cyhal_ethernet_register_callback will be called.
[in] | obj | Pointer to an Ethernet object |
[in] | event | The Ethernet event type |
[in] | intr_priority | The priority for NVIC interrupt events |
[in] | enable | True to turn on specified events, False to turn off |
cy_rslt_t cyhal_ethernet_transmit_frame | ( | cyhal_ethernet_t * | obj, |
uint8_t * | frame_data, | ||
uint16_t | size | ||
) |
Transmits ethernet frame data.
This functions returns immediately after copying data to MAC internal buffer. Optional step, to monitor actual transmit completion, set callback cyhal_ethernet_register_callback() and event notification cyhal_ethernet_enable_event() CYHAL_ETHERNET_TX_COMPLETE_EVENT . The function return error code CYHAL_ETHERNET_RSLT_TX_FAILED if the MAC internal buffer occupied and busy transmitting.
The frame buffer is a complete Ethernet Header, with the start of the buffer containing the cyhal_ether_header_t structure followed by the data, and room for the CRC (4 bytes) at the end of the buffer. Calculate the buffer size: size = sizeof(cyhal_ether_header_t) + sizeof(uint32_t) + actual data size
Minimum data filled in by Caller: Header:
cyhal_ethernet_transmit_frame() will fill in these parts of the packet: Header:
++++++++++++++++++++++++++++++++++++++++++++ – | Ethernet | | \ | Header | cyhal_ether_header_t | \ +--------—+---------------------------—+ \ | | | — size of frame_data | Data | CYHAL_ETHER_MAX_DATA bytes | / | | | / +--------—+---------------------------—+ / | Footer | 4-byte CRC | / ++++++++++++++++++++++++++++++++++++++++++++ –
[in] | obj | Pointer to an Ethernet object. |
[in] | frame_data | Pointer to ethernet frame data |
[in] | size | Transmit data size in number of bytes (size of frame_data buffer) |
cy_rslt_t cyhal_ethernet_read_frame | ( | cyhal_ethernet_t * | obj, |
uint8_t * | frame_data, | ||
uint16_t * | size | ||
) |
Read ethernet frame data.
This function return 0 for size when there is no data is available for readback.
[in] | obj | Pointer to an Ethernet object. |
[out] | frame_data | Pointer to frame data location |
[in,out] | size | [in] The size of frame_data . [out] Received frame data size in number of bytes |
cy_rslt_t cyhal_ethernet_get_1588_timer_value | ( | cyhal_ethernet_t * | obj, |
cyhal_ethernet_1588_timer_val_t * | timer_val | ||
) |
Read IEEE 1588 TSU (Time Stamp Unit) programmed timer value.
[in] | obj | Pointer to an Ethernet object. |
[out] | timer_val | Pointer to 1588 timer value. |
cy_rslt_t cyhal_ethernet_set_1588_timer_value | ( | cyhal_ethernet_t * | obj, |
const cyhal_ethernet_1588_timer_val_t * | timer_val | ||
) |
Program IEEE 1588 TSU (Time Stamp Unit) timer programmed.
[in] | obj | Pointer to an Ethernet object. |
[in] | timer_val | Pointer to 1588 timer value |
cy_rslt_t cyhal_ethernet_config_pause | ( | cyhal_ethernet_t * | obj, |
const uint16_t | pause_quanta | ||
) |
A pause frame includes the period of pause time being requested, in the form of a two-byte (16-bit), unsigned integer (0 through 65535).
This number is the requested duration of the pause. The pause time is measured in units of pause "quanta", where each unit is equal to 512 bit times. This interface configures the pause frame. To transmit the pause frame once configured, use cyhal_ethernet_transmit_pause_frame.
[in] | obj | Pointer to an Ethernet object. |
[in] | pause_quanta | Pause quanta |
cy_rslt_t cyhal_ethernet_transmit_pause_frame | ( | cyhal_ethernet_t * | obj, |
const bool | start_pause | ||
) |
Transmit a pause frame.
Before it can be used, cyhal_ethernet_config_pause must be called at least once to configure the pause frame.
[in] | obj | Pointer to an Ethernet object. |
[in] | start_pause | Start/stop transmitting pause frames True - The pause frames will be transmitted for pause_quanta defined in cyhal_ethernet_config_pause() False - Pause frame transmission is stopped |
uint8_t cyhal_ethernet_get_num_filter | ( | cyhal_ethernet_t * | obj | ) |
Get the number of MAC filters supported by the device.
[in] | obj | Pointer to an Ethernet object. |
cy_rslt_t cyhal_ethernet_set_filter_address | ( | cyhal_ethernet_t * | obj, |
const uint8_t | filter_num, | ||
const cyhal_ethernet_filter_config_t * | config | ||
) |
Configure a source or destination MAC filter.
[in] | obj | Pointer to an Ethernet object. |
[in] | filter_num | MAC filter number to be configured. This must be less than the value returned by \ref cyhal_ethernet_get_num_filter . If this filter number was previously configured, it will be reconfigured. |
[in] | config | MAC filter configuration. |
cy_rslt_t cyhal_ethernet_set_promiscuous_mode | ( | cyhal_ethernet_t * | obj, |
const bool | enable_promiscuous | ||
) |
Enable or disable receiving Ethernet traffic that would normally be excluded by MAC filters.
[in] | obj | Pointer to an Ethernet object. |
[in] | enable_promiscuous | True (default behavior) - MAC configured to capture all the network traffic False - Ethernet MAC captures the ethernet frames as per the MAC filter setting |
cy_rslt_t cyhal_ethernet_enable_broadcast_receive | ( | cyhal_ethernet_t * | obj, |
const bool | enable_broadcast | ||
) |
Enable/disable receiving of broadcast type ethernet frames.
[in] | obj | Pointer to an Ethernet object. |
[in] | enable_broadcast | True (default behavior) - MAC is configured to capture broadcast type frames. False - MAC will filter broadcast frames; so no broadcast frames passed on to upper layers. |
cy_rslt_t cyhal_ethernet_phy_reg_write | ( | cyhal_ethernet_t * | obj, |
const uint8_t | reg_number, | ||
const uint32_t | value | ||
) |
Write low level PHY register.
This interface is to access Ethernet PHY registers specified in IEEE 802.3 standard. There is basic register set address range 00h - 0Fh and vendor specific address range 10h to 1Fh. For details on the vendor specific registers, see the Ethernet PHY datasheet. Ethernet HAL driver don't perform vendor specific configuration and control hence the interface provided to user level.
[in] | obj | Pointer to an Ethernet object. |
[in] | reg_number | Ethernet PHY register number. |
[in] | value | Value to be written into register. |
cy_rslt_t cyhal_ethernet_phy_reg_read | ( | cyhal_ethernet_t * | obj, |
const uint8_t | reg_number, | ||
uint32_t * | value | ||
) |
Read low level PHY register, cyhal_ethernet_phy_reg_write() for more details on the register access.
[in] | obj | Pointer to an Ethernet object. |
[in] | reg_number | Ethernet PHY register number. |
[out] | value | Value readback from the PHY |