2018-10-08 12:20:49 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Gunar Schorcht
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup cpu_esp32_esp_eth
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Netdev interface for the ESP32 Ethernet MAC module
|
|
|
|
*
|
|
|
|
* @author Gunar Schorcht <gunar@schorcht.net>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ESP_ETH_NETDEV_H
|
|
|
|
#define ESP_ETH_NETDEV_H
|
|
|
|
|
|
|
|
#include "net/netdev.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Reference to the netdev device driver struct
|
|
|
|
*/
|
|
|
|
extern const netdev_driver_t esp_eth_driver;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Device descriptor for ESP-ETH devices
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
netdev_t netdev; /**< netdev parent struct */
|
|
|
|
|
2018-12-12 18:10:35 +01:00
|
|
|
uint16_t rx_len; /**< number of bytes received */
|
|
|
|
uint16_t tx_len; /**< number of bytes in transmit buffer */
|
2018-10-08 12:20:49 +02:00
|
|
|
|
2019-01-21 15:25:43 +01:00
|
|
|
uint8_t rx_buf[ETHERNET_MAX_LEN]; /**< receive buffer */
|
|
|
|
uint8_t tx_buf[ETHERNET_MAX_LEN]; /**< transmit buffer */
|
2018-10-08 12:20:49 +02:00
|
|
|
|
|
|
|
uint32_t event; /**< received event */
|
|
|
|
bool link_up; /**< indicates whether link is up */
|
|
|
|
|
|
|
|
gnrc_netif_t* netif; /**< reference to the corresponding netif */
|
|
|
|
|
|
|
|
mutex_t dev_lock; /**< device is already in use */
|
|
|
|
|
|
|
|
} esp_eth_netdev_t;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ESP_ETH_NETDEV_H */
|
|
|
|
/** @} */
|