Ethernet.proto 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. syntax = "proto3";
  2. package sys;
  3. import "Common.proto";
  4. import "GPIO.proto";
  5. import "nanopb.proto";
  6. import "customoptions.proto";
  7. option (nanopb_fileopt).enum_to_string = true;
  8. enum EthModelEnum {
  9. UNSPECIFIED_ETHMODEL = 0;
  10. LAN8720 = 1;
  11. DM9051 = 2;
  12. W5500 = 3;
  13. }
  14. enum EthType { // This enum is used to define the union type for Eth
  15. UNSPECIFIED_ETH = 0; // for unspecified type
  16. SPI = 1;
  17. RMII = 2;
  18. }
  19. message EthCommon {
  20. option (nanopb_msgopt).msgid = 10025;
  21. EthModelEnum model = 1;
  22. GPIO rst = 2;
  23. }
  24. // SPI Specific Ethernet definitions
  25. message EthSPI {
  26. option (nanopb_msgopt).msgid = 10026;
  27. GPIO cs = 1; // CS pin
  28. int32 speed = 2 [(nanopb).int_size = IS_16]; // SPI Bus speed
  29. GPIO intr = 3;
  30. int32 host = 4 [(nanopb).int_size = IS_8,(cust_field).v_int32 = 2 ]; // Defaults to 2 in your application logic
  31. }
  32. // RMII Specific Ethernet definitions
  33. message EthRMII {
  34. option (nanopb_msgopt).msgid = 10027;
  35. GPIO mdc = 1;
  36. GPIO mdio = 2;
  37. }
  38. // Ethernet module configuration
  39. message Eth {
  40. option (nanopb_msgopt).msgid = 10028;
  41. DeviceTypeEnum type = 1;
  42. EthCommon common = 2;
  43. oneof ethType {
  44. EthSPI spi = 3;
  45. EthRMII rmii = 4;
  46. }
  47. }