GPIO.proto 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. syntax = "proto3";
  2. package sys;
  3. import "Common.proto";
  4. import "customoptions.proto";
  5. import "nanopb.proto";
  6. option (nanopb_fileopt).enum_to_string = true;
  7. enum LevelsEnum {
  8. L_LOW = 0;
  9. L_HIGH = 1;
  10. }
  11. // GPIO to use for the specified function
  12. message GPIO {
  13. option (nanopb_msgopt).msgid = 10130;
  14. int32 pin = 1 [(nanopb).int_size = IS_8, (cust_field).v_int32 = -1]; // a valid esp32 gpio pin that supports the intended mode
  15. LevelsEnum level = 2 [(cust_field).v_enum = "L_HIGH"]; // 0 or 1
  16. }
  17. enum LedTypesEnum {
  18. UNKNOWN = 0;
  19. LED_TYPE_GPIO = 1;
  20. LED_TYPE_WS2812 = 2;
  21. }
  22. message LED {
  23. option (nanopb_msgopt).msgid = 10029;
  24. GPIO gpio = 1 [(nanopb).int_size = IS_8]; // a valid esp32 gpio pin that supports the intended mode
  25. int32 brightness = 2 [(nanopb).int_size = IS_8]; // 0 to 100%
  26. LedTypesEnum led_type = 3;
  27. }
  28. message Gpios {
  29. option (nanopb_msgopt).msgid = 10030;
  30. LED greenLED = 1;
  31. LED redLED = 2;
  32. GPIO audioJack = 3;
  33. GPIO amp = 4;
  34. GPIO power = 5 ;
  35. GPIO jack = 6;
  36. GPIO spkfault = 7;
  37. GPIO Vcc = 8;
  38. GPIO GND = 9;
  39. }
  40. enum GPIOExpModelEnum {
  41. UNSPECIFIED_EXP = 0;
  42. PCA9535 = 1;
  43. PCA85XX = 2;
  44. MCP23017 = 3;
  45. MCP23S17 = 4;
  46. }
  47. message GPIOExpI2C {
  48. option (nanopb_msgopt).msgid = 10032;
  49. PortEnum port = 5 [(cust_field).v_string = "SYSTEM"]; // Defaults to system
  50. }
  51. message GPIOExpSPI {
  52. option (nanopb_msgopt).msgid = 10031;
  53. int32 speed = 1 [(nanopb).int_size = IS_16];
  54. HostEnum host = 2;
  55. GPIO cs = 3;
  56. }
  57. message GPIOExp {
  58. option (nanopb_msgopt).msgid = 10033;
  59. GPIOExpModelEnum model = 1;
  60. int32 addr = 2 [(nanopb).int_size = IS_8];
  61. oneof ExpType {
  62. GPIOExpI2C i2c = 3;
  63. GPIOExpSPI spi = 4;
  64. }
  65. int32 base = 5 [(cust_field).v_int32 = 40]; // Defaults to 40
  66. int32 count = 6 [(cust_field).v_int32 = 16]; // Defaults to 16
  67. GPIO intr = 7;
  68. }