Mistake on this page?
Report an issue in GitHub or email us
Public Types | Public Member Functions | Static Public Member Functions | Data Fields
SCL_EMAC Class Reference
Inheritance diagram for SCL_EMAC:
EMAC

Public Types

typedef mbed::Callback< void(emac_mem_buf_t *buf)> emac_link_input_cb_t
 Callback to be register with EMAC interface and to be called for received packets. More...
 
typedef mbed::Callback< void(bool up)> emac_link_state_change_cb_t
 Callback to be register with EMAC interface and to be called for link status changes. More...
 

Public Member Functions

virtual uint32_t get_mtu_size () const
 Returns the maximum transmission unit. More...
 
virtual uint32_t get_align_preference () const
 Gets the memory buffer alignment preference. More...
 
virtual void get_ifname (char *name, uint8_t size) const
 Returns the interface name. More...
 
virtual uint8_t get_hwaddr_size () const
 Returns the size of the underlying interface HW address size. More...
 
virtual bool get_hwaddr (uint8_t *addr) const
 Returns the interface supplied HW address Copies the HW address to the provided memory. More...
 
virtual void set_hwaddr (const uint8_t *addr)
 Set HW address for the interface. More...
 
virtual bool link_out (emac_mem_buf_t *buf)
 Sends the packet over the link. More...
 
virtual bool power_up ()
 Initializes the HW. More...
 
virtual void power_down ()
 De-initializes the HW. More...
 
virtual void set_link_input_cb (emac_link_input_cb_t input_cb)
 Sets a callback that is called for packets received for a given interface. More...
 
virtual void set_link_state_cb (emac_link_state_change_cb_t state_cb)
 Sets a callback that is called on changes in the link status for a given interface. More...
 
virtual void add_multicast_group (const uint8_t *address)
 Adds a device to a multicast group. More...
 
virtual void remove_multicast_group (const uint8_t *address)
 Removes a device from a multicast group. More...
 
virtual void set_all_multicast (bool all)
 Requests reception of all multicast packets. More...
 
virtual void set_memory_manager (EMACMemoryManager &mem_mngr)
 Sets memory manager used to handle memory buffers. More...
 
virtual void set_activity_cb (mbed::Callback< void(bool is_tx_activity)> activity_cb)
 Sets callback to receive EMAC activity events. More...
 

Static Public Member Functions

static SCL_EMACget_instance ()
 Get the EMAC instance. More...
 
static SCL_EMACget_instance (scl_interface_role_t role)
 Get the EMAC instance. More...
 
static EMACget_default_instance ()
 Return the default on-board EMAC. More...
 

Data Fields

emac_link_input_cb_t emac_link_input_cb = NULL
 Callback for incoming data. More...
 
emac_link_state_change_cb_t emac_link_state_cb = NULL
 Callback for network connection status. More...
 
EMACMemoryManagermemory_manager
 Pointer to hold memory manager object. More...
 
bool powered_up = false
 Flag for Wi-Fi power on status. More...
 
bool link_state = false
 Flag for network connection status. More...
 
scl_interface_role_t interface_type
 Type of the interface. More...
 
scl_mac_t multicast_addr
 Multicast address. More...
 
mbed::Callback< void(bool)> activity_cb
 Callback for activity on network. More...
 

Detailed Description

Definition at line 32 of file scl_emac.h.

Member Typedef Documentation

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

Callback to be register with EMAC interface and to be called for received packets.

Parameters
bufReceived data

Definition at line 48 of file EMAC.h.

typedef mbed::Callback<void (bool up)> emac_link_state_change_cb_t
inherited

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

Parameters
upLink status

Definition at line 56 of file EMAC.h.

Member Function Documentation

virtual void add_multicast_group ( const uint8_t *  address)
virtual

Adds a device to a multicast group.

Parameters
addressA multicast group hardware address.

Implements EMAC.

virtual uint32_t get_align_preference ( ) const
virtual

Gets the memory buffer alignment preference.

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

Returns
Memory alignment requirement in bytes.

Implements EMAC.

