Display.proto 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. syntax = "proto3";
  2. package sys;
  3. import "GPIO.proto";
  4. import "Common.proto";
  5. import "nanopb.proto";
  6. option (nanopb_fileopt).enum_to_string = true;
  7. message DispOffsets {
  8. option (nanopb_msgopt).msgid = 10020;
  9. int32 height =1 [(nanopb).int_size = IS_16];
  10. int32 width =2 [(nanopb).int_size = IS_16];
  11. }
  12. enum DisplayDriverEnum {
  13. UNSPECIFIED_DRIVER = 0;
  14. SSD1306 = 1;
  15. SSD1322 = 2;
  16. SSD1326 = 3;
  17. SSD1327 = 4;
  18. SH1106 = 5;
  19. SSD1675 = 6;
  20. ST7735 = 7;
  21. ST7789 = 8;
  22. ILI9341 = 9;
  23. ILI9341_24 = 10;
  24. SSD1351 = 11;
  25. }
  26. message I2CDisplay {
  27. option (nanopb_msgopt).msgid = 10021;
  28. int32 address = 1 [(nanopb).int_size = IS_8];
  29. }
  30. message SPIDisplay {
  31. option (nanopb_msgopt).msgid = 10022;
  32. GPIO cs = 1;
  33. int32 speed = 4 ;
  34. }
  35. message DispCommon {
  36. option (nanopb_msgopt).msgid = 10023;
  37. int32 width = 1 [(nanopb).int_size = IS_16];
  38. int32 height = 2 [(nanopb).int_size = IS_16];
  39. bool HFlip = 3;
  40. bool VFlip = 4;
  41. DisplayDriverEnum driver = 5;
  42. int32 bitDepth = 6 [(nanopb).int_size = IS_8]; // Defaults to Depth1 in your application logic
  43. GPIO back = 7;
  44. GPIO reset = 8;
  45. GPIO ready = 9;
  46. DispOffsets offsets = 10;
  47. bool rotate = 11;
  48. bool invert = 12;
  49. bool colow_swap = 13;
  50. }
  51. message Display {
  52. option (nanopb_msgopt).msgid = 10024;
  53. DeviceTypeEnum type = 1;
  54. DispCommon common = 2;
  55. oneof dispType {
  56. I2CDisplay i2c = 3;
  57. SPIDisplay spi = 4;
  58. }
  59. }