HPM SDK
HPMicro Software Development Kit
hpm_enet_drv.c File Reference
#include "hpm_enet_drv.h"
#include "hpm_enet_soc_drv.h"

Functions

static void enet_mode_init (ENET_Type *ptr, uint32_t intr)
 
static int enet_dma_init (ENET_Type *ptr, enet_desc_t *desc, uint32_t intr, uint8_t pbl)
 
static int enet_mac_init (ENET_Type *ptr, enet_mac_config_t *config, enet_inf_type_t inf_type)
 
uint32_t enet_get_interrupt_status (ENET_Type *ptr)
 Get interrupt status. 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_mask_mmc_rx_interrupt_event (ENET_Type *ptr, uint32_t mask)
 Mask the specified mmc interrupt evenets of received frames. More...
 
uint32_t enet_get_mmc_rx_interrupt_status (ENET_Type *ptr)
 Get a staus of mmc receive interrupt events. 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_tx_interrupt_status (ENET_Type *ptr)
 et a staus of mmc transmission interrupt events More...
 
void enet_dma_flush (ENET_Type *ptr)
 Flush DMA. More...
 
void enet_write_phy (ENET_Type *ptr, uint32_t phy_addr, uint32_t addr, uint32_t data)
 Write phy. More...
 
uint16_t enet_read_phy (ENET_Type *ptr, uint32_t phy_addr, uint32_t addr)
 Read phy. 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...
 
hpm_stat_t enet_controller_init (ENET_Type *ptr, enet_inf_type_t inf_type, enet_desc_t *desc, enet_mac_config_t *config, enet_int_config_t *int_config)
 Initialize controller. 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...
 
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_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...
 
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_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...
 
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_timestamp_enable (ENET_Type *ptr, bool enable)
 
void enet_set_subsecond_increment (ENET_Type *ptr, uint8_t ssinc)
 
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_init_ptp (ENET_Type *ptr, enet_ptp_config_t *config)
 Initialize a PTP timer. 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_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_snapshot_status (ENET_Type *ptr, enet_ptp_auxi_snapshot_status_t *status)
 Get PTP Auxiliary Snapshot Status. More...
 
void enet_get_ptp_auxi_timestamp (ENET_Type *ptr, enet_ptp_ts_auxi_snapshot_t *timestamp)
 Get PTP auxiliary timestamp. More...
 

Function Documentation

◆ enet_dma_init()

static int enet_dma_init ( ENET_Type ptr,
enet_desc_t desc,
uint32_t  intr,
uint8_t  pbl 
)
static

◆ enet_mac_init()

static int enet_mac_init ( ENET_Type ptr,
enet_mac_config_t config,
enet_inf_type_t  inf_type 
)
static

◆ enet_mode_init()

static void enet_mode_init ( ENET_Type ptr,
uint32_t  intr 
)
static

◆ enet_set_subsecond_increment()

void enet_set_subsecond_increment ( ENET_Type ptr,
uint8_t  ssinc 
)

◆ enet_timestamp_enable()

void enet_timestamp_enable ( ENET_Type ptr,
bool  enable 
)