network_ethernet.h 1.1 KB

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