pub unsafe extern "C" fn MSS_MAC_init(
this_mac: *mut mss_mac_instance_t,
cfg: *mut mss_mac_cfg_t,
)Expand description
//** The MSS_MAC_init() function initializes the Ethernet MAC hardware and driver internal data structures. In addition to the MAC identifier, the MSS_MAC_init() function takes a pointer to a configuration data structure of type mss_mac_cfg_t as parameter. This configuration data structure contains all the information required to configure the Ethernet MAC. The MSS_MAC_init() function initializes the descriptor rings and their pointers to initial values. The MSS_MAC_init() function enables DMA Rx packet received and Tx packet sent interrupts. The configuration passed to the MSS_MAC_init() function specifies the type of interface used to connect the Ethernet MAC and Ethernet PHY as well as the PHY type and PHY MII management interface address. It also specifies the allowed link speed and duplex mode. It is at this point that the application chooses if the link speed and duplex mode will be auto-negotiated with the link partner or forced to a specific speed and duplex mode.
@param this_mac This parameter is a pointer to one of the global mss_mac_instance_t structures which identifies the MAC that the function is to operate on. There are between 1 and 4 such structures identifying pMAC0, eMAC0, pMAC1 and eMAC1.
@param cfg This parameter is a pointer to a data structure of type mss_mac_cfg_t containing the Ethernet MAC’s requested configuration. You must initialize this data structure by first calling the MSS_MAC_cfg_struct_def_init() function to fill the configuration data structure with default values. You can then overwrite some of the default settings with the ones specific to your application before passing this data structure as parameter to the call to the MSS_MAC_init() function. You must at a minimum overwrite the mac_addr[6] array of the configuration data structure to contain a unique value used as the device’s MAC address.
@return This function does not return a value.
Example: @code mss_mac_cfg_t cfg;
MSS_MAC_cfg_struct_def_init(&cfg);
cfg.mac_addr[0] = 0xC0u; cfg.mac_addr[1] = 0xB1u; cfg.mac_addr[2] = 0x3Cu; cfg.mac_addr[3] = 0x88u; cfg.mac_addr[4] = 0x88u; cfg.mac_addr[5] = 0x88u;
MSS_MAC_init(&g_mac0, &cfg); @endcode