Microchip® Advanced Software Framework

emac_device Struct Reference

EMAC driver structure.

#include <emac.h>

Data Fields

emac_dev_tx_cb_t func_rx_cb
 Optional callback to be invoked once a frame has been received. More...
 
emac_dev_tx_cb_tfunc_tx_cb_list
 Optional callback list to be invoked once TD has been processed. More...
 
emac_dev_wakeup_cb_t func_wakeup_cb
 Optional callback to be invoked once several TDs have been released. More...
 
Emac * p_hw
 Pointer to HW register base. More...
 
uint8_t * p_rx_buffer
 Pointer to allocated RX buffer. More...
 
emac_rx_descriptor_tp_rx_dscr
 Pointer to Rx TDs (must be 8-byte aligned) More...
 
uint8_t * p_tx_buffer
 Pointer to allocated TX buffer. More...
 
emac_tx_descriptor_tp_tx_dscr
 Pointer to Tx TDs (must be 8-byte aligned) More...
 
uint8_t uc_wakeup_threshold
 Number of free TD before wakeup callback is invoked. More...
 
uint16_t us_rx_idx
 RX index for current processing TD. More...
 
uint16_t us_rx_list_size
 RX TD list size. More...
 
uint16_t us_tx_head
 Circular buffer head pointer by upper layer (buffer to be sent) More...
 
uint16_t us_tx_list_size
 TX TD list size. More...
 
uint16_t us_tx_tail
 Circular buffer tail pointer incremented by handlers (buffer sent) More...
 

emac_dev_tx_cb_t emac_device::func_rx_cb

Optional callback to be invoked once a frame has been received.

Referenced by emac_dev_set_rx_callback(), and emac_handler().

emac_dev_tx_cb_t* emac_device::func_tx_cb_list

Optional callback list to be invoked once TD has been processed.

Referenced by emac_dev_write(), emac_handler(), and emac_init_mem().

emac_dev_wakeup_cb_t emac_device::func_wakeup_cb

Optional callback to be invoked once several TDs have been released.

Referenced by emac_dev_set_tx_wakeup_callback(), and emac_handler().

uint8_t* emac_device::p_rx_buffer

Pointer to allocated RX buffer.

Referenced by emac_init_mem(), and emac_reset_rx_mem().

emac_rx_descriptor_t* emac_device::p_rx_dscr

Pointer to Rx TDs (must be 8-byte aligned)

Referenced by emac_dev_read(), emac_init_mem(), and emac_reset_rx_mem().

uint8_t* emac_device::p_tx_buffer

Pointer to allocated TX buffer.

Section 3.6 of AMBA 2.0 spec states that burst should not cross 1K Boundaries. Receive buffer manager writes are burst of 2 words => 3 lsb bits of the address shall be set to 0.

Referenced by emac_init_mem(), and emac_reset_tx_mem().

emac_tx_descriptor_t* emac_device::p_tx_dscr

Pointer to Tx TDs (must be 8-byte aligned)

Referenced by emac_dev_write(), emac_handler(), emac_init_mem(), and emac_reset_tx_mem().

uint8_t emac_device::uc_wakeup_threshold

Number of free TD before wakeup callback is invoked.

Referenced by emac_dev_set_tx_wakeup_callback(), and emac_handler().

uint16_t emac_device::us_rx_idx

RX index for current processing TD.

Referenced by emac_dev_read(), and emac_reset_rx_mem().

uint16_t emac_device::us_rx_list_size

RX TD list size.

Referenced by emac_dev_read(), emac_init_mem(), and emac_reset_rx_mem().

uint16_t emac_device::us_tx_head

Circular buffer head pointer by upper layer (buffer to be sent)

Referenced by emac_dev_get_tx_load(), emac_dev_write(), emac_handler(), and emac_reset_tx_mem().

uint16_t emac_device::us_tx_list_size
uint16_t emac_device::us_tx_tail

Circular buffer tail pointer incremented by handlers (buffer sent)

Referenced by emac_dev_get_tx_load(), emac_dev_write(), emac_handler(), and emac_reset_tx_mem().