HPM SDK
HPMicro Software Development Kit
Enet driver APIs

Enet driver APIs. More...

Data Structures

struct  enet_buff_config_t
 enet buffer config struct More...
 
struct  enet_mac_config_t
 enet mac config struct More...
 
struct  enet_tx_desc_t
 transmission descriptor struct More...
 
struct  enet_rx_desc_t
 reception descriptor struct More...
 
struct  enet_frame_t
 enet frame struct More...
 
struct  enet_rx_frame_info_t
 enet reception frame info struct More...
 
struct  enet_tx_control_config_t
 enet control config struct for transmission More...
 
struct  enet_desc_t
 enet description struct More...
 
struct  enet_ptp_ts_system_t
 PTP system timestamp struct. More...
 
struct  enet_ptp_ts_update_t
 PTP update timestamp struct. More...
 
struct  enet_ptp_ts_target_t
 PTP target timestamp struct. More...
 
struct  enet_ptp_config_t
 PTP config strcut. More...
 
struct  enet_pps_cmd_config_t
 PTP PPS command output config strcut. More...
 
struct  enet_ptp_ts_auxi_snapshot_t
 PTP auxiliary timestamp struct. More...
 
struct  enet_ptp_auxi_snapshot_status_t
 PTP auxiliary snapshot status struct. More...
 
struct  enet_int_config_t
 Enet interrupt config struct. More...
 

Macros

#define ENET_HEADER   (14U)
 
#define ENET_VLAN_TAG   (4U)
 
#define ENET_CRC   (4U)
 
#define ENET_MIN_PAYLOAD   (46U)
 
#define ENET_MAX_PAYLOAD   (1500U)
 
#define ENET_MAX_FRAME_SIZE   (1526U)
 
#define ENET_JUMBO_FRAME_PAYLOAD   (9000U)
 
#define ENET_MAC   (6)
 
#define ENET_ERROR   (0)
 
#define ENET_SUCCESS   (1)
 
#define ENET_ADJ_FREQ_BASE_ADDEND   (0x80000000UL)
 
#define ENET_ONE_SEC_IN_NANOSEC   (1000000000UL)
 
#define ENET_PPS_CMD_MASK   (0x07UL)
 
#define ENET_PPS_CMD_OFS_FAC   (3U)
 
#define ENET_RETRY_CNT   (10000UL)
 
#define ENET_RETRY_DMA_INIT_CNT   (10000000UL)
 
#define ENET_MAX_BUFF_SIZE   ((ENET_MAX_FRAME_SIZE + (ENET_SOC_DMA_BUS_WIDTH_IN_BYTES - 1)) & ~(ENET_SOC_DMA_BUS_WIDTH_IN_BYTES - 1))
 
#define ENET_DMATxDesc_TBS2   ((uint32_t)0x1FFF0000)
 
#define ENET_DMATxDesc_TBS1   ((uint32_t)0x00001FFF)
 

Enumerations

enum  enet_interrupt_enable_t { enet_normal_int_sum_en = ENET_DMA_INTR_EN_NIE_MASK , enet_aboarmal_int_sum_en = ENET_DMA_INTR_EN_AIE_MASK , enet_receive_int_en = ENET_DMA_INTR_EN_RIE_MASK , enet_transmit_int_en = ENET_DMA_INTR_EN_TIE_MASK }
 interrupt enable type More...
 
enum  enet_interrupt_mask_t { enet_lpi_int_mask = ENET_INTR_MASK_LPIIM_MASK , enet_rgsmii_int_mask = ENET_INTR_MASK_RGSMIIIM_MASK }
 interrupt mask type More...
 
enum  enet_pbl_t {
  enet_pbl_1 = 1 , enet_pbl_2 = 2 , enet_pbl_4 = 4 , enet_pbl_8 = 8 ,
  enet_pbl_16 = 16 , enet_pbl_32 = 32
}
 Programmable burst length selections. More...
 
enum  enet_cic_insertion_control_t { enet_cic_disable = 0 , enet_cic_ip = 1 , enet_cic_ip_no_pseudoheader = 2 , enet_cic_ip_pseudoheader = 3 }
 Checksum insertion control selections. More...
 
enum  enet_vlan_insertion_control_t { enet_vlic_disable = 0 , enet_vlic_remove_vlan_tag = 1 , enet_vlic_insert_vlan_tag = 2 , enet_vlic_replace_vlan_tag = 3 }
 VLAN insertion control selections. More...
 
enum  enet_saic_insertion_replacement_control_t {
  enet_saic_disable = 0 , enet_saic_insert_mac0 = 1 , enet_saic_replace_mac0 = 2 , enet_saic_insert_mac1 = 5 ,
  enet_saic_replace_mac1 = 6
}
 SA insertion or replacement control selections for any selective frames. More...
 
enum  enet_sarc_insertion_replacement_control_t {
  enet_sarc_disable = 0 , enet_sarc_insert_mac0 = 2 , enet_sarc_replace_mac0 = 3 , enet_sarc_insert_mac1 = 6 ,
  enet_sarc_replace_mac1 = 7
}
 SA insertion or replacement control selections for all transmit frames. More...
 
enum  enet_phy_op_t { enet_phy_op_read = 0 , enet_phy_op_write }
 PHY operation selections. More...
 
enum  enet_gmii_status_t { enet_gmii_idle = 0 , enet_gmii_busy }
 PHY status. More...
 
