network_ethernet.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "network_manager.h"
  3. #include "accessors.h"
  4. #include <string.h>
  5. #include "esp_netif_defaults.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef struct {
  10. bool valid;
  11. bool rmii;
  12. bool spi;
  13. esp_eth_handle_t handle;
  14. esp_netif_config_t * cfg_netif;
  15. spi_device_interface_config_t * devcfg;
  16. // This function is called when the network interface is started
  17. // and performs any initialization that requires a valid ethernet
  18. // configuration .
  19. void (*init_config)(eth_config_t * eth_config);
  20. esp_err_t (*start)(spi_device_handle_t spi_handle,eth_config_t *ethernet_config);
  21. } network_ethernet_driver_t;
  22. typedef network_ethernet_driver_t* network_ethernet_detect_func_t(const char* Driver);
  23. network_ethernet_driver_t* network_ethernet_driver_autodetect(const char* Driver);
  24. void destroy_network_ethernet();
  25. void init_network_ethernet();
  26. bool network_ethernet_wait_for_link(uint16_t max_wait_ms);
  27. void network_ethernet_start_timer();
  28. bool network_ethernet_is_up();
  29. bool network_ethernet_enabled();
  30. esp_netif_t *network_ethernet_get_interface();
  31. #ifdef __cplusplus
  32. }
  33. #endif