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 
9 #pragma once
10 
61 #include "net/ethernet.h"
62 #include "net/netdev.h"
63 #include "mutex.h"
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
72 typedef struct {
74  uint8_t mac_addr[ETHERNET_ADDR_LEN];
75  uint8_t mac_host[ETHERNET_ADDR_LEN];
77  uint16_t rx_len;
78  uint16_t tx_len;
80  const uint8_t *rx_buf;
81  uint8_t tx_buf[ETHERNET_MAX_LEN];
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
Definitions low-level network driver interface.
Definitions for Ethernet.
#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
Structure to hold driver state.
Definition: netdev.h:365
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