enum  enet_csr_clk_range_t {
  enet_csr_60m_to_100m_mdc_csr_div_42 = 0 , enet_csr_100m_to_150m_mdc_csr_div_62 , enet_csr_20m_to_35m_mdc_csr_div_16 , enet_csr_35m_to_60m_mdc_csr_div_26 ,
  enet_csr_150m_to_250m_mdc_csr_div_102 , enet_csr_250m_to_300m_mdc_csr_div_124 , enet_csr_60m_to_100m_mdc_csr_div_4 = 8 , enet_csr_60m_to_100m_mdc_csr_div_6 ,
  enet_csr_60m_to_100m_mdc_csr_div_8 , enet_csr_60m_to_100m_mdc_csr_div_10 , enet_csr_60m_to_100m_mdc_csr_div_12 , enet_csr_60m_to_100m_mdc_csr_div_14 ,
  enet_csr_60m_to_100m_mdc_csr_div_16 , enet_csr_60m_to_100m_mdc_csr_div_18
}
 CSR clock range and MDC clock selections. More...
 
enum  enet_inf_type_t { enet_inf_mii = 0 , enet_inf_rmii = 4 , enet_inf_rgmii = 1 }
 enet interface selections More...
 
enum  enet_line_speed_t { enet_line_speed_1000mbps = 0 , enet_line_speed_10mbps = 2 , enet_line_speed_100mbps = 3 }
 enet line speed More...
 
enum  enet_duplex_mode_t { enet_half_duplex = 0 , enet_full_duplex }
 enet duplex mode More...
 
enum  enet_ptp_time_update_method_t { enet_ptp_time_coarse_update = 0 , enet_ptp_time_fine_update }
 enet timestamp update methods More...
 
enum  enet_ptp_version_t { enet_ptp_v1 = 0 , enet_ptp_v2 }
 PTP versions. More...
 
enum  enet_ptp_frame_type_t { enet_ptp_frame_ipv4 = 0 , enet_ptp_frame_ipv6 , enet_ptp_frame_ethernet }
 PTP frame types. More...
 
enum  enet_ts_ss_ptp_msg_t {
  enet_ts_ss_ptp_msg_0 = 0 , enet_ts_ss_ptp_msg_1 = 1 , enet_ts_ss_ptp_msg_2 = 3 , enet_ts_ss_ptp_msg_3 = 4 ,
  enet_ts_ss_ptp_msg_4 = 5 , enet_ts_ss_ptp_msg_5 = 7 , enet_ts_ss_ptp_msg_6 = 8 , enet_ts_ss_ptp_msg_7 = 12
}
 PTP message type for snapshots. More...
 
enum  enet_ts_rollover_control_t { enet_ts_bin_rollover_control = 0 , enet_ts_dig_rollover_control }
 PTP timer rollover modes. More...
 
enum  enet_pps_idx_t { enet_pps_0 = -1 , enet_pps_1 = 0 , enet_pps_2 = 1 , enet_pps_3 = 2 }
 PPS indexes. More...
 
enum  enet_ptp_auxi_snapshot_trigger_idx_t { enet_ptp_auxi_snapshot_trigger_0 = ENET_TS_CTRL_ATSEN0_MASK , enet_ptp_auxi_snapshot_trigger_1 = ENET_TS_CTRL_ATSEN1_MASK , enet_ptp_auxi_snapshot_trigger_2 = ENET_TS_CTRL_ATSEN2_MASK , enet_ptp_auxi_snapshot_trigger_3 = ENET_TS_CTRL_ATSEN3_MASK }
 ptp auxiliary snapshot trigger indexes More...
 
enum  enet_pps_ctrl_t {
  enet_pps_ctrl_pps = 0 , enet_pps_ctrl_bin_2hz_digital_1hz , enet_pps_ctrl_bin_4hz_digital_2hz , enet_pps_ctrl_bin_8hz_digital_4hz ,
  enet_pps_ctrl_bin_16hz_digital_8hz , enet_pps_ctrl_bin_32hz_digital_16hz , enet_pps_ctrl_bin_64hz_digital_32hz , enet_pps_ctrl_bin_128hz_digital_64hz ,
  enet_pps_ctrl_bin_256hz_digital_128hz , enet_pps_ctrl_bin_512hz_digital_256hz , enet_pps_ctrl_bin_1024hz_digital_512hz , enet_pps_ctrl_bin_2048hz_digital_1024hz ,
  enet_pps_ctrl_bin_4096hz_digital_2048hz , enet_pps_ctrl_bin_8192hz_digital_4096hz , enet_pps_ctrl_bin_16384hz_digital_8192hz , enet_pps_ctrl_bin_32768hz_digital_16384hz
}
 PPS0 control for output frequency selections. More...
 
enum  enet_pps_cmd_t {
  enet_pps_cmd_no_command = 0 , enet_pps_cmd_start_single_pulse , enet_pps_cmd_start_pulse_train , enet_pps_cmd_cancel_start ,
  enet_pps_cmd_stop_pulse_train_at_time , enet_pps_cmd_stop_pulse_train_immediately , enet_pps_cmd_cancel_stop_pulse_train
}
 PPS0 commands. More...
 

Functions

void enet_get_default_tx_control_config (ENET_Type *ptr, enet_tx_control_config_t *config)
 Get a default control config for tranmission. More...
 
void enet_get_default_interrupt_config (ENET_Type *ptr, enet_int_config_t *config)
 Get a default interrupt config. More...
 
uint32_t enet_get_interrupt_status (ENET_Type *ptr)
 Get interrupt status. More...
 
void enet_mask_mmc_rx_interrupt_event (ENET_Type *ptr, uint32_t mask)
 Mask the specified mmc interrupt evenets of received frames. More...
 
void enet_mask_mmc_tx_interrupt_event (ENET_Type *ptr, uint32_t mask)
 Mask the specified mmc interrupt evenets of transmitted frames. More...
 
uint32_t enet_get_mmc_rx_interrupt_status (ENET_Type *ptr)
 Get a staus of mmc receive interrupt events. More...
 
uint32_t enet_get_mmc_tx_interrupt_status (ENET_Type *ptr)
 et a staus of mmc transmission interrupt events More...
 
