]> granicus.if.org Git - esp-idf/commitdiff
ethernet: add event declarations
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 23 Aug 2018 09:50:29 +0000 (17:50 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 11 Apr 2019 04:04:58 +0000 (12:04 +0800)
components/ethernet/emac_main.c
components/ethernet/include/esp_eth.h

index 2b78663f943c8c9ffd3b05b42682bef49d696c53..e1b402aa393dce2f26a5b0d78b1212082705159f 100644 (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);
index ccbc59d04086340fa76516df648b791f437c9c6c..5fe712928489a7df80f4f6469f20174531913c9e 100644 (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
  *