ethernet: add event declarations

This commit is contained in:
Ivan Grokhotkov
2018-08-23 17:50:29 +08:00
parent 8b57fe9515
commit c001553027
2 changed files with 15 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ static bool pause_send = false;
#ifdef CONFIG_PM_ENABLE
static esp_pm_lock_handle_t s_pm_lock;
#endif
ESP_EVENT_DEFINE_BASE(ETH_EVENT);
static esp_err_t emac_ioctl(emac_sig_t sig, emac_par_t par);
esp_err_t emac_post(emac_sig_t sig, emac_par_t par);

View File

@@ -19,6 +19,9 @@
extern "C" {
#endif
#include <stdbool.h>
#include <stdint.h>
#include "esp_event_base.h"
#include "esp_types.h"
#include "esp_err.h"
@@ -130,6 +133,17 @@ typedef struct {
uint32_t reset_timeout_ms; /*!< timeout value for reset emac */
} eth_config_t;
/** Ethernet event declarations */
typedef enum {
ETHERNET_EVENT_START, /**< ESP32 ethernet start */
ETHERNET_EVENT_STOP, /**< ESP32 ethernet stop */
ETHERNET_EVENT_CONNECTED, /**< ESP32 ethernet phy link up */
ETHERNET_EVENT_DISCONNECTED, /**< ESP32 ethernet phy link down */
} eth_event_t;
/** @brief Ethernet event base declaration */
ESP_EVENT_DECLARE_BASE(ETH_EVENT);
/**
* @brief Init ethernet mac
*