فهرست منبع

Параметры безопасного режима в mobbus

TelenkovDmitry 5 ماه پیش
والد
کامیت
d2f0b1bfe8

BIN
doc/Описание_алгоритма_определения_аварий_на_входах_выходах_модулей.docx


+ 1 - 0
fw/modules/io/analog_output.c

@@ -54,6 +54,7 @@ void ao_init(void)
     settings.ao_save[3].value = 50000;
 #endif    
     
+    // Обновление состояний LED
     // Зеленые LED сигнализируют (вкл/выкл) входов. Проверка на безопасный режим.
     if (save_mode_get())
         ao_led_update(settings.ao_save);

+ 19 - 0
fw/modules/modbus/modbus_params.c

@@ -135,6 +135,25 @@ void mb_init_params(void)
     
     index++;
     
+    // Безопасный режим работы
+    mb_param[index].reg = 0x080A;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&settings.save_mode; // 
+	mb_param[index].set = NULL;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
+    
+    // Время до перехода в безопасный режим работы
+    mb_param[index].reg = 0x080B;
+	mb_param[index].size = 1;
+	mb_param[index].param = (uint8_t*)&settings.save_delay; // 
+	mb_param[index].set = NULL;
+    mb_param[index].get = NULL;
+    mb_param[index].check_handler = mb_check_dummy;
+    
+    index++;
     
     // ---------------------------------------------------------------------- //
     // Журналы/рахивы

+ 1 - 1
fw/modules/modbus/modbus_params.h

