Loading...
Searching...
No Matches
tinyusb_netdev.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 Gunar Schorcht
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
58
59#ifndef TINYUSB_NETDEV_H
60#define TINYUSB_NETDEV_H
61
62#include "net/ethernet.h"
63#include "net/netdev.h"
64#include "mutex.h"
65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
73typedef struct {
77
78 uint16_t rx_len;
79 uint16_t tx_len;
80
81 const uint8_t *rx_buf;
83
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif /* TINYUSB_NETDEV_H */
Definitions low-level network driver interface.
Definitions for Ethernet.
struct netdev netdev_t
Forward declaration for netdev struct.
Definition netdev.h:288
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
Definition hdr.h:31
#define ETHERNET_MAX_LEN
maximum number of bytes in an ethernet frame (with FCF)
Definition ethernet.h:46
Mutex for thread synchronization.
Mutex structure.
Definition mutex.h:39
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