hpm_stat_t enet_controller_init (ENET_Type *ptr, enet_inf_type_t inf_type, enet_desc_t *desc, enet_mac_config_t *cfg, enet_int_config_t *int_config)
 Initialize controller. More...
 
void enet_set_line_speed (ENET_Type *ptr, enet_line_speed_t speed)
 Set port line speed. More...
 
void enet_set_duplex_mode (ENET_Type *ptr, enet_duplex_mode_t mode)
 Set duplex mode. More...
 
uint16_t enet_read_phy (ENET_Type *ptr, uint32_t phy_addr, uint32_t addr)
 Read phy. More...
 
void enet_write_phy (ENET_Type *ptr, uint32_t phy_addr, uint32_t addr, uint32_t data)
 Write phy. More...
 
void enet_rx_resume (ENET_Type *ptr)
 Resume reception process. More...
 
uint32_t enet_check_received_frame (enet_rx_desc_t **parent_rx_desc_list_cur, enet_rx_frame_info_t *rx_frame_info)
 Check if there is a received frame. More...
 
enet_frame_t enet_get_received_frame (enet_rx_desc_t **parent_rx_desc_list_cur, enet_rx_frame_info_t *rx_frame_info)
 get a received frame More...
 
enet_frame_t enet_get_received_frame_interrupt (enet_rx_desc_t **parent_rx_desc_list_cur, enet_rx_frame_info_t *rx_frame_info, uint32_t rx_desc_count)
 get a received frame from interrupt More...
 
uint32_t enet_prepare_transmission_descriptors (ENET_Type *ptr, enet_tx_desc_t **parent_tx_desc_list_cur, uint16_t frame_length, uint16_t tx_buff_size)
 prepare for the transmission descriptors (It will be deprecated.) More...
 
uint32_t enet_prepare_tx_desc (ENET_Type *ptr, enet_tx_desc_t **parent_tx_desc_list_cur, enet_tx_control_config_t *config, uint16_t frame_length, uint16_t tx_buff_size)
 prepare for the transmission descriptors More...
 
uint32_t enet_prepare_tx_desc_with_ts_record (ENET_Type *ptr, enet_tx_desc_t **parent_tx_desc_list_cur, enet_tx_control_config_t *config, uint16_t frame_length, uint16_t tx_buff_size, enet_ptp_ts_system_t *timestamp)
 prepare for the transmission descriptors with a timestamp record More...
 
void enet_dma_tx_desc_chain_init (ENET_Type *ptr, enet_desc_t *desc)
 Initialize DMA transmission descriptors in chain mode. More...
 
void enet_dma_rx_desc_chain_init (ENET_Type *ptr, enet_desc_t *desc)
 Initialize DMA reception descriptors in chain mode. More...
 
void enet_dma_flush (ENET_Type *ptr)
 Flush DMA. More...
 
void enet_init_ptp (ENET_Type *ptr, enet_ptp_config_t *config)
 Initialize a PTP timer. More...
 
void enet_set_ptp_timestamp (ENET_Type *ptr, enet_ptp_ts_update_t *timestamp)
 Set a timestamp to the PTP timer. More...
 
void enet_get_ptp_timestamp (ENET_Type *ptr, enet_ptp_ts_system_t *timestamp)
 Get a timestamp from the PTP timer. More...
 
void enet_update_ptp_timeoffset (ENET_Type *ptr, enet_ptp_ts_update_t *timeoffset)
 Update a timestamp to the PTP timer. More...
 
void enet_adjust_ptp_time_freq (ENET_Type *ptr, int32_t adj)
 Adjust the count frequency of the PTP timer. More...
 
void enet_set_ptp_version (ENET_Type *ptr, enet_ptp_version_t ptp_ver)
 Set the PTP version. More...
 
hpm_stat_t enet_enable_ptp_frame_type (ENET_Type *ptr, enet_ptp_frame_type_t ptp_frame_type, bool enable)
 Enable the specified ptp frame type for MAC process. More...
 
void enet_set_snapshot_ptp_message_type (ENET_Type *ptr, enet_ts_ss_ptp_msg_t ts_ss_ptp_msg)
 Set the ptp message type for snapshots. More...
 
void enet_set_pps0_control_output (ENET_Type *ptr, enet_pps_ctrl_t freq)
 Set the pps0 control output. More...
 
hpm_stat_t enet_set_ppsx_command (ENET_Type *ptr, enet_pps_cmd_t cmd, enet_pps_idx_t idx)
 Set a pps command for ppsx. More...
 
hpm_stat_t enet_set_ppsx_config (ENET_Type *ptr, enet_pps_cmd_config_t *cmd_cfg, enet_pps_idx_t idx)
 Set a pps config for ppsx. More...
 
void enet_mask_interrupt_event (ENET_Type *ptr, uint32_t mask)
 Mask Ethernet interrupt events. More...
 
void enet_unmask_interrupt_event (ENET_Type *ptr, uint32_t mask)
 Unmask ENET interrupt events. More...
 
void enet_enable_ptp_auxiliary_snapshot (ENET_Type *ptr, enet_ptp_auxi_snapshot_trigger_idx_t idx)
 Disable PTP auxiliary snapshot. More...
 
void enet_disable_ptp_auxiliary_snapshot (ENET_Type *ptr, enet_ptp_auxi_snapshot_trigger_idx_t idx)
 Enable PTP auxiliary snapshot. More...
 
void enet_get_ptp_auxi_timestamp (ENET_Type *ptr, enet_ptp_ts_auxi_snapshot_t *timestamp)
 Get PTP auxiliary timestamp. More...
 
void enet_get_ptp_auxi_snapshot_status (ENET_Type *ptr, enet_ptp_auxi_snapshot_status_t *status)
 Get PTP Auxiliary Snapshot Status. More...
 

Detailed Description

