Skip to content

File syn_port_eth.h

FileList > port > syn_port_eth.h

Go to the source code of this file

Ethernet HAL hardware port interface contract.

  • #include "syntropic/common/syn_defs.h"
  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>

Public Functions

Type Name
SYN_Status syn_port_eth_init (const uint8_t mac_addr)
Initialize low-level Ethernet MAC hardware (RMII/MII/SPI PHY).
SYN_Status syn_port_eth_rx (void * buf, size_t max_len, size_t * out_len)
Receive raw Ethernet frame from PHY buffer.
SYN_Status syn_port_eth_tx (const void * frame, size_t len)
Transmit raw Ethernet frame over PHY.

Public Functions Documentation

function syn_port_eth_init

Initialize low-level Ethernet MAC hardware (RMII/MII/SPI PHY).

SYN_Status syn_port_eth_init (
    const uint8_t mac_addr
) 

Parameters:

  • mac_addr 6-byte hardware MAC address.

Returns:

SYN_OK on success.


function syn_port_eth_rx

Receive raw Ethernet frame from PHY buffer.

SYN_Status syn_port_eth_rx (
    void * buf,
    size_t max_len,
    size_t * out_len
) 

Parameters:

  • buf Pointer to destination buffer.
  • max_len Max capacity (must be >= 1514 bytes).
  • out_len Pointer to receive frame byte length.

Returns:

SYN_OK on success, SYN_BUSY if no frame available.


function syn_port_eth_tx

Transmit raw Ethernet frame over PHY.

SYN_Status syn_port_eth_tx (
    const void * frame,
    size_t len
) 

Parameters:

  • frame Pointer to frame bytes.
  • len Frame length (60..1514 bytes).

Returns:

SYN_OK on success.



The documentation for this class was generated from the following file src/port/syn_port_eth.h