_Slave_Ports.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. typedef struct {
  2. const char * const _Protocol;
  3. int _Slave_ID;
  4. int PortTypes; //0xFF = 1111 1111 { PWM, .....} = 0x80
  5. // byte has_Address;
  6. int Address ;
  7. // byte has_Local_Port;
  8. int LocalPort;
  9. int Exp_state; /*0xFF = 1111 1111
  10. 0x00 = 0000 0000 = OFF = 0V
  11. 0x01 = 0000 0001 = ON = PWM max
  12. {
  13. bit 1 - OFF = 0V
  14. bit 2 - ON = PWM max
  15. bit 3 - not allocated
  16. bit 4 - not allocated
  17. bit 2 - not allocated
  18. bit 5 - not allocated
  19. bit 6 - not allocated
  20. bit 7 - not allocated
  21. bit 8 - not allocated
  22. }*/
  23. int Exp_state_ttl; // 0x00 = odswiezyc
  24. } _Slave_Port;
  25. _Slave_Port _Slave_Ports[] = {
  26. {"CAN", 0x102, 0x01, 0x00, 0x00, 0x00, 0x00 },
  27. {"CAN", 0x102, 0x01, 0x00, 0x01, 0xFF, 0x6d } //testowy ttl
  28. };
  29. /*
  30. struct _Slave_Port
  31. {
  32. char _Protocol ;
  33. int _Slave_ID;
  34. char Port_Type;
  35. int Address;
  36. int LocalPort ;
  37. void (*fn)();
  38. };
  39. struct _Slave_Port {
  40. }
  41. #define _Slave_Port = { "CAN" , 0x102 , "PWM", 0x00, 0 }
  42. */
  43. /* #define __CAN_Ports { _Slave1_ID } ;
  44. #define __CAN_Ports_PWM { _Slave1_ID
  45. {0x00 , 0 } ,
  46. {0x00 , 1 }
  47. } ;
  48. */
  49. /*
  50. typedef struct
  51. {
  52. int Slave1_ID;
  53. String PortType;
  54. int Address;
  55. int LocalPort ;
  56. }
  57. */
  58. /*
  59. struct buttons
  60. {
  61. int color[3];
  62. int positions[4];
  63. char init[20];
  64. void (*fn)();
  65. };
  66. //void func1();
  67. //void func2();
  68. buttons test[] =
  69. {
  70. { {0,0,0}, {0,0,100,100}, "getSomething", func1 },
  71. { {40,40,40}, {50,50,10,10}, "somethingElse", func2 },
  72. };
  73. */
  74. /*
  75. typedef struct {
  76. const char * const l_name;
  77. byte x_m;
  78. byte y_m;
  79. boolean period[4];
  80. } myStruct;
  81. myStruct structs[] = {
  82. {"My Name", 0, 0, {true, true, false, false}},
  83. {"My Second Name", 0, 0, {true, false, true, false}}
  84. };
  85. */
  86. //#define _CAN_P_0x102_PWM0x00_0 { _Slave1_ID , "PWM", 0x00, 0 }
  87. //#define _CAN_P_0x102_PWM0x00_1 { _Slave1_ID , "PWM", 0x00, 1 }
  88. // char _Slave_Ports ;
  89. // _Slave_Ports[0] = "_CAN_P_0x102_PWM0x00_0" ;
  90. // _Slave_Ports[1] = "_CAN_P_0x102_PWM0x00_1" ;
  91. // char *_Slave_Ports[] = { "_CAN_P_0x102_PWM0x00_0", "_CAN_P_0x102_PWM0x00_1" } ;