Enet driver APIs.

Macro Definition Documentation

◆ ENET_ADJ_FREQ_BASE_ADDEND

#define ENET_ADJ_FREQ_BASE_ADDEND   (0x80000000UL)

#include <drivers/inc/hpm_enet_drv.h>

PTP base adjustment addend

◆ ENET_CRC

#define ENET_CRC   (4U)

#include <drivers/inc/hpm_enet_drv.h>

Ethernet CRC

◆ ENET_DMATxDesc_TBS1

#define ENET_DMATxDesc_TBS1   ((uint32_t)0x00001FFF)

#include <drivers/inc/hpm_enet_drv.h>

Transmit Buffer1 Size

◆ ENET_DMATxDesc_TBS2

#define ENET_DMATxDesc_TBS2   ((uint32_t)0x1FFF0000)

#include <drivers/inc/hpm_enet_drv.h>

Transmit Buffer2 Size

◆ ENET_ERROR

#define ENET_ERROR   (0)

#include <drivers/inc/hpm_enet_drv.h>

ENET error

◆ ENET_HEADER

#define ENET_HEADER   (14U)

#include <drivers/inc/hpm_enet_drv.h>

6-byte Dest addr, 6-byte Src addr, 2-byte type

◆ ENET_JUMBO_FRAME_PAYLOAD

#define ENET_JUMBO_FRAME_PAYLOAD   (9000U)

#include <drivers/inc/hpm_enet_drv.h>

Jumbo frame payload size

◆ ENET_MAC

#define ENET_MAC   (6)

#include <drivers/inc/hpm_enet_drv.h>

Ethernet MAC size

◆ ENET_MAX_BUFF_SIZE

◆ ENET_MAX_FRAME_SIZE

#define ENET_MAX_FRAME_SIZE   (1526U)

#include <drivers/inc/hpm_enet_drv.h>

ENET_HEADER + 2*ENET_VLAN_TAG + ENET_MAX_PAYLOAD + ENET_CRC

◆ ENET_MAX_PAYLOAD

#define ENET_MAX_PAYLOAD   (1500U)

#include <drivers/inc/hpm_enet_drv.h>

Maximum Ethernet payload size

◆ ENET_MIN_PAYLOAD

#define ENET_MIN_PAYLOAD   (46U)

#include <drivers/inc/hpm_enet_drv.h>

Minimum Ethernet payload size

◆ ENET_ONE_SEC_IN_NANOSEC

#define ENET_ONE_SEC_IN_NANOSEC   (1000000000UL)

#include <drivers/inc/hpm_enet_drv.h>

one second in nanoseconds

◆ ENET_PPS_CMD_MASK

#define ENET_PPS_CMD_MASK   (0x07UL)

#include <drivers/inc/hpm_enet_drv.h>

Enet PPS CMD Mask

◆ ENET_PPS_CMD_OFS_FAC

#define ENET_PPS_CMD_OFS_FAC   (3U)

#include <drivers/inc/hpm_enet_drv.h>

Enet PPS CMD OFS Factor

◆ ENET_RETRY_CNT

#define ENET_RETRY_CNT   (10000UL)

#include <drivers/inc/hpm_enet_drv.h>

Enet retry count for PTP

◆ ENET_RETRY_DMA_INIT_CNT

#define ENET_RETRY_DMA_INIT_CNT   (10000000UL)

#include <drivers/inc/hpm_enet_drv.h>

Enet retry count for DMA initialization

◆ ENET_SUCCESS

#define ENET_SUCCESS   (1)

#include <drivers/inc/hpm_enet_drv.h>

ENET success

◆ ENET_VLAN_TAG

#define ENET_VLAN_TAG   (4U)

#include <drivers/inc/hpm_enet_drv.h>

optional 802.1q VLAN Tag

Enumeration Type Documentation

◆ enet_cic_insertion_control_t

#include <drivers/inc/hpm_enet_drv.h>

Checksum insertion control selections.

Enumerator
enet_cic_disable 
enet_cic_ip 
enet_cic_ip_no_pseudoheader 
enet_cic_ip_pseudoheader 

◆ enet_csr_clk_range_t

#include <drivers/inc/hpm_enet_drv.h>

CSR clock range and MDC clock selections.

Note
The suggested range of CSR clock is approximately between the frequency range 1.0MHz-2.5MHz. You can achieve higher frequency of the MDC clock than the frequency limit of 2.5MHz(specified in the IEEE Std 802.3) and program a clock divider of lower value. Program the value which is no less than enet_csr_60m_to_100m_mdc_csr_div_4 only if the interfacing chips support faster MDC clocks.
Enumerator
enet_csr_60m_to_100m_mdc_csr_div_42 

CSR clock range: 60-100MHz <==> MDC clock: CSR clock / 42

enet_csr_100m_to_150m_mdc_csr_div_62 

CSR clock range: 100-150MHz <==> MDC clock: CSR clock / 62

enet_csr_20m_to_35m_mdc_csr_div_16 

CSR clock range: 20-35MHz <==> MDC clock: CSR clock / 16

enet_csr_35m_to_60m_mdc_csr_div_26 

CSR clock range: 35-60MHz <==> MDC clock: CSR clock / 26

enet_csr_150m_to_250m_mdc_csr_div_102 

CSR clock range: 150-250MHz <==> MDC clock: CSR clock / 102

enet_csr_250m_to_300m_mdc_csr_div_124 

CSR clock range: 250-300MHz <==> MDC clock: CSR clock / 124

enet_csr_60m_to_100m_mdc_csr_div_4 

CSR clock / 4

enet_csr_60m_to_100m_mdc_csr_div_6 

CSR clock / 6

enet_csr_60m_to_100m_mdc_csr_div_8 

CSR clock / 8

enet_csr_60m_to_100m_mdc_csr_div_10 

