group::ETH_DEV

The ethernet driver provides access to an ethernet device.

int fd;

 //open and init ethernet driver

 //sending packets: initialize TX, write data, send packet
ioctl(fd, I_ETH_INITTXPKT); //prepare transmission
write(fd, eth_buffer, eth_size); //write to buffers
ioctl(fd, I_ETH_SENDTXPKT); //send the packet

 //receiving packets
 int len;
 uint32_t addr;
 len = ioctl(fd, I_ETH_RXPKTRDY, &addr);
 if( len > 0 ){
     read(fd, eth_buffer, len);
     ioctl(fd, I_ETH_RXPKTCOMPLETE, addr);
 }

Details

defineETH_VERSION


defineETH_IOC_IDENT_CHAR


defineI_ETH_GETVERSION


defineI_ETH_GETINFO

This requests reads the ADC attributes.

Example:

#include <sos/dev/eth.h>
eth_attr_t attr;
int eth_fd;
...
ioctl(eth_fd, I_ETH_GETINFO, &attr);

defineI_ETH_SETATTR

This requests writes the ETH attributes.

Example:

#include <sos/dev/eth.h>
eth_attr_t attr;
int eth_fd;
...
ioctl(eth_fd, I_ETH_SETATTR, &attr);

defineI_ETH_SETACTION


defineI_ETH_SETREGISTER


defineI_ETH_GETREGISTER


defineI_ETH_TOTAL


enum@12

  • ETH_FLAG_SET_INTERFACE
  • ETH_FLAG_IS_FULLDUPLEX
  • ETH_FLAG_IS_HALFDUPLEX
  • ETH_FLAG_IS_AUTONEGOTIATION_ENABLED
  • ETH_FLAG_IS_SPEED_100M
  • ETH_FLAG_IS_SPEED_1G
  • ETH_FLAG_IS_MII
  • ETH_FLAG_IS_RMII
  • ETH_FLAG_GET_STATE
  • ETH_FLAG_SET_REGISTER
  • ETH_FLAG_GET_REGISTER
  • ETH_FLAG_STOP
  • ETH_FLAG_START


date: “2019-06-27” layout: post title: struct::eth_rmii_pin_assignment_t katex: true

categories: struct

Methods

Details

publicmcu_pin_tclk


publicmcu_pin_ttxd0


publicmcu_pin_ttxd1


publicmcu_pin_ttx_en


publicmcu_pin_trxd0


publicmcu_pin_trxd1


publicmcu_pin_tcrs_dv


publicmcu_pin_trx_er


publicmcu_pin_tunused



date: “2019-06-27” layout: post title: struct::eth_mii_pin_assignment_t katex: true

categories: struct

Methods

Details

publicmcu_pin_ttx_clk


publicmcu_pin_ttxd0


publicmcu_pin_ttxd1


publicmcu_pin_ttxd2


publicmcu_pin_ttxd3


publicmcu_pin_ttx_en


publicmcu_pin_ttx_er


publicmcu_pin_trx_clk


publicmcu_pin_trxd0


publicmcu_pin_trxd1


publicmcu_pin_trxd2


publicmcu_pin_trxd3


publicmcu_pin_trx_dv


publicmcu_pin_trx_er


publicmcu_pin_tcrs


publicmcu_pin_tcol



date: “2019-06-27” layout: post title: struct::eth_pin_assignment_t katex: true

categories: struct

Methods

Details

public eth_rmii_pin_assignment_trmii


public eth_mii_pin_assignment_tmii


public union eth_pin_assignment_t::@13@14


publicmcu_pin_tmdio


publicmcu_pin_tmdc



date: “2019-06-27” layout: post title: struct::eth_info_t katex: true

categories: struct

Methods

Details

public u32o_flags


public u32o_events


public u8mac_address

Hardware mac address


public u16resd0


public u32resd1



date: “2019-06-27” layout: post title: struct::eth_attr_t katex: true

categories: struct

This structure defines the attributes structure for configuring the ethernet port.

Methods

Details

public u32o_flags

Flag settings


public eth_pin_assignment_tpin_assignment

Pin assignement (use with ETH_FLAG_SET_INTERFACE)


public u8mac_address

the MAC address (use with ETH_FLAG_SET_INTERFACE)


public u16phy_address

Address of PHY chip (use with ETH_FLAG_SET_INTERFACE)


X

Thanks for Coming!

Subscribe to news and updates