@@ -12,7 +12,7 @@ extern "C" {
 #endif
 
 #if defined (MDIO_88)  
-#define MB_PARAM_MAX			88
+#define MB_PARAM_MAX			90
 #endif
 
 #if defined (MAI_12)  

+ 0 - 3
fw/modules/settings/settings_api.c

@@ -125,9 +125,6 @@ void settings_set_all_default(void)
 
     // Пользовательская информация. Текстовая строка.
     memset(settings.info, 0, sizeof(settings.info));
-      
-    // TODO. Для теста
-    strcpy((char*)settings.info, "Hello from MDIO!!!");
     
     settings.settings_version = SETTINGS_VERSION;
     settings.critical_section_crc = settings_get_crit_sec_crc(&settings);

BIN
output/fw.bin


+ 68 - 67
project/ewarm/iap/iap.dep

@@ -297,6 +297,7 @@
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbport.h</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbproto.h</file>
             <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\FreeRTOS-openocd.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbutils.h</file>
             <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\memmang\heap_4.c</file>
             <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\event_groups.c</file>
             <file>$PROJ_DIR$\..\..\..\shared\board\common_config.h</file>
@@ -343,7 +344,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 154 56 166 61 183 263 122 36 231 210 277 298 221 187 125 152 149 205 312 295 128 137 289 290 294 202 134 186 276 155 41 50</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 154 56 166 61 183 263 122 36 231 210 277 299 221 187 125 152 149 205 313 296 128 137 289 290 295 202 134 186 276 155 41 50</file>
                 </tool>
             </inputs>
         </file>
@@ -362,7 +363,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 107 166 183 263 122 36 231 210 277 298 221 187 125 128 137</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 107 166 183 263 122 36 231 210 277 299 221 187 125 128 137</file>
                 </tool>
             </inputs>
         </file>
@@ -381,7 +382,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 201 312 295 183 263 122 36 231 210 277 298 221 187 125 128 137 289 290 224 166 41 50</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 201 313 296 183 263 122 36 231 210 277 299 221 187 125 128 137 289 290 224 166 41 50</file>
                 </tool>
             </inputs>
         </file>
@@ -400,7 +401,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 56 166 61 183 263 122 36 231 210 277 298 221 187 125 152 149 205 312 295 128 137 289 290 294 306 41 50 104 227 155</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 56 166 61 183 263 122 36 231 210 277 299 221 187 125 152 149 205 313 296 128 137 289 290 295 307 41 50 104 227 155</file>
                 </tool>
             </inputs>
         </file>
@@ -419,7 +420,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 294 224 201 312 295 183 263 122 36 231 210 277 298 221 187 125 128 137 289 290 166 186 256 56 61 152 149 205 154 83 202 155 41 50</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 295 224 201 313 296 183 263 122 36 231 210 277 299 221 187 125 128 137 289 290 166 186 256 56 61 152 149 205 154 83 202 155 41 50</file>
                 </tool>
             </inputs>
         </file>
@@ -438,7 +439,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 185 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 185 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -457,7 +458,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -476,7 +477,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -495,7 +496,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -514,7 +515,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -533,7 +534,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -552,7 +553,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -571,7 +572,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -590,7 +591,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -609,7 +610,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -628,7 +629,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -647,7 +648,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -675,7 +676,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -694,7 +695,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -713,7 +714,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -732,7 +733,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -751,7 +752,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -770,7 +771,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -789,7 +790,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -808,7 +809,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -827,7 +828,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 136 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 136 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -846,7 +847,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -865,7 +866,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 213 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 66 155 122 136 294 183 263 36 231 210 277 298 221 187 125 128 137 149 152 224 83 166 56 61 205 312 295 289 290 107 41 50</file>
+                    <file> 213 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 66 155 122 136 295 183 263 36 231 210 277 299 221 187 125 128 137 149 152 224 83 166 56 61 205 313 296 289 290 107 41 50</file>
                 </tool>
             </inputs>
         </file>
@@ -884,7 +885,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -903,7 +904,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -922,7 +923,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -941,7 +942,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -960,7 +961,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -979,7 +980,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 296 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 297 94 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -1013,7 +1014,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 130 87 200 241 177 78 205 166 167 56 34 208 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 61 183 263 122 36 231 210 277 298 221 187 125 152 149 312 295 128 137 289 290 294 306 74 41 50 155</file>
+                    <file> 130 87 200 241 177 78 205 166 167 56 34 208 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 61 183 263 122 36 231 210 277 299 221 187 125 152 149 313 296 128 137 289 290 295 307 74 41 50 155</file>
                 </tool>
             </inputs>
         </file>
@@ -1032,7 +1033,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 183 263 87 200 241 177 78 122 130 36 231 210 277 298 221 92 187 125 128 137 149 312 295 34 208 275 190 162 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 289 290</file>
+                    <file> 183 263 87 200 241 177 78 122 130 36 231 210 277 299 221 92 187 125 128 137 149 313 296 34 208 275 190 162 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 289 290</file>
                 </tool>
             </inputs>
         </file>
@@ -1051,7 +1052,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 256 166 107</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 256 166 107</file>
                 </tool>
             </inputs>
         </file>
@@ -1070,7 +1071,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 283 287 288 186</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 283 287 288 186</file>
                 </tool>
             </inputs>
         </file>
@@ -1089,7 +1090,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 83 166 183 263 122 36 231 210 277 298 221 187 125 128 137 47</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 83 166 183 263 122 36 231 210 277 299 221 187 125 128 137 47</file>
                 </tool>
             </inputs>
         </file>
@@ -1108,7 +1109,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 66 155 87 200 241 177 78 122 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
+                    <file> 66 155 87 200 241 177 78 122 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150</file>
                 </tool>
             </inputs>
         </file>
@@ -1127,7 +1128,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 183 263 87 200 241 177 78 122 130 36 231 210 277 298 221 92 187 125 128 137 149 152 100 185 34 208 275 190 162 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 155 41 50</file>
+                    <file> 183 263 87 200 241 177 78 122 130 36 231 210 277 299 221 92 187 125 128 137 149 152 100 185 34 208 275 190 162 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 155 41 50</file>
                 </tool>
             </inputs>
         </file>
@@ -1146,7 +1147,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 66 155 122 183 263 36 231 210 277 298 221 187 125 128 137 312 295 289 290 256 166 107 104 227</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 66 155 122 183 263 36 231 210 277 299 221 187 125 128 137 313 296 289 290 256 166 107 104 227</file>
                 </tool>
             </inputs>
         </file>
@@ -1165,7 +1166,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 130 87 200 241 177 78 167 205 166 294 34 208 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 306 155 122</file>
+                    <file> 130 87 200 241 177 78 167 205 166 295 34 208 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 307 155 122</file>
                 </tool>
             </inputs>
         </file>
@@ -1184,7 +1185,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 298 221 92 187 125 128 137 152 149 312 295 34 208 275 190 162 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 289 290</file>
+                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 299 221 92 187 125 128 137 152 149 313 296 34 208 275 190 162 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 289 290</file>
                 </tool>
             </inputs>
         </file>
@@ -1203,7 +1204,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 144 276 166</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 144 276 166</file>
                 </tool>
             </inputs>
         </file>
@@ -1222,7 +1223,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 186 287 171</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 186 287 171</file>
                 </tool>
             </inputs>
         </file>
@@ -1241,7 +1242,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 295 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 122 36 231 210 277 298 221 187 125 128 137</file>
+                    <file> 296 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 122 36 231 210 277 299 221 187 125 128 137</file>
                 </tool>
             </inputs>
         </file>
@@ -1260,7 +1261,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 86</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 86</file>
                 </tool>
             </inputs>
         </file>
@@ -1279,7 +1280,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 74 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 56 166 61 183 263 122 36 231 210 277 298 221 187 125 152 149 205 312 295 128 137 289 290 294 41 50 155</file>
+                    <file> 74 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 56 166 61 183 263 122 36 231 210 277 299 221 187 125 152 149 205 313 296 128 137 289 290 295 41 50 155</file>
                 </tool>
             </inputs>
         </file>
@@ -1298,7 +1299,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 122 36 231 210 277 298 221 187 125 128 137 295 312 289 290 107 166</file>
+                    <file> 34 208 130 87 200 241 177 78 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 122 36 231 210 277 299 221 187 125 128 137 296 313 289 290 107 166</file>
                 </tool>
             </inputs>
         </file>
@@ -1317,7 +1318,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 183 263 130 36 231 210 277 298 221 92 187 125 128 137 202 172 155</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 183 263 130 36 231 210 277 299 221 92 187 125 128 137 202 172 155</file>
                 </tool>
             </inputs>
         </file>
@@ -1336,7 +1337,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 298 221 92 187 125 137</file>
+                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 299 221 92 187 125 137</file>
                 </tool>
             </inputs>
         </file>
@@ -1355,7 +1356,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 287 283 155</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 287 283 155</file>
                 </tool>
             </inputs>
         </file>
@@ -1374,7 +1375,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 183 263 87 200 241 177 78 122 130 36 231 210 277 298 221 92 187 125</file>
+                    <file> 183 263 87 200 241 177 78 122 130 36 231 210 277 299 221 92 187 125</file>
                 </tool>
             </inputs>
         </file>
@@ -1393,7 +1394,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 298 221 92 187 125 128 137</file>
+                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 299 221 92 187 125 128 137</file>
                 </tool>
             </inputs>
         </file>
@@ -1412,7 +1413,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 298 221 92 187 125 128 137 202 134</file>
+                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 299 221 92 187 125 128 137 202 134</file>
                 </tool>
             </inputs>
         </file>
@@ -1431,7 +1432,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 183 263 130 36 231 210 277 298 221 92 187 125 128 137 149</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 183 263 130 36 231 210 277 299 221 92 187 125 128 137 149</file>
                 </tool>
             </inputs>
         </file>
@@ -1450,7 +1451,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 287 283</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 287 283</file>
                 </tool>
             </inputs>
         </file>
@@ -1469,7 +1470,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 221 92 200 241 177 78 187 183 263 87 122 130 36 231 210 277 298 125 128 137</file>
+                    <file> 221 92 200 241 177 78 187 183 263 87 122 130 36 231 210 277 299 125 128 137</file>
                 </tool>
             </inputs>
         </file>
@@ -1488,7 +1489,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 287 283</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 287 283</file>
                 </tool>
             </inputs>
         </file>
@@ -1507,7 +1508,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290</file>
                 </tool>
             </inputs>
         </file>
@@ -1526,7 +1527,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 298 221 92 187 125 128 137 149 202</file>
+                    <file> 104 87 200 241 177 78 122 227 183 263 130 36 231 210 277 299 221 92 187 125 128 137 149 202</file>
                 </tool>
             </inputs>
         </file>
@@ -1545,7 +1546,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 183 263 87 200 241 177 78 122 130 36 231 210 277 298 221 92 187 125 128 137 249</file>
+                    <file> 183 263 87 200 241 177 78 122 130 36 231 210 277 299 221 92 187 125 128 137 249</file>
                 </tool>
             </inputs>
         </file>
@@ -1579,7 +1580,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 283 184 287 171</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 283 184 287 171</file>
                 </tool>
             </inputs>
         </file>
@@ -1598,7 +1599,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 287 283</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 287 283</file>
                 </tool>
             </inputs>
         </file>
@@ -1617,7 +1618,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 287 283</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 287 283</file>
                 </tool>
             </inputs>
         </file>
@@ -1649,7 +1650,7 @@
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 104 87 200 241 177 78 122 227 41 50 295 34 208 130 275 190 162 92 235 44 240 296 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 298 221 187 125 128 137 312 289 290 287 283</file>
+                    <file> 104 87 200 241 177 78 122 227 41 50 296 34 208 130 275 190 162 92 235 44 240 297 94 120 234 138 270 233 180 71 193 124 131 62 199 55 178 73 85 146 252 70 77 132 108 217 150 183 263 36 231 210 277 299 221 187 125 128 137 313 289 290 287 283</file>
                 </tool>
             </inputs>
         </file>

+ 5 - 5
project/ewarm/module_universal_io.dep

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project>
     <fileVersion>4</fileVersion>
-    <fileChecksum>3762148898</fileChecksum>
+    <fileChecksum>381657916</fileChecksum>
     <configuration>
         <name>Debug</name>
         <outputs>
@@ -759,6 +759,10 @@
         <file>
             <name>$PROJ_DIR$\..\..\fw\modules\io\analog_input.c</name>
             <outputs>
+                <tool>
+                    <name>ICCARM</name>
+                    <file> 419</file>
+                </tool>
                 <tool>
                     <name>BICOMP</name>
                     <file> 696</file>
@@ -3686,10 +3690,6 @@
                 </tool>
             </inputs>
         </file>
-        <forcedrebuild>
-            <name>$PROJ_DIR$\..\..\fw\modules\io\analog_input.c</name>
-            <tool>ICCARM</tool>
-        </forcedrebuild>
     </configuration>
     <configuration>
         <name>Release</name>

+ 1 - 1
project/ewarm/module_universal_io.ewp

@@ -225,7 +225,7 @@
                     <state>AT_START_F403A_V1</state>
                     <state>PRINTF_STDLIB</state>
                     <state>DEBUG</state>
-                    <state>MAI_12</state>
+                    <state>MDIO_88</state>
                 </option>
                 <option>
                     <name>CCPreprocFile</name>

BIN
tools/__pycache__/digital_io.cpython-312.pyc


BIN
tools/__pycache__/mb_registers.cpython-312.pyc


BIN
tools/__pycache__/sys_params.cpython-312.pyc


+ 13 - 6
tools/digital_io.py

@@ -6,7 +6,7 @@ from colorama import Fore
 from time import sleep
 import time
 from datetime import datetime, timedelta, timezone
-from mb_registers import DIO_REGS
+from mb_registers import DIO_REGS, DioReg
 from serial import Serial
 
 
@@ -20,7 +20,7 @@ class IO_Digital(IO_Module):
     '''Запрос параметров'''
     # 0x0100 - текущее состояние входов
     def get_inputs_bit(self) -> str:
-        data = self.modbus.read_holding_registers(DIO_REGS['in_bits'], 1)
+        data = self.modbus.read_holding_registers(DioReg.IN_BITS.value , 1)
         return format(data[0], '08b')
 
     # 0x0101 - 0x0110 Счетчики импульсов
@@ -187,9 +187,11 @@ def main():
 
 
     '''Тесты отдельного модуля DIO'''
-    dio.sys.get_system_vars()
+    # dio.sys.get_system_vars()
+    print(dio.sys.get_save_mode())
+    print(dio.sys.get_save_delay())
 
-    # dio.sys.set_info(b'00010000000000000000000000000000')    
+    '''Сохранить информацию о модуле'''
     # dio.sys.set_info('This is super DIO!')
 
     # dio.print_inputs()
@@ -215,12 +217,17 @@ def main():
     # for i in range(100):
     #     tester.get_load()
 
-
-
+    '''Выходы'''
+    # for i in range(100):
+    #     dio.set_outputs(0b00000001)
+    #     sleep(1)
+    #     dio.set_outputs(0b00000000)
+    #     sleep(1)
 
     '''Системные переменные и параметры'''
     # dev_tester.sys.get_system_vars()
 
+
     ''' Установить текущее время с учетом часового пояса'''
     # dev.sys.set_rtc()     
     

+ 10 - 4
tools/mb_registers.py

@@ -2,9 +2,8 @@ from enum import Enum
 
 reg_table = {'out_cur': 0x0200, 'out_mode': 0x0202, 'out_mode_save': 0x0203, 'pwm_duty': 0x0210,
              'pwm_duty_save': 0x0220, 'pwm_per': 0x0230, 'pwm_per_save': 0x0240,
-             'rtc_sinhro': 0x0804, 'uptime': 0x0801, 
-             'rtc': 0x0803, 'log_info': 0x0900, 
-             'log_ent': 0x0901, 'arch_cap': 0x0902, 'arch_ent': 0x0903, 'archive_per': 0x0904}
+             'rtc_sinhro': 0x0804, 'log_info': 0x0900, 'log_ent': 0x0901, 
+             'arch_cap': 0x0902, 'arch_ent': 0x0903, 'archive_per': 0x0904}
 
 DIO_REGS = {'in_bits': 0x0100, 'in_cnt': 0x0102,'in_mode': 0x0120, 'in_norm': 0x0122,
             'in_deb_start': 0x124, 'load_bits': 0x0130, 'cred_bits': 0x0131, 'out_cur': 0x0200}
