mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 21:47:04 +03:00
initial refactoring
This commit is contained in:
52
protobuf/proto/Ethernet.proto
Normal file
52
protobuf/proto/Ethernet.proto
Normal file
@@ -0,0 +1,52 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
import "Common.proto";
|
||||
import "GPIO.proto";
|
||||
import "nanopb.proto";
|
||||
import "customoptions.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
enum EthModelEnum {
|
||||
UNSPECIFIED_ETHMODEL = 0;
|
||||
LAN8720 = 1;
|
||||
DM9051 = 2;
|
||||
W5500 = 3;
|
||||
}
|
||||
enum EthType { // This enum is used to define the union type for Eth
|
||||
UNSPECIFIED_ETH = 0; // for unspecified type
|
||||
SPI = 1;
|
||||
RMII = 2;
|
||||
}
|
||||
message EthCommon {
|
||||
option (nanopb_msgopt).msgid = 10025;
|
||||
EthModelEnum model = 1;
|
||||
GPIO rst = 2;
|
||||
}
|
||||
|
||||
// SPI Specific Ethernet definitions
|
||||
message EthSPI {
|
||||
option (nanopb_msgopt).msgid = 10026;
|
||||
GPIO cs = 1; // CS pin
|
||||
int32 speed = 2 [(nanopb).int_size = IS_16]; // SPI Bus speed
|
||||
GPIO intr = 3;
|
||||
int32 host = 4 [(nanopb).int_size = IS_8,(cust_field).v_int32 = 2 ]; // Defaults to 2 in your application logic
|
||||
}
|
||||
|
||||
// RMII Specific Ethernet definitions
|
||||
message EthRMII {
|
||||
option (nanopb_msgopt).msgid = 10027;
|
||||
GPIO mdc = 1;
|
||||
GPIO mdio = 2;
|
||||
}
|
||||
|
||||
// Ethernet module configuration
|
||||
message Eth {
|
||||
option (nanopb_msgopt).msgid = 10028;
|
||||
DeviceTypeEnum type = 1;
|
||||
EthCommon common = 2;
|
||||
oneof ethType {
|
||||
EthSPI spi = 3;
|
||||
EthRMII rmii = 4;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user