_Slave_Ports.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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;
  10. int Exp_state_ttl; // 0x00 = odswiezyc
  11. } _Slave_Port;
  12. _Slave_Port _Slave_Ports[] = {
  13. {"CAN", 0x102, 0x80, 0x00, 0, 0x00, 0x00 },
  14. {"CAN", 0x102, 0x80, 0x00, 1, 0xFF, 0x20 } //testowy ttl
  15. };
  16. /*
  17. struct _Slave_Port
  18. {
  19. char _Protocol ;
  20. int _Slave_ID;
  21. char Port_Type;
  22. int Address;
  23. int LocalPort ;
  24. void (*fn)();
  25. };
  26. struct _Slave_Port {
  27. }
  28. #define _Slave_Port = { "CAN" , 0x102 , "PWM", 0x00, 0 }
  29. */
  30. /* #define __CAN_Ports { _Slave1_ID } ;
  31. #define __CAN_Ports_PWM { _Slave1_ID
  32. {0x00 , 0 } ,
  33. {0x00 , 1 }
  34. } ;
  35. */
  36. /*
  37. typedef struct
  38. {
  39. int Slave1_ID;
  40. String PortType;
  41. int Address;
  42. int LocalPort ;
  43. }
  44. */
  45. /*
  46. struct buttons
  47. {
  48. int color[3];
  49. int positions[4];
  50. char init[20];
  51. void (*fn)();
  52. };
  53. //void func1();
  54. //void func2();
  55. buttons test[] =
  56. {
  57. { {0,0,0}, {0,0,100,100}, "getSomething", func1 },
  58. { {40,40,40}, {50,50,10,10}, "somethingElse", func2 },
  59. };
  60. */
  61. /*
  62. typedef struct {
  63. const char * const l_name;
  64. byte x_m;
  65. byte y_m;
  66. boolean period[4];
  67. } myStruct;
  68. myStruct structs[] = {
  69. {"My Name", 0, 0, {true, true, false, false}},
  70. {"My Second Name", 0, 0, {true, false, true, false}}
  71. };
  72. */
  73. //#define _CAN_P_0x102_PWM0x00_0 { _Slave1_ID , "PWM", 0x00, 0 }
  74. //#define _CAN_P_0x102_PWM0x00_1 { _Slave1_ID , "PWM", 0x00, 1 }
  75. // char _Slave_Ports ;
  76. // _Slave_Ports[0] = "_CAN_P_0x102_PWM0x00_0" ;
  77. // _Slave_Ports[1] = "_CAN_P_0x102_PWM0x00_1" ;
  78. // char *_Slave_Ports[] = { "_CAN_P_0x102_PWM0x00_0", "_CAN_P_0x102_PWM0x00_1" } ;