CSR clock / 10

enet_csr_60m_to_100m_mdc_csr_div_12 

CSR clock / 12

enet_csr_60m_to_100m_mdc_csr_div_14 

CSR clock / 14

enet_csr_60m_to_100m_mdc_csr_div_16 

CSR clock / 16

enet_csr_60m_to_100m_mdc_csr_div_18 

CSR clock / 18

◆ enet_duplex_mode_t

#include <drivers/inc/hpm_enet_drv.h>

enet duplex mode

Enumerator
enet_half_duplex 
enet_full_duplex 

◆ enet_gmii_status_t

#include <drivers/inc/hpm_enet_drv.h>

PHY status.

Enumerator
enet_gmii_idle 
enet_gmii_busy 

◆ enet_inf_type_t

#include <drivers/inc/hpm_enet_drv.h>

enet interface selections

Enumerator
enet_inf_mii 
enet_inf_rmii 
enet_inf_rgmii 

◆ enet_interrupt_enable_t

#include <drivers/inc/hpm_enet_drv.h>

interrupt enable type

Enumerator
enet_normal_int_sum_en 
enet_aboarmal_int_sum_en 
enet_receive_int_en 
enet_transmit_int_en 

◆ enet_interrupt_mask_t

#include <drivers/inc/hpm_enet_drv.h>

interrupt mask type

Enumerator
enet_lpi_int_mask 
enet_rgsmii_int_mask 

◆ enet_line_speed_t

#include <drivers/inc/hpm_enet_drv.h>

enet line speed

Enumerator
enet_line_speed_1000mbps 
enet_line_speed_10mbps 
enet_line_speed_100mbps 

◆ enet_pbl_t

enum enet_pbl_t

#include <drivers/inc/hpm_enet_drv.h>

Programmable burst length selections.

Enumerator
enet_pbl_1 
enet_pbl_2 
enet_pbl_4 
enet_pbl_8 
enet_pbl_16 
enet_pbl_32 

◆ enet_phy_op_t

#include <drivers/inc/hpm_enet_drv.h>

PHY operation selections.

Enumerator
enet_phy_op_read 
enet_phy_op_write 

◆ enet_pps_cmd_t

#include <drivers/inc/hpm_enet_drv.h>

PPS0 commands.

Enumerator
enet_pps_cmd_no_command 
enet_pps_cmd_start_single_pulse 
enet_pps_cmd_start_pulse_train 
enet_pps_cmd_cancel_start 
enet_pps_cmd_stop_pulse_train_at_time 
enet_pps_cmd_stop_pulse_train_immediately 
enet_pps_cmd_cancel_stop_pulse_train 

◆ enet_pps_ctrl_t

#include <drivers/inc/hpm_enet_drv.h>

PPS0 control for output frequency selections.

Enumerator
enet_pps_ctrl_pps 
enet_pps_ctrl_bin_2hz_digital_1hz 
enet_pps_ctrl_bin_4hz_digital_2hz 
enet_pps_ctrl_bin_8hz_digital_4hz 
enet_pps_ctrl_bin_16hz_digital_8hz 
enet_pps_ctrl_bin_32hz_digital_16hz 
enet_pps_ctrl_bin_64hz_digital_32hz 
enet_pps_ctrl_bin_128hz_digital_64hz 
enet_pps_ctrl_bin_256hz_digital_128hz 
enet_pps_ctrl_bin_512hz_digital_256hz 
enet_pps_ctrl_bin_1024hz_digital_512hz 
enet_pps_ctrl_bin_2048hz_digital_1024hz 
enet_pps_ctrl_bin_4096hz_digital_2048hz 
enet_pps_ctrl_bin_8192hz_digital_4096hz 
enet_pps_ctrl_bin_16384hz_digital_8192hz 
enet_pps_ctrl_bin_32768hz_digital_16384hz 

◆ enet_pps_idx_t

#include <drivers/inc/hpm_enet_drv.h>

PPS indexes.

Enumerator
enet_pps_0 
enet_pps_1 
enet_pps_2 
enet_pps_3 

◆ enet_ptp_auxi_snapshot_trigger_idx_t

#include <drivers/inc/hpm_enet_drv.h>

ptp auxiliary snapshot trigger indexes

Enumerator
enet_ptp_auxi_snapshot_trigger_0 
enet_ptp_auxi_snapshot_trigger_1 
enet_ptp_auxi_snapshot_trigger_2 
enet_ptp_auxi_snapshot_trigger_3 

◆ enet_ptp_frame_type_t

#include <drivers/inc/hpm_enet_drv.h>

PTP frame types.

Enumerator
enet_ptp_frame_ipv4 
enet_ptp_frame_ipv6 
enet_ptp_frame_ethernet 

◆ enet_ptp_time_update_method_t

#include <drivers/inc/hpm_enet_drv.h>

enet timestamp update methods

Enumerator
enet_ptp_time_coarse_update 
enet_ptp_time_fine_update 

◆ enet_ptp_version_t

#include <drivers/inc/hpm_enet_drv.h>

PTP versions.

Enumerator
enet_ptp_v1 
enet_ptp_v2 

◆ enet_saic_insertion_replacement_control_t

#include <drivers/inc/hpm_enet_drv.h>

SA insertion or replacement control selections for any selective frames.

Enumerator
enet_saic_disable 
enet_saic_insert_mac0 
enet_saic_replace_mac0 
enet_saic_insert_mac1 
enet_saic_replace_mac1 

◆ enet_sarc_insertion_replacement_control_t

#include <drivers/inc/hpm_enet_drv.h>

SA insertion or replacement control selections for all transmit frames.

Enumerator
enet_sarc_disable 
enet_sarc_insert_mac0 
enet_sarc_replace_mac0 
enet_sarc_insert_mac1 
enet_sarc_replace_mac1 

