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) |
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... | |
Enet driver APIs.
| #define ENET_ADJ_FREQ_BASE_ADDEND (0x80000000UL) |
#include <drivers/inc/hpm_enet_drv.h>
PTP base adjustment addend
| #define ENET_CRC (4U) |
#include <drivers/inc/hpm_enet_drv.h>
Ethernet CRC
| #define ENET_DMATxDesc_TBS1 ((uint32_t)0x00001FFF) |
#include <drivers/inc/hpm_enet_drv.h>
Transmit Buffer1 Size
| #define ENET_DMATxDesc_TBS2 ((uint32_t)0x1FFF0000) |
#include <drivers/inc/hpm_enet_drv.h>
Transmit Buffer2 Size
| #define ENET_ERROR (0) |
#include <drivers/inc/hpm_enet_drv.h>
ENET error
| #define ENET_HEADER (14U) |
#include <drivers/inc/hpm_enet_drv.h>
6-byte Dest addr, 6-byte Src addr, 2-byte type
| #define ENET_JUMBO_FRAME_PAYLOAD (9000U) |
#include <drivers/inc/hpm_enet_drv.h>
Jumbo frame payload size
| #define ENET_MAC (6) |
#include <drivers/inc/hpm_enet_drv.h>
Ethernet MAC size
| #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)) |
#include <drivers/inc/hpm_enet_drv.h>
| #define ENET_MAX_FRAME_SIZE (1526U) |
#include <drivers/inc/hpm_enet_drv.h>
ENET_HEADER + 2*ENET_VLAN_TAG + ENET_MAX_PAYLOAD + ENET_CRC
| #define ENET_MAX_PAYLOAD (1500U) |
#include <drivers/inc/hpm_enet_drv.h>
Maximum Ethernet payload size
| #define ENET_MIN_PAYLOAD (46U) |
#include <drivers/inc/hpm_enet_drv.h>
Minimum Ethernet payload size
| #define ENET_ONE_SEC_IN_NANOSEC (1000000000UL) |
#include <drivers/inc/hpm_enet_drv.h>
one second in nanoseconds
| #define ENET_PPS_CMD_MASK (0x07UL) |
#include <drivers/inc/hpm_enet_drv.h>
Enet PPS CMD Mask
| #define ENET_PPS_CMD_OFS_FAC (3U) |
#include <drivers/inc/hpm_enet_drv.h>
Enet PPS CMD OFS Factor
| #define ENET_RETRY_CNT (10000UL) |
#include <drivers/inc/hpm_enet_drv.h>
Enet retry count for PTP
| #define ENET_RETRY_DMA_INIT_CNT (10000000UL) |
#include <drivers/inc/hpm_enet_drv.h>
Enet retry count for DMA initialization
| #define ENET_SUCCESS (1) |
#include <drivers/inc/hpm_enet_drv.h>
ENET success
| #define ENET_VLAN_TAG (4U) |
#include <drivers/inc/hpm_enet_drv.h>
optional 802.1q VLAN Tag
#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 | |
| enum enet_csr_clk_range_t |
#include <drivers/inc/hpm_enet_drv.h>
CSR clock range and MDC clock selections.
| enum enet_duplex_mode_t |
| enum enet_gmii_status_t |
| enum enet_inf_type_t |
#include <drivers/inc/hpm_enet_drv.h>
enet interface selections
| Enumerator | |
|---|---|
| enet_inf_mii | |
| enet_inf_rmii | |
| enet_inf_rgmii | |
#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 | |
#include <drivers/inc/hpm_enet_drv.h>
interrupt mask type
| Enumerator | |
|---|---|
| enet_lpi_int_mask | |
| enet_rgsmii_int_mask | |
| enum 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 | |
| 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 | |
| enum enet_phy_op_t |
#include <drivers/inc/hpm_enet_drv.h>
PHY operation selections.
| Enumerator | |
|---|---|
| enet_phy_op_read | |
| enet_phy_op_write | |
| enum enet_pps_cmd_t |
#include <drivers/inc/hpm_enet_drv.h>
PPS0 commands.
| enum enet_pps_ctrl_t |
#include <drivers/inc/hpm_enet_drv.h>
PPS0 control for output frequency selections.
| enum 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 | |
#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 | |
#include <drivers/inc/hpm_enet_drv.h>
PTP frame types.
| Enumerator | |
|---|---|
| enet_ptp_frame_ipv4 | |
| enet_ptp_frame_ipv6 | |
| enet_ptp_frame_ethernet | |
#include <drivers/inc/hpm_enet_drv.h>
enet timestamp update methods
| Enumerator | |
|---|---|
| enet_ptp_time_coarse_update | |
| enet_ptp_time_fine_update | |
| enum enet_ptp_version_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 | |
#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 | |
#include <drivers/inc/hpm_enet_drv.h>
PTP timer rollover modes.
| Enumerator | |
|---|---|
| enet_ts_bin_rollover_control | |
| enet_ts_dig_rollover_control | |
| enum 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 | |
#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 | |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | adj | An adjustment value for the count frequency of the PTP timer |
| 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.
| [out] | parent_rx_desc_list_cur | a parent pointer to the current reception description list |
| [in] | rx_frame_info | A pointer to the information of the reception frames |
| A | result of reception frame. 1 means that a reception of frame is successful. 0 means that a reception of frame is unsuccessful. |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | inf_type | the specified interface |
| [in] | desc | A pointer to descriptor config |
| [in] | cfg | A pointer to mac config |
| [in] | int_config | A pointer to the masks of the specified enabled interrupts and the specified masked interrupts |
| 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.
| ptr | Pointer to the Ethernet controller instance |
| idx | PTP auxiliary snapshot trigger index |
| void enet_dma_flush | ( | ENET_Type * | ptr | ) |
#include <drivers/inc/hpm_enet_drv.h>
Flush DMA.
| [in] | ptr | An Ethernet peripheral base address |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | desc | A pointer to reception descriptors |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | desc | A pointer to transmission descriptors |
| 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.
| ptr | Pointer to the Ethernet controller instance |
| idx | PTP auxiliary snapshot trigger index |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | ptp_frame_type | An enum value indicating the transport protocol of PTP frames |
| [in] | enable | A value to enable or disable the transport protocol of PTP frames which is specified by ptp_frame_type parameter |
| hpm_stat_t | status_invalid_argument or status_success |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | config | A pointer to a interrupt config structure |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | config | A pointer to a control config structure for tranmission |
| uint32_t enet_get_interrupt_status | ( | ENET_Type * | ptr | ) |
#include <drivers/inc/hpm_enet_drv.h>
Get interrupt status.
| [in] | ptr | An Ethernet peripheral base address |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| 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
| [in] | ptr | An Ethernet peripheral base address |
| 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.
| ptr | Pointer to ENET structure |
| status | Pointer to status structure |
A pointer to the status structure where the PTP Auxiliary snapshot status information will be stored.
| 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.
| ptr | Pointer to the ENET_Type structure |
| timestamp | Pointer to the enet_ptp_ts_auxi_snapshot_t structure to store the 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.
| [in] | ptr | An Ethernet peripheral base address |
| [out] | timestamp | A pointer to a system timestamp structure instance |
| 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
| [out] | parent_rx_desc_list_cur | A parent pointer to the current reception description list |
| [in] | rx_frame_info | A pointer to the information of the reception frames |
| A | struct of the current reception frame |
| 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
| [out] | parent_rx_desc_list_cur | the parent pointer to the current reception description list |
| [in] | rx_frame_info | A pointer to the information of the reception frames |
| [in] | rx_desc_count | A total count of the reception descriptors |
| A | struct of the current reception frame |
| void enet_init_ptp | ( | ENET_Type * | ptr, |
| enet_ptp_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_enet_drv.h>
Initialize a PTP timer.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | config | A pointer to an enet_ptp_config struct instance |
| 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.
| ptr | Pointer to the ENET structure, representing the Ethernet module instance |
| mask | Mask of interrupt events to be masked |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | mask | A mask of the specified evenets |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | mask | A mask of the specified evenets |
| 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.)
| [in] | ptr | An Ethernet peripheral base address |
| [out] | parent_tx_desc_list_cur | a pointer to the information of the reception frames |
| [in] | frame_length | the length of the transmission |
| [in] | tx_buff_size | the size of the transmission buffer |
| a | result of the transmission preparation. 1 means that the preparation is successful. 0 means that the preparation is unsuccessful. |
| 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
| [in] | ptr | An Ethernet peripheral base address |
| [out] | parent_tx_desc_list_cur | a pointer to the information of the reception frames |
| [in] | config | a pointer to the control configuration for the transmission frames |
| [in] | frame_length | the length of the transmission |
| [in] | tx_buff_size | the size of the transmission buffer |
| a | result of the transmission preparation. 1 means that the preparation is successful. 0 means that the preparation is unsuccessful. |
| 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
| [in] | ptr | An Ethernet peripheral base address |
| [out] | parent_tx_desc_list_cur | a pointer to the information of the reception frames |
| [in] | config | a pointer to the control configuration for the transmission frames |
| [in] | frame_length | the length of the transmission |
| [in] | tx_buff_size | the size of the transmission buffer |
| [out] | timestamp | a pointer to the timestamp record of a transmitted frame |
| a | result of the transmission preparation. 1 means that the preparation is successful. 0 means that the preparation is unsuccessful. |
| uint16_t enet_read_phy | ( | ENET_Type * | ptr, |
| uint32_t | phy_addr, | ||
| uint32_t | addr | ||
| ) |
#include <drivers/inc/hpm_enet_drv.h>
Read phy.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | phy_addr | the specified address of phy |
| [in] | addr | the specified address of register |
| A | value corresponding to the specified register address |
| void enet_rx_resume | ( | ENET_Type * | ptr | ) |
#include <drivers/inc/hpm_enet_drv.h>
Resume reception process.
| [in] | ptr | An Ethernet peripheral base address |
| void enet_set_duplex_mode | ( | ENET_Type * | ptr, |
| enet_duplex_mode_t | mode | ||
| ) |
#include <drivers/inc/hpm_enet_drv.h>
Set duplex mode.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | mode | An enum variable of enet_duplex_mode_t |
| void enet_set_line_speed | ( | ENET_Type * | ptr, |
| enet_line_speed_t | speed | ||
| ) |
#include <drivers/inc/hpm_enet_drv.h>
Set port line speed.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | speed | An enum variable of enet_line_speed_t |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | freq | An enum value indicating the specified pps frequency |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | cmd | An enum value indicating the specified pps command |
| [in] | idx | An enum value indicating the index of pps instance |
| hpm_stat_t | status_invalid_argument or status_success |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | cmd_cfg | An enum value indicating the specified pps config |
| [in] | idx | An enum value indicating the index of pps instance |
| hpm_stat_t | status_invalid_argument or status_success |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | timestamp | A pointer to a update timestamp structure instance |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | ptp_ver | An enum value indicating the PTP protocol |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | ts_ss_ptp_msg | An enum value indicating the specified ptp message type for snapshots |
| 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.
| ptr | Pointer to the Ethernet controller instance |
| mask | Mask of interrupt events to be unmasked |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | timeoffset | A pointer to a update timestamp structure instance |
| 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.
| [in] | ptr | An Ethernet peripheral base address |
| [in] | phy_addr | a specified address of phy |
| [in] | addr | a specified address of the register |
| [in] | data | a specified data to be written |