Loading...
Searching...
No Matches
eth.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Bas Stottelaar <basstottelaar@gmail.com>
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdint.h>
21
22#include "iolist.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
37int efm32_eth_init(const uint8_t *mac);
38
52
69int efm32_eth_recv(void *buf, size_t max_len);
70
76void efm32_eth_get_mac(uint8_t out[6]);
77
83void efm32_eth_set_mac(const uint8_t mac[6]);
84
92
100
117
124
131
142void efm32_eth_set_link_speed(uint16_t speed);
143
156
165
166#ifdef __cplusplus
167}
168#endif
169
void efm32_eth_set_link_speed(uint16_t speed)
Configure the MAC for a given link speed and duplex.
int efm32_eth_recv(void *buf, size_t max_len)
Receive a frame from the RX ring.
int efm32_eth_tx_status(void)
Query the completion status of the most recent transmission.
bool efm32_eth_rx_pending(void)
Return true if the RX ring contains at least one unconsumed frame.
bool efm32_eth_link_up(void)
Read the PHY link status (BMSR.LINK)
void efm32_eth_complete_auto_negotiation(void)
Complete auto-negotiation and apply speed/duplex to the MAC.
void efm32_eth_set_mac(const uint8_t mac[6])
Program a new MAC address.
int efm32_eth_start_auto_negotiation(void)
Start PHY auto-negotiation.
void efm32_eth_get_mac(uint8_t out[6])
Read the currently programmed MAC address.
int efm32_eth_init(const uint8_t *mac)
Initialize the ETH peripheral and PHY.
bool efm32_eth_get_promiscuous(void)
Return the current promiscuous mode setting.
void efm32_eth_set_promiscuous(bool enable)
Enable or disable promiscuous mode.
int efm32_eth_send(const iolist_t *iolist)
Submit a frame for transmission.
struct iolist iolist_t
iolist forward declaration
Definition iolist.h:30
iolist scatter / gather IO
iolist structure definition
Definition iolist.h:35