arkadiusz binder 5 vuotta sitten
vanhempi
commit
150221b3a4

+ 36 - 1
SE/stuff/P5_Automation_can-dev/P5_Automation_can-dev.ino

@@ -16,7 +16,39 @@
  *  TODO structure of port is in _Slave_Ports.h  
  *     _Slave_Port _Slave_Ports[] = {
         {"CAN", 0x102, 0x80, 0x00, 0, 0x00, 0x00 },
-        {"CAN", 0x102, 0x80, 0x00, 1, 0xFF, 0x20 } //testowy ttl
+        {"CAN",  - Base port origin protocol
+          0x102,  - Base port origin protocol address
+           0x80, -  int PortTypes;  0xFF  =  1111 1111
+                                    0x01  =  0000 0001  = PWM port
+                                    {
+                                      bit 1 - PWM port
+                                      bit 2 - not allocated
+                                      bit 3 - not allocated
+                                      bit 4 - not allocated
+                                      bit 2 - not allocated
+                                      bit 5 - not allocated
+                                      bit 6 - not allocated
+                                      bit 7 - not allocated
+                                      bit 8 - not allocated
+                                    },
+            0x00, int Address -  local address on e.g. I2C bus - 0x40 etc                     
+            0x00, - int LocalPort - local port number when used e.g. I2C extension
+             0x01 - Exp_state -     0xFF  =  1111 1111
+                                    0x00  =  0000 0000  = OFF = 0V
+                                    0x01  =  0000 0001  = ON = PWM max
+                                              {
+                                                bit 1 - OFF = 0V
+                                                bit 2 - ON = PWM max
+                                                bit 3 - not allocated
+                                                bit 4 - not allocated
+                                                bit 2 - not allocated
+                                                bit 5 - not allocated
+                                                bit 6 - not allocated
+                                                bit 7 - not allocated
+                                                bit 8 - not allocated
+                                              }, 
+               0x6d - testowy ttl - 10 sekund do przedawnienia stanu portu w tablicy i koniecznosci odswiezenia tablicy
+               } 
         };
         - to be optimalized for inegration
         - to allow of subscribe ports
@@ -34,6 +66,9 @@
  *  TO BE INGEGRATED WITH MARLIN 3D PRINTERS - machine and automation purpose
  *    - controll remote ports via g-code 
  *    - allows interrupts
+ *   TO ALLOW OF NEXT PACKETS TYPES WITH DIFFERENT MEANINGS
+ *    - dimming
+ *    logic
  */
 
 

+ 16 - 3
SE/stuff/P5_Automation_can-dev/_Slave_Ports.h

@@ -8,13 +8,26 @@ typedef struct  {
   int Address ;
  // byte has_Local_Port;
   int LocalPort;
-  int Exp_state;
+  int Exp_state;                  /*0xFF  =  1111 1111
+                                    0x00  =  0000 0000  = OFF = 0V
+                                    0x01  =  0000 0001  = ON = PWM max
+                                    {
+                                      bit 1 - OFF = 0V
+                                      bit 2 - ON = PWM max
+                                      bit 3 - not allocated
+                                      bit 4 - not allocated
+                                      bit 2 - not allocated
+                                      bit 5 - not allocated
+                                      bit 6 - not allocated
+                                      bit 7 - not allocated
+                                      bit 8 - not allocated
+                                    }*/
   int Exp_state_ttl;  // 0x00 = odswiezyc
 } _Slave_Port;
 
 _Slave_Port _Slave_Ports[] = {
-  {"CAN", 0x102, 0x80, 0x00, 0, 0x00, 0x00 },
-  {"CAN", 0x102, 0x80, 0x00, 1, 0xFF, 0x20 } //testowy ttl
+  {"CAN", 0x102, 0x01, 0x00, 0x00, 0x00, 0x00 },
+  {"CAN", 0x102, 0x01, 0x00, 0x01, 0xFF, 0x6d } //testowy ttl
 };