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
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 {
75 uint8_t mac_addr[ETHERNET_ADDR_LEN];
76 uint8_t mac_host[ETHERNET_ADDR_LEN];
78 uint16_t rx_len;
79 uint16_t tx_len;
81 const uint8_t *rx_buf;
82 uint8_t tx_buf[ETHERNET_MAX_LEN];
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif /* TINYUSB_NETDEV_H */
Definitions low-level network driver interface.
Definitions for Ethernet.
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
Definition hdr.h:32
#define ETHERNET_MAX_LEN
maximum number of bytes in an ethernet frame (with FCF)
Definition ethernet.h:47
Mutex for thread synchronization.
Mutex structure.
Definition mutex.h:146
Structure to hold driver state.
Definition netdev.h:363
Device descriptor for tinyUSB CDC ECM network devices.
uint16_t tx_len
number of bytes in transmit buffer
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