Loading...
Searching...
No Matches
tinyusb_netdev.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2022 Gunar Schorcht
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
57
58#include "net/ethernet.h"
59#include "net/netdev.h"
60#include "mutex.h"
61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
69typedef struct {
73
74 uint16_t rx_len;
75 uint16_t tx_len;
76
77 const uint8_t *rx_buf;
79
82
83#ifdef __cplusplus
84}
85#endif
86
Definitions low-level network driver interface.
Definitions for Ethernet.
struct netdev netdev_t
Forward declaration for netdev struct.
Definition netdev.h:285
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
Definition hdr.h:28
#define ETHERNET_MAX_LEN
maximum number of bytes in an ethernet frame (with FCF)
Definition ethernet.h:43
Mutex for thread synchronization.
Mutex structure.
Definition mutex.h:36
Device descriptor for tinyUSB CDC ECM network devices.
uint8_t tx_buf[ETHERNET_MAX_LEN]
transmit buffer
uint8_t mac_host[ETHERNET_ADDR_LEN]
host MAC address
uint16_t tx_len
number of bytes in transmit buffer
uint8_t mac_addr[ETHERNET_ADDR_LEN]
device MAC address
const uint8_t * rx_buf
receive buffer in tinyUSB stack
mutex_t lock
device is already in use
netdev_t netdev
netdev parent struct
uint16_t rx_len
number of bytes received