@@ -15,6 +14,11 @@ AI_REGS = {'ain_state': 0x0300, 'ain_mode': 0x0301, 'ain_alarm': 0x0302, 'esens_
 LOG_REGS = {'log_info': 0x0900, 'log_ent': 0x0901, 'arch_cap': 0x0902, 'arch_ent': 0x0903, 'arch_per': 0x0904}
 
 
+class DioReg(Enum):
+
+    IN_BITS         = 0x0100
+
+
 class AoReg(Enum):
 
     OUT_STATE       = 0x0400 # статус выходов
@@ -41,9 +45,11 @@ class SysReg(Enum):
     PASSWORD    = 0x0090 # Пароль
     SAVE_SYS    = 0x0091 # Команда записи системных настроек
 
+    '''Системные параметры'''
     COMMAND     = 0x0800 # Команды управления
     UPTIME      = 0x0801 # Uptime
     RTC         = 0x0803 # RTC
     ERR         = 0x0807 # Состояние модуля
     INFO        = 0x0809 # Текстовая строка (пользовательская информация)
-
+    SAVE_MODE   = 0x080A # Безопасный режим работы (0-выкл, 1-вкл)
+    SAVE_DELAY  = 0x080B # Время до перехода в безопасный режим

+ 15 - 0
tools/sys_params.py

@@ -110,6 +110,12 @@ class IO_SysParams:
     def get_uptime(self):
         return self.modbus.read_uint32_holding(SysReg.UPTIME.value)
 
+    def get_save_mode(self):
+        return self.modbus.read_holding_registers(SysReg.SAVE_MODE.value, 1)[0]
+
+    def get_save_delay(self):
+        return self.modbus.read_holding_registers(SysReg.SAVE_DELAY.value, 1)[0]
+
     def get_rtc(self):
         return self.modbus.read_uint64_holding(SysReg.RTC.value)
 
@@ -126,6 +132,15 @@ class IO_SysParams:
         ascii_data.reverse()
         self.modbus.write_holding_registers_raw(SysReg.INFO.value, bytes(ascii_data))
 
+    def set_save_mode(self, value):
+        if value in [0, 1]:
+            self.modbus.write_holding_register(SysReg.SAVE_MODE.value, value)
+
+    def set_save_delay(self, value):
+        if value in range(60, 65536):
+            self.modbus.write_holding_register(SysReg.SAVE_DELAY.value, value)
+
+
 # def set_manager_register(dev: IO_Module, commands: list):
 #     foo = 0
 #     for command in commands:

+ 18 - 1
tools/tester.py

@@ -21,6 +21,21 @@ def string_to_reg(value: str):
     print(b)
 
 
+def test_value(value):
+    if value in [0, 1]:
+        print('OK')
+    else:
+        print('Value error')
+
+
+def test_range(value):
+    if value in range(60, 65536):
+        print('OK')
+    else:
+        print('Value error')
+
+
+
 def main():
     # print(time.time())
 
@@ -28,7 +43,9 @@ def main():
     #     data = format(1 << i, '16b')
     #     print(data)
 
-    string_to_reg("Hello world!!!")
+    # string_to_reg("Hello world!!!")
+    # test_value(3)
+    test_range(65536)
 
 if __name__ == '__main__':
     main()