static EMAC& get_default_instance ( )
staticinherited

Return the default on-board EMAC.

Returns the default on-board EMAC - this will be target-specific, and may not be available on all targets.

virtual bool get_hwaddr ( uint8_t *  addr) const
virtual

Returns the interface supplied HW address Copies the HW address to the provided memory.

Parameters
addrHW address of the underlying interface. It must be of correct size. See get_hwaddr_size.
Returns
True if HW address is available.

Implements EMAC.

virtual uint8_t get_hwaddr_size ( ) const
virtual

Returns the size of the underlying interface HW address size.

Returns
HW address size in bytes.

Implements EMAC.

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

Returns the interface name.

Parameters
namePointer to the location where the name should be written.
sizeMaximum number of characters to copy.

Implements EMAC.

static SCL_EMAC& get_instance ( )
static

Get the EMAC instance.

Returns
Reference to SCL_EMAC object.
static SCL_EMAC& get_instance ( scl_interface_role_t  role)
static

Get the EMAC instance.

Parameters
roleInterface type.
Returns
Reference to SCL_EMAC object.
virtual uint32_t get_mtu_size ( ) const
virtual

Returns the maximum transmission unit.

Returns
MTU in bytes.

Implements EMAC.

virtual bool link_out ( emac_mem_buf_t *  buf)
virtual

Sends the packet over the link.

This cannot be called from an interrupt context.

Parameters
bufPacket to be sent.
Returns
True if the packet was sent successfully. False otherwise.

Implements EMAC.

virtual void power_down ( )
virtual

De-initializes the HW.

Implements EMAC.

virtual bool power_up ( )
virtual

Initializes the HW.

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

Implements EMAC.

virtual void remove_multicast_group ( const uint8_t *  address)
virtual

Removes a device from a multicast group.

Parameters
addressA multicast group hardware address.

Implements EMAC.

virtual void set_activity_cb ( mbed::Callback< void(bool is_tx_activity)>  activity_cb)
virtual

Sets callback to receive EMAC activity events.

Parameters
activity_cbThe callback for activity events.
virtual void set_all_multicast ( bool  all)
virtual

Requests reception of all multicast packets.

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

Implements EMAC.

virtual void set_hwaddr ( const uint8_t *  addr)
virtual

Set HW address for the interface.

Provided address must be of correct size. See get_hwaddr_size.

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

Parameters
addrAddress to be set

Implements EMAC.

virtual void set_link_input_cb ( emac_link_input_cb_t  input_cb)
virtual

Sets a callback that is called for packets received for a given interface.

Parameters
input_cbFunction to be registered as a callback.

Implements EMAC.

virtual void set_link_state_cb ( emac_link_state_change_cb_t  state_cb)
virtual

Sets a callback that is called on changes in the link status for a given interface.

Parameters
state_cbFunction to be registered as a callback.

Implements EMAC.

virtual void set_memory_manager ( EMACMemoryManager mem_mngr)
virtual

Sets memory manager used to handle memory buffers.

Parameters
mem_mngrPointer to memory manager.

Implements EMAC.

Field Documentation

mbed::Callback<void(bool)> activity_cb

Callback for activity on network.

Definition at line 180 of file scl_emac.h.

emac_link_input_cb_t emac_link_input_cb = NULL

Callback for incoming data.

Definition at line 173 of file scl_emac.h.

emac_link_state_change_cb_t emac_link_state_cb = NULL

Callback for network connection status.

Definition at line 174 of file scl_emac.h.

scl_interface_role_t interface_type

Type of the interface.

Definition at line 178 of file scl_emac.h.

bool link_state = false

Flag for network connection status.

Definition at line 177 of file scl_emac.h.

EMACMemoryManager* memory_manager

Pointer to hold memory manager object.

Definition at line 175 of file scl_emac.h.

scl_mac_t multicast_addr

Multicast address.

Definition at line 179 of file scl_emac.h.

bool powered_up = false

Flag for Wi-Fi power on status.

Definition at line 176 of file scl_emac.h.

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.