Migrate to initial protocol for communication that allows setup of display and control of LEDs
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
|
||||
import "nanopb.proto";
|
||||
|
||||
package beerduino;
|
||||
|
||||
message Ping {
|
||||
required int32 id = 1;
|
||||
}
|
||||
|
||||
message Echo {
|
||||
required int32 id = 1;
|
||||
optional string message = 2 [(nanopb).max_size = 40];
|
||||
}
|
||||
|
||||
54
proto/tm1638.proto
Normal file
54
proto/tm1638.proto
Normal file
@@ -0,0 +1,54 @@
|
||||
import "nanopb.proto";
|
||||
|
||||
package tm1638;
|
||||
|
||||
enum Color {
|
||||
GREEN = 1;
|
||||
RED = 2;
|
||||
BOTH = 3;
|
||||
NONE = 4;
|
||||
}
|
||||
|
||||
enum Module {
|
||||
TM1638 = 1;
|
||||
InvertedTM1638 = 2;
|
||||
TM1640 = 3;
|
||||
}
|
||||
|
||||
message Command {
|
||||
enum Type {
|
||||
PING = 1;
|
||||
CONSTRUCT = 2;
|
||||
SET_LED = 10;
|
||||
}
|
||||
|
||||
required Type type = 1;
|
||||
optional Ping ping = 2;
|
||||
optional Construct construct = 3;
|
||||
optional SetLed setLed = 10;
|
||||
}
|
||||
|
||||
message Ping {
|
||||
required int32 id = 1;
|
||||
}
|
||||
|
||||
message Echo {
|
||||
required int32 id = 1;
|
||||
optional string message = 2;// [(nanopb).max_size = 40];
|
||||
}
|
||||
|
||||
message Construct {
|
||||
required int32 dataPin = 1;
|
||||
required int32 clockPin = 2;
|
||||
optional int32 strobePin = 3;
|
||||
optional bool activateDisplay = 4 [default = true];
|
||||
optional int32 intensity = 5 [default = 7];
|
||||
optional Module module = 6 [default = TM1638];
|
||||
optional int32 id = 7 [default = 0];
|
||||
}
|
||||
|
||||
message SetLed {
|
||||
required Color color = 1;
|
||||
required int32 pos = 2;
|
||||
optional int32 id = 3 [default = 1];
|
||||
}
|
||||
Reference in New Issue
Block a user