◆ enet_ts_rollover_control_t

#include <drivers/inc/hpm_enet_drv.h>

PTP timer rollover modes.

Enumerator
enet_ts_bin_rollover_control 
enet_ts_dig_rollover_control 

◆ enet_ts_ss_ptp_msg_t

#include <drivers/inc/hpm_enet_drv.h>

PTP message type for snapshots.

Enumerator
enet_ts_ss_ptp_msg_0 
enet_ts_ss_ptp_msg_1 
enet_ts_ss_ptp_msg_2 
enet_ts_ss_ptp_msg_3 
enet_ts_ss_ptp_msg_4 
enet_ts_ss_ptp_msg_5 
enet_ts_ss_ptp_msg_6 
enet_ts_ss_ptp_msg_7 

◆ enet_vlan_insertion_control_t

#include <drivers/inc/hpm_enet_drv.h>

VLAN insertion control selections.

Enumerator
enet_vlic_disable 
enet_vlic_remove_vlan_tag 
enet_vlic_insert_vlan_tag 
enet_vlic_replace_vlan_tag 

Function Documentation

◆ enet_adjust_ptp_time_freq()

void enet_adjust_ptp_time_freq ( ENET_Type ptr,
int32_t  adj 
)

#include <drivers/inc/hpm_enet_drv.h>

Adjust the count frequency of the PTP timer.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]adjAn adjustment value for the count frequency of the PTP timer

◆ enet_check_received_frame()

uint32_t enet_check_received_frame ( enet_rx_desc_t **  parent_rx_desc_list_cur,
enet_rx_frame_info_t rx_frame_info 
)

#include <drivers/inc/hpm_enet_drv.h>

Check if there is a received frame.

Parameters
[out]parent_rx_desc_list_cura parent pointer to the current reception description list
[in]rx_frame_infoA pointer to the information of the reception frames
Return values
Aresult of reception frame. 1 means that a reception of frame is successful. 0 means that a reception of frame is unsuccessful.

◆ enet_controller_init()

hpm_stat_t enet_controller_init ( ENET_Type ptr,
enet_inf_type_t  inf_type,
enet_desc_t desc,
enet_mac_config_t cfg,
enet_int_config_t int_config 
)

#include <drivers/inc/hpm_enet_drv.h>

Initialize controller.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]inf_typethe specified interface
[in]descA pointer to descriptor config
[in]cfgA pointer to mac config
[in]int_configA pointer to the masks of the specified enabled interrupts and the specified masked interrupts
Returns
A result of the specified controller initialization

◆ enet_disable_ptp_auxiliary_snapshot()

void enet_disable_ptp_auxiliary_snapshot ( ENET_Type ptr,
enet_ptp_auxi_snapshot_trigger_idx_t  idx 
)

#include <drivers/inc/hpm_enet_drv.h>

Enable PTP auxiliary snapshot.

Enables the PTP auxiliary snapshot feature for the specified Ethernet controller.

Parameters
ptrPointer to the Ethernet controller instance
idxPTP auxiliary snapshot trigger index
Returns
None

◆ enet_dma_flush()

void enet_dma_flush ( ENET_Type ptr)

#include <drivers/inc/hpm_enet_drv.h>

Flush DMA.

Parameters
[in]ptrAn Ethernet peripheral base address

◆ enet_dma_rx_desc_chain_init()

void enet_dma_rx_desc_chain_init ( ENET_Type ptr,
enet_desc_t desc 
)

#include <drivers/inc/hpm_enet_drv.h>

Initialize DMA reception descriptors in chain mode.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]descA pointer to reception descriptors

◆ enet_dma_tx_desc_chain_init()

void enet_dma_tx_desc_chain_init ( ENET_Type ptr,
enet_desc_t desc 
)

#include <drivers/inc/hpm_enet_drv.h>

Initialize DMA transmission descriptors in chain mode.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]descA pointer to transmission descriptors

◆ enet_enable_ptp_auxiliary_snapshot()

void enet_enable_ptp_auxiliary_snapshot ( ENET_Type ptr,
enet_ptp_auxi_snapshot_trigger_idx_t  idx 
)

#include <drivers/inc/hpm_enet_drv.h>

Disable PTP auxiliary snapshot.

Disables the PTP auxiliary snapshot feature for the specified Ethernet controller.

Parameters
ptrPointer to the Ethernet controller instance
idxPTP auxiliary snapshot trigger index
Returns
None

◆ enet_enable_ptp_frame_type()

hpm_stat_t enet_enable_ptp_frame_type ( ENET_Type ptr,
enet_ptp_frame_type_t  ptp_frame_type,
bool  enable 
)

#include <drivers/inc/hpm_enet_drv.h>

Enable the specified ptp frame type for MAC process.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]ptp_frame_typeAn enum value indicating the transport protocol of PTP frames
[in]enableA value to enable or disable the transport protocol of PTP frames which is specified by ptp_frame_type parameter
Return values
hpm_stat_tstatus_invalid_argument or status_success

◆ enet_get_default_interrupt_config()

void enet_get_default_interrupt_config ( ENET_Type ptr,
enet_int_config_t config 
)

#include <drivers/inc/hpm_enet_drv.h>

Get a default interrupt config.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]configA pointer to a interrupt config structure

◆ enet_get_default_tx_control_config()

void enet_get_default_tx_control_config ( ENET_Type ptr,
enet_tx_control_config_t config 
)

#include <drivers/inc/hpm_enet_drv.h>

Get a default control config for tranmission.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]configA pointer to a control config structure for tranmission

◆ enet_get_interrupt_status()

uint32_t enet_get_interrupt_status ( ENET_Type ptr)

#include <drivers/inc/hpm_enet_drv.h>

Get interrupt status.

Parameters
[in]ptrAn Ethernet peripheral base address
Returns
A result of interrupt status

