Mistake on this page?
Report an issue in GitHub or email us
Public Types | Public Member Functions | Static Public Member Functions
EMAC Class Referenceabstract

#include <EMAC.h>

Inheritance diagram for EMAC:
Kinetis_EMAC LPC17_EMAC LPC546XX_EMAC NUMAKER_EMAC OdinWiFiEMAC RZ_A1_EMAC SL_EMAC STM32_EMAC

Public Types

typedef mbed::Callback< void(emac_mem_buf_t *buf)> emac_link_input_cb_t
 
typedef mbed::Callback< void(bool up)> emac_link_state_change_cb_t
 

Public Member Functions

virtual uint32_t get_mtu_size () const =0
 
virtual uint32_t get_align_preference () const =0
 
virtual void get_ifname (char *name, uint8_t size) const =0
 
virtual uint8_t get_hwaddr_size () const =0
 
virtual bool get_hwaddr (uint8_t *addr) const =0
 
virtual void set_hwaddr (const uint8_t *addr)=0
 
virtual bool link_out (emac_mem_buf_t *buf)=0
 
virtual bool power_up ()=0
 
virtual void power_down ()=0
 
virtual void set_link_input_cb (emac_link_input_cb_t input_cb)=0
 
virtual void set_link_state_cb (emac_link_state_change_cb_t state_cb)=0
 
virtual void add_multicast_group (const uint8_t *address)=0
 
virtual void remove_multicast_group (const uint8_t *address)=0
 
virtual void set_all_multicast (bool all)=0
 
virtual void set_memory_manager (EMACMemoryManager &mem_mngr)=0
 

Static Public Member Functions

static EMACget_default_instance ()
 

Detailed Description

This interface should be used to abstract low level access to networking hardware All operations receive a void * hw pointer which an emac device provides when it is registered with a stack.

Member Typedef Documentation

typedef mbed::Callback<void (emac_mem_buf_t *buf)> EMAC::emac_link_input_cb_t

Callback to be register with Emac interface and to be called for received packets

Parameters
bufReceived data

Callback to be register with Emac interface and to be called for link status changes

Parameters
upLink status

Member Function Documentation

virtual void EMAC::add_multicast_group ( const uint8_t *  address)
pure virtual

Add device to a multicast group

Parameters
addressA multicast group hardware address

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual uint32_t EMAC::get_align_preference ( ) const
pure virtual

Gets memory buffer alignment preference

Gets preferred memory buffer alignment of the Emac device. IP stack may or may not align link out memory buffer chains using the alignment.

Returns
Memory alignment requirement in bytes

Implemented in OdinWiFiEMAC, SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, and LPC546XX_EMAC.

virtual bool EMAC::get_hwaddr ( uint8_t *  addr) const
pure virtual

Return interface-supplied HW address

Copies HW address to provided memory,

Parameters
addrhas to be of correct size see get_hwaddr_size

HW address need not be provided if this interface does not have its own HW address configuration; stack will choose address from central system configuration if the function returns false and does not write to addr.

Parameters
addrHW address for underlying interface
Returns
true if HW address is available

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual uint8_t EMAC::get_hwaddr_size ( ) const
pure virtual

Returns size of the underlying interface HW address size.

Returns
HW address size in bytes

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual void EMAC::get_ifname ( char *  name,
uint8_t  size 
) const
pure virtual

Return interface name

Parameters
namePointer to where the name should be written
sizeMaximum number of character to copy

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual uint32_t EMAC::get_mtu_size ( ) const
pure virtual

Return maximum transmission unit

Returns
MTU in bytes

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual bool EMAC::link_out ( emac_mem_buf_t *  buf)
pure virtual

Sends the packet over the link

That can not be called from an interrupt context.

Parameters
bufPacket to be send
Returns
True if the packet was send successfully, False otherwise

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual void EMAC::power_down ( )
pure virtual
virtual bool EMAC::power_up ( )
pure virtual

Initializes the HW

Returns
True on success, False in case of an error.

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual void EMAC::remove_multicast_group ( const uint8_t *  address)
pure virtual

Remove device from a multicast group

Parameters
addressA multicast group hardware address

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual void EMAC::set_all_multicast ( bool  all)
pure virtual

Request reception of all multicast packets

Parameters
allTrue to receive all multicasts False to receive only multicasts addressed to specified groups

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual void EMAC::set_hwaddr ( const uint8_t *  addr)
pure virtual

Set HW address for interface

Provided address has to be of correct size, see get_hwaddr_size

Called to set the MAC address to actually use - if get_hwaddr is provided the stack would normally use that, but it could be overridden, eg for test purposes.

Parameters
addrAddress to be set

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual void EMAC::set_link_input_cb ( emac_link_input_cb_t  input_cb)
pure virtual

Sets a callback that needs to be called for packets received for that interface

Parameters
input_cbFunction to be register as a callback

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual void EMAC::set_link_state_cb ( emac_link_state_change_cb_t  state_cb)
pure virtual

Sets a callback that needs to be called on link status changes for given interface

Parameters
state_cbFunction to be register as a callback

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.

virtual void EMAC::set_memory_manager ( EMACMemoryManager mem_mngr)
pure virtual

Sets memory manager that is used to handle memory buffers

Parameters
mem_mngrPointer to memory manager

Implemented in SL_EMAC, LPC17_EMAC, RZ_A1_EMAC, STM32_EMAC, Kinetis_EMAC, NUMAKER_EMAC, LPC546XX_EMAC, and OdinWiFiEMAC.


The documentation for this class was generated from the following files:
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.