ec_eoe.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2025, sakumisu
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef EC_EOE_H
  7. #define EC_EOE_H
  8. #ifdef CONFIG_EC_EOE
  9. #include "netif/etharp.h"
  10. #include "lwip/netif.h"
  11. #include "lwip/pbuf.h"
  12. #include "lwip/tcpip.h"
  13. #include "lwip/ip_addr.h"
  14. struct ec_eoe_ip_param {
  15. uint8_t hostname[EC_MAX_HOSTNAME_SIZE];
  16. const char *ipv4_addr_str;
  17. const char *ipv4_mask_str;
  18. const char *ipv4_gw_str;
  19. const char *dns_server_str;
  20. uint8_t mac_addr[6];
  21. };
  22. typedef struct ec_eoe {
  23. ec_master_t *master;
  24. uint16_t slave_index;
  25. ec_datagram_t tx_datagram;
  26. ec_datagram_t rx_datagram;
  27. uint8_t tx_buffer[1536];
  28. uint8_t rx_buffer[1536];
  29. struct ec_eoe_ip_param master_ip_param;
  30. struct ec_eoe_ip_param slave_ip_param;
  31. bool initialized;
  32. ec_osal_thread_t rx_thread;
  33. ec_osal_mutex_t txrx_mutex;
  34. struct netif netif;
  35. } ec_eoe_t;
  36. int ec_eoe_start(ec_eoe_t *eoe,
  37. ec_master_t *master,
  38. uint16_t slave_index,
  39. struct ec_eoe_ip_param *master_ip_param,
  40. struct ec_eoe_ip_param *slave_ip_param);
  41. #endif
  42. #endif