◆ enet_get_mmc_rx_interrupt_status()

uint32_t enet_get_mmc_rx_interrupt_status ( ENET_Type ptr)

#include <drivers/inc/hpm_enet_drv.h>

Get a staus of mmc receive interrupt events.

Parameters
[in]ptrAn Ethernet peripheral base address
Returns
A result of interrupt status

◆ enet_get_mmc_tx_interrupt_status()

uint32_t enet_get_mmc_tx_interrupt_status ( ENET_Type ptr)

#include <drivers/inc/hpm_enet_drv.h>

et a staus of mmc transmission interrupt events

Parameters
[in]ptrAn Ethernet peripheral base address
Returns
A result of interrupt status

◆ enet_get_ptp_auxi_snapshot_status()

void enet_get_ptp_auxi_snapshot_status ( ENET_Type ptr,
enet_ptp_auxi_snapshot_status_t status 
)

#include <drivers/inc/hpm_enet_drv.h>

Get PTP Auxiliary Snapshot Status.

Retrieves the PTP Auxiliary snapshot status from the ENET structure and stores it in the provided status structure.

Parameters
ptrPointer to ENET structure
statusPointer to status structure

A pointer to the status structure where the PTP Auxiliary snapshot status information will be stored.

◆ enet_get_ptp_auxi_timestamp()

void enet_get_ptp_auxi_timestamp ( ENET_Type ptr,
enet_ptp_ts_auxi_snapshot_t timestamp 
)

#include <drivers/inc/hpm_enet_drv.h>

Get PTP auxiliary timestamp.

Retrieves the PTP (Precision Time Protocol) auxiliary timestamp from the given ENET type pointer and saves it to the provided timestamp structure.

Parameters
ptrPointer to the ENET_Type structure
timestampPointer to the enet_ptp_ts_auxi_snapshot_t structure to store the timestamp

◆ enet_get_ptp_timestamp()

void enet_get_ptp_timestamp ( ENET_Type ptr,
enet_ptp_ts_system_t timestamp 
)

#include <drivers/inc/hpm_enet_drv.h>

Get a timestamp from the PTP timer.

Parameters
[in]ptrAn Ethernet peripheral base address
[out]timestampA pointer to a system timestamp structure instance

◆ enet_get_received_frame()

enet_frame_t enet_get_received_frame ( enet_rx_desc_t **  parent_rx_desc_list_cur,
enet_rx_frame_info_t rx_frame_info 
)

#include <drivers/inc/hpm_enet_drv.h>

get a received frame

Parameters
[out]parent_rx_desc_list_curA parent pointer to the current reception description list
[in]rx_frame_infoA pointer to the information of the reception frames
Return values
Astruct of the current reception frame

◆ enet_get_received_frame_interrupt()

enet_frame_t enet_get_received_frame_interrupt ( enet_rx_desc_t **  parent_rx_desc_list_cur,
enet_rx_frame_info_t rx_frame_info,
uint32_t  rx_desc_count 
)

#include <drivers/inc/hpm_enet_drv.h>

get a received frame from interrupt

Parameters
[out]parent_rx_desc_list_curthe parent pointer to the current reception description list
[in]rx_frame_infoA pointer to the information of the reception frames
[in]rx_desc_countA total count of the reception descriptors
Return values
Astruct of the current reception frame

◆ enet_init_ptp()

void enet_init_ptp ( ENET_Type ptr,
enet_ptp_config_t config 
)

#include <drivers/inc/hpm_enet_drv.h>

Initialize a PTP timer.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]configA pointer to an enet_ptp_config struct instance

◆ enet_mask_interrupt_event()

void enet_mask_interrupt_event ( ENET_Type ptr,
uint32_t  mask 
)

#include <drivers/inc/hpm_enet_drv.h>

Mask Ethernet interrupt events.

Masks Ethernet interrupt events by setting the given mask.

Parameters
ptrPointer to the ENET structure, representing the Ethernet module instance
maskMask of interrupt events to be masked

◆ enet_mask_mmc_rx_interrupt_event()

void enet_mask_mmc_rx_interrupt_event ( ENET_Type ptr,
uint32_t  mask 
)

#include <drivers/inc/hpm_enet_drv.h>

Mask the specified mmc interrupt evenets of received frames.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]maskA mask of the specified evenets

◆ enet_mask_mmc_tx_interrupt_event()

void enet_mask_mmc_tx_interrupt_event ( ENET_Type ptr,
uint32_t  mask 
)

#include <drivers/inc/hpm_enet_drv.h>

Mask the specified mmc interrupt evenets of transmitted frames.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]maskA mask of the specified evenets

◆ enet_prepare_transmission_descriptors()

uint32_t enet_prepare_transmission_descriptors ( ENET_Type ptr,
enet_tx_desc_t **  parent_tx_desc_list_cur,
uint16_t  frame_length,
uint16_t  tx_buff_size 
)

#include <drivers/inc/hpm_enet_drv.h>

prepare for the transmission descriptors (It will be deprecated.)

Parameters
[in]ptrAn Ethernet peripheral base address
[out]parent_tx_desc_list_cura pointer to the information of the reception frames
[in]frame_lengththe length of the transmission
[in]tx_buff_sizethe size of the transmission buffer
Return values
aresult of the transmission preparation. 1 means that the preparation is successful. 0 means that the preparation is unsuccessful.

◆ enet_prepare_tx_desc()

uint32_t enet_prepare_tx_desc ( ENET_Type ptr,
enet_tx_desc_t **  parent_tx_desc_list_cur,
enet_tx_control_config_t config,
uint16_t  frame_length,
uint16_t  tx_buff_size 
)

#include <drivers/inc/hpm_enet_drv.h>

prepare for the transmission descriptors

