DacControlSet.proto 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. syntax = "proto3";
  2. package sys;
  3. import "nanopb.proto";
  4. option (nanopb_fileopt).enum_to_string = true;
  5. message DacControlSet {
  6. option (nanopb_msgopt).msgid = 10009;
  7. repeated ControlCommand commands = 1 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 10];
  8. }
  9. message ControlCommand {
  10. option (nanopb_msgopt).msgid = 10010;
  11. ControlCommandType type = 1;
  12. repeated ControlItem items = 2 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 50];
  13. }
  14. enum ControlCommandType {
  15. INIT = 0;
  16. POWER_ON = 1;
  17. POWER_OFF = 2;
  18. SPEAKER_ON = 3;
  19. SPEAKER_OFF = 4;
  20. HEADSET_ON = 5;
  21. HEADSET_OFF = 6;
  22. }
  23. message ControlItem {
  24. option (nanopb_msgopt).msgid = 10011;
  25. oneof item_type {
  26. RegisterAction reg_action = 1;
  27. GpioAction gpio_action = 2;
  28. DelayAction delay_action = 3;
  29. }
  30. }
  31. message RegisterAction {
  32. option (nanopb_msgopt).msgid = 10012;
  33. int32 reg = 1[(nanopb).int_size = IS_8];
  34. int32 val = 2 [(nanopb).int_size = IS_8];
  35. Mode mode = 3;
  36. }
  37. enum GpioActionLevel {
  38. ACTION_LEVEL_UNDEFINED = 0;
  39. ACTION_LEVEL_1 = 1;
  40. ACTION_LEVEL_0 = 2;
  41. }
  42. message GpioAction {
  43. option (nanopb_msgopt).msgid = 10013;
  44. int32 gpio = 1 [(nanopb).int_size = IS_8];
  45. GpioActionLevel level = 2;
  46. }
  47. message DelayAction {
  48. option (nanopb_msgopt).msgid = 10014;
  49. int32 delay = 1; // Delay in milliseconds
  50. }
  51. enum Mode {
  52. REG_MODE_NOTHING = 0;
  53. REG_MODE_OR = 1;
  54. REG_MODE_AND = 2;
  55. }