Parameters
[in]ptrAn Ethernet peripheral base address
[out]parent_tx_desc_list_cura pointer to the information of the reception frames
[in]configa pointer to the control configuration for the transmission frames
[in]frame_lengththe length of the transmission
[in]tx_buff_sizethe size of the transmission buffer
Return values
aresult of the transmission preparation. 1 means that the preparation is successful. 0 means that the preparation is unsuccessful.

◆ enet_prepare_tx_desc_with_ts_record()

uint32_t enet_prepare_tx_desc_with_ts_record ( ENET_Type ptr,
enet_tx_desc_t **  parent_tx_desc_list_cur,
enet_tx_control_config_t config,
uint16_t  frame_length,
uint16_t  tx_buff_size,
enet_ptp_ts_system_t timestamp 
)

#include <drivers/inc/hpm_enet_drv.h>

prepare for the transmission descriptors with a timestamp record

Parameters
[in]ptrAn Ethernet peripheral base address
[out]parent_tx_desc_list_cura pointer to the information of the reception frames
[in]configa pointer to the control configuration for the transmission frames
[in]frame_lengththe length of the transmission
[in]tx_buff_sizethe size of the transmission buffer
[out]timestampa pointer to the timestamp record of a transmitted frame
Return values
aresult of the transmission preparation. 1 means that the preparation is successful. 0 means that the preparation is unsuccessful.

◆ enet_read_phy()

uint16_t enet_read_phy ( ENET_Type ptr,
uint32_t  phy_addr,
uint32_t  addr 
)

#include <drivers/inc/hpm_enet_drv.h>

Read phy.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]phy_addrthe specified address of phy
[in]addrthe specified address of register
Return values
Avalue corresponding to the specified register address

◆ enet_rx_resume()

void enet_rx_resume ( ENET_Type ptr)

#include <drivers/inc/hpm_enet_drv.h>

Resume reception process.

Parameters
[in]ptrAn Ethernet peripheral base address

◆ enet_set_duplex_mode()

void enet_set_duplex_mode ( ENET_Type ptr,
enet_duplex_mode_t  mode 
)

#include <drivers/inc/hpm_enet_drv.h>

Set duplex mode.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]modeAn enum variable of enet_duplex_mode_t

◆ enet_set_line_speed()

void enet_set_line_speed ( ENET_Type ptr,
enet_line_speed_t  speed 
)

#include <drivers/inc/hpm_enet_drv.h>

Set port line speed.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]speedAn enum variable of enet_line_speed_t

◆ enet_set_pps0_control_output()

void enet_set_pps0_control_output ( ENET_Type ptr,
enet_pps_ctrl_t  freq 
)

#include <drivers/inc/hpm_enet_drv.h>

Set the pps0 control output.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]freqAn enum value indicating the specified pps frequency

◆ enet_set_ppsx_command()

hpm_stat_t enet_set_ppsx_command ( ENET_Type ptr,
enet_pps_cmd_t  cmd,
enet_pps_idx_t  idx 
)

#include <drivers/inc/hpm_enet_drv.h>

Set a pps command for ppsx.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]cmdAn enum value indicating the specified pps command
[in]idxAn enum value indicating the index of pps instance
Return values
hpm_stat_tstatus_invalid_argument or status_success

◆ enet_set_ppsx_config()

hpm_stat_t enet_set_ppsx_config ( ENET_Type ptr,
enet_pps_cmd_config_t cmd_cfg,
enet_pps_idx_t  idx 
)

#include <drivers/inc/hpm_enet_drv.h>

Set a pps config for ppsx.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]cmd_cfgAn enum value indicating the specified pps config
[in]idxAn enum value indicating the index of pps instance
Return values
hpm_stat_tstatus_invalid_argument or status_success

◆ enet_set_ptp_timestamp()

void enet_set_ptp_timestamp ( ENET_Type ptr,
enet_ptp_ts_update_t timestamp 
)

#include <drivers/inc/hpm_enet_drv.h>

Set a timestamp to the PTP timer.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]timestampA pointer to a update timestamp structure instance

◆ enet_set_ptp_version()

void enet_set_ptp_version ( ENET_Type ptr,
enet_ptp_version_t  ptp_ver 
)

#include <drivers/inc/hpm_enet_drv.h>

Set the PTP version.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]ptp_verAn enum value indicating the PTP protocol

◆ enet_set_snapshot_ptp_message_type()

void enet_set_snapshot_ptp_message_type ( ENET_Type ptr,
enet_ts_ss_ptp_msg_t  ts_ss_ptp_msg 
)

#include <drivers/inc/hpm_enet_drv.h>

Set the ptp message type for snapshots.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]ts_ss_ptp_msgAn enum value indicating the specified ptp message type for snapshots

◆ enet_unmask_interrupt_event()

void enet_unmask_interrupt_event ( ENET_Type ptr,
uint32_t  mask 
)

#include <drivers/inc/hpm_enet_drv.h>

Unmask ENET interrupt events.

Unmasks the specified interrupt events for the ENET module, allowing them to be responded to.

Parameters
ptrPointer to the Ethernet controller instance
maskMask of interrupt events to be unmasked

◆ enet_update_ptp_timeoffset()

void enet_update_ptp_timeoffset ( ENET_Type ptr,
enet_ptp_ts_update_t timeoffset 
)

#include <drivers/inc/hpm_enet_drv.h>

Update a timestamp to the PTP timer.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]timeoffsetA pointer to a update timestamp structure instance

◆ enet_write_phy()

void enet_write_phy ( ENET_Type ptr,
uint32_t  phy_addr,
uint32_t  addr,
uint32_t  data 
)

#include <drivers/inc/hpm_enet_drv.h>

Write phy.

Parameters
[in]ptrAn Ethernet peripheral base address
[in]phy_addra specified address of phy
[in]addra specified address of the register
[in]dataa specified data to be written