Selaa lähdekoodia

Add Skynet/ANET A10 support

Bob-the-Kuhn 8 vuotta sitten
vanhempi
commit
9651d01e1a
41 muutettua tiedostoa jossa 3709 lisäystä ja 10 poistoa
  1. 15
    0
      Marlin/Conditionals_LCD.h
  2. 4
    1
      Marlin/SanityCheck.h
  3. 1
    0
      Marlin/boards.h
  4. 1607
    0
      Marlin/example_configurations/Anet/Configuration.h
  5. 1349
    0
      Marlin/example_configurations/Anet/Configuration_adv.h
  6. 10
    0
      Marlin/example_configurations/CL-260/Configuration.h
  7. 10
    0
      Marlin/example_configurations/Cartesio/Configuration.h
  8. 10
    0
      Marlin/example_configurations/Felix/Configuration.h
  9. 10
    0
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  10. 10
    0
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h
  11. 10
    0
      Marlin/example_configurations/Hephestos/Configuration.h
  12. 10
    0
      Marlin/example_configurations/Hephestos_2/Configuration.h
  13. 10
    0
      Marlin/example_configurations/K8200/Configuration.h
  14. 10
    0
      Marlin/example_configurations/K8400/Configuration.h
  15. 10
    0
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  16. 10
    0
      Marlin/example_configurations/M150/Configuration.h
  17. 10
    0
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  18. 10
    0
      Marlin/example_configurations/RigidBot/Configuration.h
  19. 10
    0
      Marlin/example_configurations/SCARA/Configuration.h
  20. 10
    0
      Marlin/example_configurations/TAZ4/Configuration.h
  21. 10
    0
      Marlin/example_configurations/TinyBoy2/Configuration.h
  22. 10
    0
      Marlin/example_configurations/WITBOX/Configuration.h
  23. 10
    0
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  24. 10
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h
  25. 10
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h
  26. 10
    0
      Marlin/example_configurations/delta/generic/Configuration.h
  27. 10
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  28. 10
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  29. 10
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  30. 10
    0
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h
  31. 10
    0
      Marlin/example_configurations/makibox/Configuration.h
  32. 10
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  33. 10
    0
      Marlin/example_configurations/wt150/Configuration.h
  34. 2
    0
      Marlin/pins.h
  35. 5
    0
      Marlin/pinsDebug.h
  36. 3
    0
      Marlin/pinsDebug_list.h
  37. 274
    0
      Marlin/pins_ANET_10.h
  38. 29
    1
      Marlin/temperature.cpp
  39. 8
    0
      Marlin/temperature.h
  40. 113
    7
      Marlin/ultralcd.cpp
  41. 19
    1
      Marlin/ultralcd.h

+ 15
- 0
Marlin/Conditionals_LCD.h Näytä tiedosto

@@ -46,6 +46,21 @@
46 46
     #define NEWPANEL
47 47
     #define DEFAULT_LCD_CONTRAST 17
48 48
 
49
+  #elif ENABLED(ANET_KEYPAD_LCD)
50
+
51
+    #define REPRAPWORLD_KEYPAD
52
+    #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
53
+    #define ADC_KEYPAD
54
+    #define ADC_KEY_NUM 8
55
+    #define ULTIPANEL
56
+    // this helps to implement ADC_KEYPAD menus
57
+    #define ENCODER_STEPS_PER_MENU_ITEM 1
58
+    #define REVERSE_MENU_DIRECTION
59
+
60
+  #elif ENABLED(ANET_FULL_GRAPHICS_LCD)
61
+
62
+    #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
63
+
49 64
   #elif ENABLED(BQ_LCD_SMART_CONTROLLER)
50 65
 
51 66
     #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

+ 4
- 1
Marlin/SanityCheck.h Näytä tiedosto

@@ -1102,7 +1102,7 @@ static_assert(1 >= 0
1102 1102
   #if ENABLED(MINIPANEL)
1103 1103
     + 1
1104 1104
   #endif
1105
-  #if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI)
1105
+  #if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI) && DISABLED(ANET_KEYPAD_LCD)
1106 1106
     + 1
1107 1107
   #endif
1108 1108
   #if ENABLED(RIGIDBOT_PANEL)
@@ -1138,6 +1138,9 @@ static_assert(1 >= 0
1138 1138
   #if ENABLED(OLED_PANEL_TINYBOY2)
1139 1139
     + 1
1140 1140
   #endif
1141
+  #if ENABLED(ANET_KEYPAD_LCD)
1142
+    + 1
1143
+  #endif
1141 1144
   , "Please select no more than one LCD controller option."
1142 1145
 );
1143 1146
 

+ 1
- 0
Marlin/boards.h Näytä tiedosto

@@ -59,6 +59,7 @@
59 59
 #define BOARD_MELZI_MAKR3D      66   // Melzi with ATmega1284 (MaKr3d version)
60 60
 #define BOARD_AZTEEG_X3         67   // Azteeg X3
61 61
 #define BOARD_AZTEEG_X3_PRO     68   // Azteeg X3 Pro
62
+#define BOARD_ANET_10           69   // Anet 1.0 (Melzi clone)
62 63
 #define BOARD_ULTIMAKER         7    // Ultimaker
63 64
 #define BOARD_ULTIMAKER_OLD     71   // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
64 65
 #define BOARD_ULTIMAIN_2        72   // Ultimainboard 2.x (Uses TEMP_SENSOR 20)

+ 1607
- 0
Marlin/example_configurations/Anet/Configuration.h
File diff suppressed because it is too large
Näytä tiedosto


+ 1349
- 0
Marlin/example_configurations/Anet/Configuration_adv.h
File diff suppressed because it is too large
Näytä tiedosto


+ 10
- 0
Marlin/example_configurations/CL-260/Configuration.h Näytä tiedosto

@@ -1371,6 +1371,16 @@
1371 1371
 //#define CARTESIO_UI
1372 1372
 
1373 1373
 //
1374
+// ANET_10 Controller supported displays.
1375
+//
1376
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1377
+                                  // This LCD is known to be susceptible to electrical interference
1378
+                                  // which scrambles the display.  Pressing any button clears it up.
1379
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1380
+                                  // A clone of the RepRapDiscount full graphics display but with
1381
+                                  // different pins/wiring (see pins_ANET_10.h).
1382
+
1383
+//
1374 1384
 // CONTROLLER TYPE: I2C
1375 1385
 //
1376 1386
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/Cartesio/Configuration.h Näytä tiedosto

@@ -1368,6 +1368,16 @@
1368 1368
 #define CARTESIO_UI
1369 1369
 
1370 1370
 //
1371
+// ANET_10 Controller supported displays.
1372
+//
1373
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1374
+                                  // This LCD is known to be susceptible to electrical interference
1375
+                                  // which scrambles the display.  Pressing any button clears it up.
1376
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1377
+                                  // A clone of the RepRapDiscount full graphics display but with
1378
+                                  // different pins/wiring (see pins_ANET_10.h).
1379
+
1380
+//
1371 1381
 // CONTROLLER TYPE: I2C
1372 1382
 //
1373 1383
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/Felix/Configuration.h Näytä tiedosto

@@ -1352,6 +1352,16 @@
1352 1352
 //#define CARTESIO_UI
1353 1353
 
1354 1354
 //
1355
+// ANET_10 Controller supported displays.
1356
+//
1357
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1358
+                                  // This LCD is known to be susceptible to electrical interference
1359
+                                  // which scrambles the display.  Pressing any button clears it up.
1360
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1361
+                                  // A clone of the RepRapDiscount full graphics display but with
1362
+                                  // different pins/wiring (see pins_ANET_10.h).
1363
+
1364
+//
1355 1365
 // CONTROLLER TYPE: I2C
1356 1366
 //
1357 1367
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/Felix/DUAL/Configuration.h Näytä tiedosto

@@ -1352,6 +1352,16 @@
1352 1352
 //#define CARTESIO_UI
1353 1353
 
1354 1354
 //
1355
+// ANET_10 Controller supported displays.
1356
+//
1357
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1358
+                                  // This LCD is known to be susceptible to electrical interference
1359
+                                  // which scrambles the display.  Pressing any button clears it up.
1360
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1361
+                                  // A clone of the RepRapDiscount full graphics display but with
1362
+                                  // different pins/wiring (see pins_ANET_10.h).
1363
+
1364
+//
1355 1365
 // CONTROLLER TYPE: I2C
1356 1366
 //
1357 1367
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h Näytä tiedosto

@@ -1374,6 +1374,16 @@
1374 1374
 //#define CARTESIO_UI
1375 1375
 
1376 1376
 //
1377
+// ANET_10 Controller supported displays.
1378
+//
1379
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1380
+                                  // This LCD is known to be susceptible to electrical interference
1381
+                                  // which scrambles the display.  Pressing any button clears it up.
1382
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1383
+                                  // A clone of the RepRapDiscount full graphics display but with
1384
+                                  // different pins/wiring (see pins_ANET_10.h).
1385
+
1386
+//
1377 1387
 // CONTROLLER TYPE: I2C
1378 1388
 //
1379 1389
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/Hephestos/Configuration.h Näytä tiedosto

@@ -1360,6 +1360,16 @@
1360 1360
 //#define CARTESIO_UI
1361 1361
 
1362 1362
 //
1363
+// ANET_10 Controller supported displays.
1364
+//
1365
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1366
+                                  // This LCD is known to be susceptible to electrical interference
1367
+                                  // which scrambles the display.  Pressing any button clears it up.
1368
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1369
+                                  // A clone of the RepRapDiscount full graphics display but with
1370
+                                  // different pins/wiring (see pins_ANET_10.h).
1371
+
1372
+//
1363 1373
 // CONTROLLER TYPE: I2C
1364 1374
 //
1365 1375
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/Hephestos_2/Configuration.h Näytä tiedosto

@@ -1363,6 +1363,16 @@
1363 1363
 //#define CARTESIO_UI
1364 1364
 
1365 1365
 //
1366
+// ANET_10 Controller supported displays.
1367
+//
1368
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1369
+                                  // This LCD is known to be susceptible to electrical interference
1370
+                                  // which scrambles the display.  Pressing any button clears it up.
1371
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1372
+                                  // A clone of the RepRapDiscount full graphics display but with
1373
+                                  // different pins/wiring (see pins_ANET_10.h).
1374
+
1375
+//
1366 1376
 // CONTROLLER TYPE: I2C
1367 1377
 //
1368 1378
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/K8200/Configuration.h Näytä tiedosto

@@ -1402,6 +1402,16 @@
1402 1402
 //#define CARTESIO_UI
1403 1403
 
1404 1404
 //
1405
+// ANET_10 Controller supported displays.
1406
+//
1407
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1408
+                                  // This LCD is known to be susceptible to electrical interference
1409
+                                  // which scrambles the display.  Pressing any button clears it up.
1410
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1411
+                                  // A clone of the RepRapDiscount full graphics display but with
1412
+                                  // different pins/wiring (see pins_ANET_10.h).
1413
+
1414
+//
1405 1415
 // CONTROLLER TYPE: I2C
1406 1416
 //
1407 1417
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/K8400/Configuration.h Näytä tiedosto

@@ -1370,6 +1370,16 @@
1370 1370
 //#define CARTESIO_UI
1371 1371
 
1372 1372
 //
1373
+// ANET_10 Controller supported displays.
1374
+//
1375
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1376
+                                  // This LCD is known to be susceptible to electrical interference
1377
+                                  // which scrambles the display.  Pressing any button clears it up.
1378
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1379
+                                  // A clone of the RepRapDiscount full graphics display but with
1380
+                                  // different pins/wiring (see pins_ANET_10.h).
1381
+
1382
+//
1373 1383
 // CONTROLLER TYPE: I2C
1374 1384
 //
1375 1385
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/K8400/Dual-head/Configuration.h Näytä tiedosto

@@ -1370,6 +1370,16 @@
1370 1370
 //#define CARTESIO_UI
1371 1371
 
1372 1372
 //
1373
+// ANET_10 Controller supported displays.
1374
+//
1375
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1376
+                                  // This LCD is known to be susceptible to electrical interference
1377
+                                  // which scrambles the display.  Pressing any button clears it up.
1378
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1379
+                                  // A clone of the RepRapDiscount full graphics display but with
1380
+                                  // different pins/wiring (see pins_ANET_10.h).
1381
+
1382
+//
1373 1383
 // CONTROLLER TYPE: I2C
1374 1384
 //
1375 1385
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/M150/Configuration.h Näytä tiedosto

@@ -1397,6 +1397,16 @@
1397 1397
 //#define CARTESIO_UI
1398 1398
 
1399 1399
 //
1400
+// ANET_10 Controller supported displays.
1401
+//
1402
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1403
+                                  // This LCD is known to be susceptible to electrical interference
1404
+                                  // which scrambles the display.  Pressing any button clears it up.
1405
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1406
+                                  // A clone of the RepRapDiscount full graphics display but with
1407
+                                  // different pins/wiring (see pins_ANET_10.h).
1408
+
1409
+//
1400 1410
 // CONTROLLER TYPE: I2C
1401 1411
 //
1402 1412
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Näytä tiedosto

@@ -1370,6 +1370,16 @@
1370 1370
 //#define CARTESIO_UI
1371 1371
 
1372 1372
 //
1373
+// ANET_10 Controller supported displays.
1374
+//
1375
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1376
+                                  // This LCD is known to be susceptible to electrical interference
1377
+                                  // which scrambles the display.  Pressing any button clears it up.
1378
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1379
+                                  // A clone of the RepRapDiscount full graphics display but with
1380
+                                  // different pins/wiring (see pins_ANET_10.h).
1381
+
1382
+//
1373 1383
 // CONTROLLER TYPE: I2C
1374 1384
 //
1375 1385
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/RigidBot/Configuration.h Näytä tiedosto

@@ -1370,6 +1370,16 @@
1370 1370
 //#define CARTESIO_UI
1371 1371
 
1372 1372
 //
1373
+// ANET_10 Controller supported displays.
1374
+//
1375
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1376
+                                  // This LCD is known to be susceptible to electrical interference
1377
+                                  // which scrambles the display.  Pressing any button clears it up.
1378
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1379
+                                  // A clone of the RepRapDiscount full graphics display but with
1380
+                                  // different pins/wiring (see pins_ANET_10.h).
1381
+
1382
+//
1373 1383
 // CONTROLLER TYPE: I2C
1374 1384
 //
1375 1385
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/SCARA/Configuration.h Näytä tiedosto

@@ -1382,6 +1382,16 @@
1382 1382
 //#define CARTESIO_UI
1383 1383
 
1384 1384
 //
1385
+// ANET_10 Controller supported displays.
1386
+//
1387
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1388
+                                  // This LCD is known to be susceptible to electrical interference
1389
+                                  // which scrambles the display.  Pressing any button clears it up.
1390
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1391
+                                  // A clone of the RepRapDiscount full graphics display but with
1392
+                                  // different pins/wiring (see pins_ANET_10.h).
1393
+
1394
+//
1385 1395
 // CONTROLLER TYPE: I2C
1386 1396
 //
1387 1397
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/TAZ4/Configuration.h Näytä tiedosto

@@ -1389,6 +1389,16 @@
1389 1389
 //#define CARTESIO_UI
1390 1390
 
1391 1391
 //
1392
+// ANET_10 Controller supported displays.
1393
+//
1394
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1395
+                                  // This LCD is known to be susceptible to electrical interference
1396
+                                  // which scrambles the display.  Pressing any button clears it up.
1397
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1398
+                                  // A clone of the RepRapDiscount full graphics display but with
1399
+                                  // different pins/wiring (see pins_ANET_10.h).
1400
+
1401
+//
1392 1402
 // CONTROLLER TYPE: I2C
1393 1403
 //
1394 1404
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/TinyBoy2/Configuration.h Näytä tiedosto

@@ -1426,6 +1426,16 @@
1426 1426
 //#define CARTESIO_UI
1427 1427
 
1428 1428
 //
1429
+// ANET_10 Controller supported displays.
1430
+//
1431
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1432
+                                  // This LCD is known to be susceptible to electrical interference
1433
+                                  // which scrambles the display.  Pressing any button clears it up.
1434
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1435
+                                  // A clone of the RepRapDiscount full graphics display but with
1436
+                                  // different pins/wiring (see pins_ANET_10.h).
1437
+
1438
+//
1429 1439
 // CONTROLLER TYPE: I2C
1430 1440
 //
1431 1441
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/WITBOX/Configuration.h Näytä tiedosto

@@ -1360,6 +1360,16 @@
1360 1360
 //#define CARTESIO_UI
1361 1361
 
1362 1362
 //
1363
+// ANET_10 Controller supported displays.
1364
+//
1365
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1366
+                                  // This LCD is known to be susceptible to electrical interference
1367
+                                  // which scrambles the display.  Pressing any button clears it up.
1368
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1369
+                                  // A clone of the RepRapDiscount full graphics display but with
1370
+                                  // different pins/wiring (see pins_ANET_10.h).
1371
+
1372
+//
1363 1373
 // CONTROLLER TYPE: I2C
1364 1374
 //
1365 1375
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/adafruit/ST7565/Configuration.h Näytä tiedosto

@@ -1370,6 +1370,16 @@
1370 1370
 //#define CARTESIO_UI
1371 1371
 
1372 1372
 //
1373
+// ANET_10 Controller supported displays.
1374
+//
1375
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1376
+                                  // This LCD is known to be susceptible to electrical interference
1377
+                                  // which scrambles the display.  Pressing any button clears it up.
1378
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1379
+                                  // A clone of the RepRapDiscount full graphics display but with
1380
+                                  // different pins/wiring (see pins_ANET_10.h).
1381
+
1382
+//
1373 1383
 // CONTROLLER TYPE: I2C
1374 1384
 //
1375 1385
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Näytä tiedosto

@@ -1491,6 +1491,16 @@
1491 1491
 //#define CARTESIO_UI
1492 1492
 
1493 1493
 //
1494
+// ANET_10 Controller supported displays.
1495
+//
1496
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1497
+                                  // This LCD is known to be susceptible to electrical interference
1498
+                                  // which scrambles the display.  Pressing any button clears it up.
1499
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1500
+                                  // A clone of the RepRapDiscount full graphics display but with
1501
+                                  // different pins/wiring (see pins_ANET_10.h).
1502
+
1503
+//
1494 1504
 // CONTROLLER TYPE: I2C
1495 1505
 //
1496 1506
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h Näytä tiedosto

@@ -1492,6 +1492,16 @@
1492 1492
 //#define CARTESIO_UI
1493 1493
 
1494 1494
 //
1495
+// ANET_10 Controller supported displays.
1496
+//
1497
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1498
+                                  // This LCD is known to be susceptible to electrical interference
1499
+                                  // which scrambles the display.  Pressing any button clears it up.
1500
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1501
+                                  // A clone of the RepRapDiscount full graphics display but with
1502
+                                  // different pins/wiring (see pins_ANET_10.h).
1503
+
1504
+//
1495 1505
 // CONTROLLER TYPE: I2C
1496 1506
 //
1497 1507
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/delta/generic/Configuration.h Näytä tiedosto

@@ -1481,6 +1481,16 @@
1481 1481
 //#define CARTESIO_UI
1482 1482
 
1483 1483
 //
1484
+// ANET_10 Controller supported displays.
1485
+//
1486
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1487
+                                  // This LCD is known to be susceptible to electrical interference
1488
+                                  // which scrambles the display.  Pressing any button clears it up.
1489
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1490
+                                  // A clone of the RepRapDiscount full graphics display but with
1491
+                                  // different pins/wiring (see pins_ANET_10.h).
1492
+
1493
+//
1484 1494
 // CONTROLLER TYPE: I2C
1485 1495
 //
1486 1496
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h Näytä tiedosto

@@ -1484,6 +1484,16 @@
1484 1484
 //#define CARTESIO_UI
1485 1485
 
1486 1486
 //
1487
+// ANET_10 Controller supported displays.
1488
+//
1489
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1490
+                                  // This LCD is known to be susceptible to electrical interference
1491
+                                  // which scrambles the display.  Pressing any button clears it up.
1492
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1493
+                                  // A clone of the RepRapDiscount full graphics display but with
1494
+                                  // different pins/wiring (see pins_ANET_10.h).
1495
+
1496
+//
1487 1497
 // CONTROLLER TYPE: I2C
1488 1498
 //
1489 1499
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h Näytä tiedosto

@@ -1489,6 +1489,16 @@
1489 1489
 //#define CARTESIO_UI
1490 1490
 
1491 1491
 //
1492
+// ANET_10 Controller supported displays.
1493
+//
1494
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1495
+                                  // This LCD is known to be susceptible to electrical interference
1496
+                                  // which scrambles the display.  Pressing any button clears it up.
1497
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1498
+                                  // A clone of the RepRapDiscount full graphics display but with
1499
+                                  // different pins/wiring (see pins_ANET_10.h).
1500
+
1501
+//
1492 1502
 // CONTROLLER TYPE: I2C
1493 1503
 //
1494 1504
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h Näytä tiedosto

@@ -1547,6 +1547,16 @@
1547 1547
 //#define CARTESIO_UI
1548 1548
 
1549 1549
 //
1550
+// ANET_10 Controller supported displays.
1551
+//
1552
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1553
+                                  // This LCD is known to be susceptible to electrical interference
1554
+                                  // which scrambles the display.  Pressing any button clears it up.
1555
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1556
+                                  // A clone of the RepRapDiscount full graphics display but with
1557
+                                  // different pins/wiring (see pins_ANET_10.h).
1558
+
1559
+//
1550 1560
 // CONTROLLER TYPE: I2C
1551 1561
 //
1552 1562
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h Näytä tiedosto

@@ -1386,6 +1386,16 @@
1386 1386
 //#define CARTESIO_UI
1387 1387
 
1388 1388
 //
1389
+// ANET_10 Controller supported displays.
1390
+//
1391
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1392
+                                  // This LCD is known to be susceptible to electrical interference
1393
+                                  // which scrambles the display.  Pressing any button clears it up.
1394
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1395
+                                  // A clone of the RepRapDiscount full graphics display but with
1396
+                                  // different pins/wiring (see pins_ANET_10.h).
1397
+
1398
+//
1389 1399
 // CONTROLLER TYPE: I2C
1390 1400
 //
1391 1401
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/makibox/Configuration.h Näytä tiedosto

@@ -1373,6 +1373,16 @@
1373 1373
 //#define CARTESIO_UI
1374 1374
 
1375 1375
 //
1376
+// ANET_10 Controller supported displays.
1377
+//
1378
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1379
+                                  // This LCD is known to be susceptible to electrical interference
1380
+                                  // which scrambles the display.  Pressing any button clears it up.
1381
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1382
+                                  // A clone of the RepRapDiscount full graphics display but with
1383
+                                  // different pins/wiring (see pins_ANET_10.h).
1384
+
1385
+//
1376 1386
 // CONTROLLER TYPE: I2C
1377 1387
 //
1378 1388
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration.h Näytä tiedosto

@@ -1365,6 +1365,16 @@
1365 1365
 //#define CARTESIO_UI
1366 1366
 
1367 1367
 //
1368
+// ANET_10 Controller supported displays.
1369
+//
1370
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1371
+                                  // This LCD is known to be susceptible to electrical interference
1372
+                                  // which scrambles the display.  Pressing any button clears it up.
1373
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1374
+                                  // A clone of the RepRapDiscount full graphics display but with
1375
+                                  // different pins/wiring (see pins_ANET_10.h).
1376
+
1377
+//
1368 1378
 // CONTROLLER TYPE: I2C
1369 1379
 //
1370 1380
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 10
- 0
Marlin/example_configurations/wt150/Configuration.h Näytä tiedosto

@@ -1376,6 +1376,16 @@
1376 1376
 //#define CARTESIO_UI
1377 1377
 
1378 1378
 //
1379
+// ANET_10 Controller supported displays.
1380
+//
1381
+//#define ANET_KEYPAD_LCD         // Requires ADC_KEYPAD_PIN to be assigned to an analog pin.
1382
+                                  // This LCD is known to be susceptible to electrical interference
1383
+                                  // which scrambles the display.  Pressing any button clears it up.
1384
+//#define ANET_FULL_GRAPHICS_LCD  // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
1385
+                                  // A clone of the RepRapDiscount full graphics display but with
1386
+                                  // different pins/wiring (see pins_ANET_10.h).
1387
+
1388
+//
1379 1389
 // CONTROLLER TYPE: I2C
1380 1390
 //
1381 1391
 // Note: These controllers require the installation of Arduino's LiquidCrystal_I2C

+ 2
- 0
Marlin/pins.h Näytä tiedosto

@@ -107,6 +107,8 @@
107 107
   #include "pins_AZTEEG_X3.h"
108 108
 #elif MB(AZTEEG_X3_PRO)
109 109
   #include "pins_AZTEEG_X3_PRO.h"
110
+#elif MB(ANET_10)
111
+  #include "pins_ANET_10.h"
110 112
 #elif MB(ULTIMAKER)
111 113
   #include "pins_ULTIMAKER.h"
112 114
 #elif MB(ULTIMAKER_OLD)

+ 5
- 0
Marlin/pinsDebug.h Näytä tiedosto

@@ -129,6 +129,11 @@ const PinInfo pin_array[] PROGMEM = {
129 129
   bool get_pinMode(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
130 130
 #endif
131 131
 
132
+#if defined(__AVR_ATmega1284P__)  // 1284 IDE extensions set this to the number of
133
+  #undef NUM_DIGITAL_PINS         // digital only pins while all other CPUs have it
134
+  #define NUM_DIGITAL_PINS 32     // set to digital only + digital/analog
135
+#endif
136
+
132 137
 #define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM:  %4d"), V); SERIAL_ECHO(buffer); }while(0)
133 138
 #define PWM_CASE(N,Z)                                           \
134 139
   case TIMER##N##Z:                                             \

+ 3
- 0
Marlin/pinsDebug_list.h Näytä tiedosto

@@ -29,6 +29,9 @@
29 29
 
30 30
 #line 0 // set __LINE__ to a known value for both passes
31 31
 
32
+#if PIN_EXISTS(ADC_KEYPAD) && ADC_KEYPAD_PIN < NUM_ANALOG_INPUTS
33
+  REPORT_NAME_ANALOG(ADC_KEYPAD_PIN, __LINE__ )
34
+#endif
32 35
 #if defined(__FD) && __FD >= 0
33 36
   REPORT_NAME_DIGITAL(__FD, __LINE__ )
34 37
 #endif

+ 274
- 0
Marlin/pins_ANET_10.h Näytä tiedosto

@@ -0,0 +1,274 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * Anet V1.0 board pin assignments
25
+ */
26
+
27
+/**
28
+ * Rev B    16 JUN 2017
29
+ *
30
+ * 1) no longer uses Sanguino files to define some of the pins
31
+ * 2) added pointers to useable Arduino IDE extensions
32
+ *
33
+ */
34
+
35
+/**
36
+ * The standard Arduino IDE extension (board manager) for this board
37
+ * is located at https://github.com/SkyNet3D/anet-board.
38
+ *
39
+ * Installation instructions are on that page.
40
+ *
41
+ * After copying the files to the appropriate location, restart Arduino and
42
+ * you'll see "Anet V1.0" and "Anet V1.0 (Optiboot)" in the boards list.
43
+ *
44
+ * "Anet V1.0" uses the bootloader that was installed on the board when
45
+ * it shipped from the factory.
46
+ *
47
+ * "Anet V1.0 (Optiboot)" frees up another 3K of FLASH.  You'll need to burn
48
+ * a new bootloader to the board to be able to automatically download a
49
+ * compiled image.
50
+ *
51
+ */
52
+
53
+/**
54
+ * Another usable Arduino IDE extension (board manager) can be found at
55
+ * https://github.com/Lauszus/Sanguino
56
+ *
57
+ * This extension has been tested on Arduino 1.6.12 & 1.8.0
58
+ *
59
+ * Here's the JSON path:
60
+ * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json
61
+ *
62
+ * When installing select 1.0.2
63
+ *
64
+ * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino
65
+ * Just use the above JSON URL instead of Sparkfun's JSON.
66
+ *
67
+ * Once installed select the Sanguino board and then select the CPU.
68
+ *
69
+ */
70
+
71
+/**
72
+ *  To burn a new bootloader:
73
+ *
74
+ *   1. Connect your programmer to the board.
75
+ *   2. In the Arduino IDE select the board and then select the programmer.
76
+ *   3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
77
+ *   4. The programmer is no longer needed. Remove it.
78
+ */
79
+
80
+/**
81
+ * Additional info:
82
+ *
83
+ *   Anet Schematics                    - https://github.com/ralf-e/ANET-3D-Board-V1.0
84
+ *   Wiring RRDFG Smart Controller      - http://www.thingiverse.com/thing:2103748
85
+ *   SkyNet3D Anet software development - https://github.com/SkyNet3D/Marlin/
86
+ *   Anet Users / Skynet SW on Facebook - https://www.facebook.com/skynet3ddevelopment/
87
+ *
88
+ *   Many thanks to Hans Raaf (@oderwat) for developing the Anet-specific software and supporting the Anet community.
89
+*/
90
+
91
+#if !defined(__AVR_ATmega1284P__)
92
+  #error "Oops!  Make sure you have 'Anet V1.0', 'Anet V1.0 (Optiboot)' or 'Sanguino' selected from the 'Tools -> Boards' menu."
93
+#endif
94
+
95
+#ifndef BOARD_NAME
96
+  #define BOARD_NAME "Anet"
97
+#endif
98
+
99
+#define LARGE_FLASH true
100
+
101
+//
102
+// Limit Switches
103
+//
104
+#define X_STOP_PIN         18
105
+#define Y_STOP_PIN         19
106
+#define Z_STOP_PIN         20
107
+
108
+//
109
+// Steppers
110
+//
111
+#define X_STEP_PIN         15
112
+#define X_DIR_PIN          21
113
+#define X_ENABLE_PIN       14
114
+
115
+#define Y_STEP_PIN         22
116
+#define Y_DIR_PIN          23
117
+#define Y_ENABLE_PIN       14
118
+
119
+#define Z_STEP_PIN          3
120
+#define Z_DIR_PIN           2
121
+#define Z_ENABLE_PIN       26
122
+
123
+#define E0_STEP_PIN         1
124
+#define E0_DIR_PIN          0
125
+#define E0_ENABLE_PIN      14
126
+
127
+//
128
+// Temperature Sensors
129
+//
130
+#define TEMP_0_PIN          7  // Analog Input (pin 33 extruder)
131
+#define TEMP_BED_PIN        6  // Analog Input (pin 34 bed)
132
+
133
+//
134
+// Heaters / Fans
135
+//
136
+#define HEATER_0_PIN       13  // (extruder)
137
+#define HEATER_BED_PIN     12  // (bed)
138
+#define FAN_PIN             4
139
+
140
+//
141
+// Misc. Functions
142
+//
143
+#define SDSS               31
144
+#define LED_PIN            -1
145
+
146
+/**
147
+ * LCD / Controller
148
+ *
149
+ * Only the following displays are supported:
150
+ *  ANET_KEYPAD_LCD
151
+ *  ANET_FULL_GRAPHICS_LCD
152
+ *  REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
153
+*/
154
+
155
+#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
156
+  #define LCD_SDSS           28
157
+  #if ENABLED(ADC_KEYPAD)
158
+    #define SERVO0_PIN         27 // free for BLTouch/3D-Touch
159
+    #define LCD_PINS_RS        28
160
+    #define LCD_PINS_ENABLE    29
161
+    #define LCD_PINS_D4        10
162
+    #define LCD_PINS_D5        11
163
+    #define LCD_PINS_D6        16
164
+    #define LCD_PINS_D7        17
165
+    #define BTN_EN1            -1
166
+    #define BTN_EN2            -1
167
+    #define BTN_ENC            -1
168
+    #define ADC_KEYPAD_PIN      1
169
+    #define ENCODER_FEEDRATE_DEADZONE 2
170
+  #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD)
171
+    // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics
172
+    // display using an adapter board  // https://go.aisler.net/benlye/anet-lcd-adapter/pcb
173
+    // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748
174
+    #define SERVO0_PIN         29 // free for BLTouch/3D-Touch
175
+    #define BEEPER_PIN         17
176
+    #define LCD_PINS_RS        27
177
+    #define LCD_PINS_ENABLE    28
178
+    #define LCD_PINS_D4        30
179
+    #define BTN_EN1            11
180
+    #define BTN_EN2            10
181
+    #define BTN_ENC            16
182
+    #define ST7920_DELAY_1 DELAY_0_NOP
183
+    #define ST7920_DELAY_2 DELAY_1_NOP
184
+    #define ST7920_DELAY_3 DELAY_2_NOP
185
+    #ifndef ENCODER_STEPS_PER_MENU_ITEM
186
+      #define ENCODER_STEPS_PER_MENU_ITEM 1
187
+    #endif
188
+    #ifndef ENCODER_PULSES_PER_STEP
189
+      #define ENCODER_PULSES_PER_STEP 4
190
+    #endif
191
+  #endif
192
+#endif  // ULTRA_LCD && NEWPANEL
193
+
194
+/**
195
+ * ====================================================================
196
+ * =============== Alternative RepRapDiscount Wiring ==================
197
+ * ====================================================================
198
+ *
199
+ * An alternative wiring scheme for the RepRapDiscount Full Graphics Display is
200
+ * published by oderwat on Thingiverse at https://www.thingiverse.com/thing:2103748.
201
+ *
202
+ * Using that adapter requires changing the pin definition as follows:
203
+ *   #define SERVO0_PIN        27 // free for BLTouch/3D-Touch
204
+ *   #define BEEPER_PIN        28
205
+ *   #define LCD_PINS_RS       30
206
+ *   #define LCD_PINS_ENABLE   29
207
+ *   #define LCD_PINS_D4       17
208
+ *
209
+ * The BLTouch pin becomes LCD:3
210
+ */
211
+
212
+/**
213
+ * ====================================================================
214
+ * ===================== LCD PINOUTS ==================================
215
+ * ====================================================================
216
+ *
217
+ *   Anet V1.0 controller           | ANET_KEYPAD_LCD   | ANET_FULL_      | RepRapDiscount Full      | Thingiverse RepRap wiring
218
+ *   physical   logical   alt       |                   | GRAPHICS_LCD    | Graphics Display Wiring  | http://www.thingiverse
219
+ *     pin        pin     functions |                   |                 |                          | .com/thing:2103748
220
+ *------------------------------------------------------------------------------------------------------------------------
221
+ *   ANET-J3.1    8 ***             | N/A               | J3_TX ***       |                          |
222
+ *   ANET-J3.2    9 ***             | N/A               | J3_RX ***       |                          |
223
+ *   ANET-J3.3    6       MISO      | N/A               | MISO ***        | EXP2.1   MISO            | EXP2.1   MISO
224
+ *   ANET-J3.4    +5V               | N/A               | +5V             |                          |
225
+ *   ANET-J3.5    7       SCK       | N/A               | SCK ***         | EXP2.2   SCK             | EXP2.2   SCK
226
+ *   ANET-J3.6    5       MOSI      | N/A               | MOSI ***        | EXP2.6   MOSI            | EXP2.6   MOSI
227
+ *   ANET-J3.7    !RESET            | N/A               | button          | EXP2.8   panel button    | EXP2.8   panel button
228
+ *   ANET-J3.8    GND               | N/A               | GND             | EXP2.9   GND             | EXP2.9   GND
229
+ *   ANET-J3.9    4       Don't use | N/A               | N/C             |                          |
230
+ *   ANET-J3.10   +3.3V             | N/A               | +3.3V ***       |                          |
231
+ *                                  |                   |                 |                          |
232
+ *                                  |                   |                 |                          |
233
+ *   ANET-LCD.1   GND               | GND               | GND             | EXP1.9   GND             | EXP1.9   GND
234
+ *   ANET-LCD.2   +5V               | +5V               | +5V             | EXP1.10  +5V             | EXP1.10  +5V
235
+ *   ANET-LCD.3   27      A4        | N/C *             | LCD_PINS_RS     | EXP1.4   LCD_PINS_RS     | EXP2.4   SDSS or N/C *
236
+ *   ANET-LCD.4   10                | LCD_PINS_D4       | BTN_EN2         | EXP2.3   BTN_EN2         | EXP2.3   BTN_EN2
237
+ *   ANET-LCD.5   28      A3        | LCD_PINS_RS       | LCD_PINS_ENABLE | EXP1.3   LCD_PINS_ENABLE | EXP1.1   BEEPER_PIN
238
+ *   ANET-LCD.6   11                | LCD_PINS_D5       | BTN_EN1         | EXP2.5   BTN_EN1         | EXP2.5   BTN_EN1
239
+ *   ANET-LCD.7   29      A2        | LCD_PINS_ENABLE   | N/C *           | EXP2.4   SDSS or N/C *   | EXP1.3   LCD_PINS_ENABLE
240
+ *   ANET-LCD.8   16      SCL       | LCD_PINS_D6       | BTN_ENC         | EXP1.2   BTN_ENC         | EXP1.2   BTN_ENC
241
+ *   ANET-LCD.9   30      A1        | ADC_KEYPAD_PIN ** | LCD_PINS_D4     | EXP1.5   LCD_PINS_D4     | EXP1.4   LCD_PINS_RS
242
+ *   ANET-LCD.10  17      SDA       | LCD_PINS_D7       | BEEPER_PIN      | EXP1.1   BEEPER_PIN      | EXP1.5   LCD_PINS_D4
243
+ *
244
+ *                 N/C * - if not connected to the LCD can be used for BLTouch servo input
245
+ *                 ** - analog pin -WITHOUT a pullup
246
+ *                 *** - only connected to something if the Bluetooth module is populated
247
+ */
248
+
249
+/**
250
+ *   REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
251
+ *   physical pin  function
252
+ *   EXP1.1        BEEPER
253
+ *   EXP1.2        BTN_ENC
254
+ *   EXP1.3        LCD_PINS_ENABLE
255
+ *   EXP1.4        LCD_PINS_RS
256
+ *   EXP1.5        LCD_PINS_D4
257
+ *   EXP1.6        LCD_PINS_D5 (not used)
258
+ *   EXP1.7        LCD_PINS_D6 (not used)
259
+ *   EXP1.8        LCD_PINS_D7 (not used)
260
+ *   EXP1.9        GND
261
+ *   EXP1.10       VCC
262
+ *
263
+ *
264
+ *   EXP2.1        MISO
265
+ *   EXP2.2        SCK
266
+ *   EXP2.3        BTN_EN2
267
+ *   EXP2.4        SDSS
268
+ *   EXP2.5        BTN_EN1
269
+ *   EXP2.6        MOSI
270
+ *   EXP2.7        SD_DETECT_PIN
271
+ *   EXP2.8        button
272
+ *   EXP2.9        GND
273
+ *   EXP2.10       NC
274
+ */

+ 29
- 1
Marlin/temperature.cpp Näytä tiedosto

@@ -212,6 +212,11 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
212 212
   #endif
213 213
 #endif
214 214
 
215
+#if ENABLED(ADC_KEYPAD)
216
+  uint32_t Temperature::current_ADCKey_raw = 0;
217
+  uint8_t Temperature::ADCKey_count = 0;
218
+#endif
219
+
215 220
 #if HAS_PID_HEATING
216 221
 
217 222
   void Temperature::PID_autotune(float temp, int hotend, int ncycles, bool set_result/*=false*/) {
@@ -1625,6 +1630,9 @@ void Temperature::isr() {
1625 1630
   static uint8_t pwm_count = _BV(SOFT_PWM_SCALE);
1626 1631
   // avoid multiple loads of pwm_count
1627 1632
   uint8_t pwm_count_tmp = pwm_count;
1633
+  #if ENABLED(ADC_KEYPAD)
1634
+    static unsigned int raw_ADCKey_value = 0;
1635
+  #endif
1628 1636
 
1629 1637
   // Static members for each heater
1630 1638
   #if ENABLED(SLOW_PWM_HEATERS)
@@ -1997,9 +2005,29 @@ void Temperature::isr() {
1997 2005
           raw_filwidth_value -= (raw_filwidth_value >> 7); // Subtract 1/128th of the raw_filwidth_value
1998 2006
           raw_filwidth_value += ((unsigned long)ADC << 7); // Add new ADC reading, scaled by 128
1999 2007
         }
2000
-        break;
2008
+      break;
2001 2009
     #endif
2002 2010
 
2011
+    #if ENABLED(ADC_KEYPAD)
2012
+      case Prepare_ADC_KEY:
2013
+        START_ADC(ADC_KEYPAD_PIN);
2014
+        break;
2015
+      case Measure_ADC_KEY:
2016
+        if (ADCKey_count < 16) {
2017
+          raw_ADCKey_value = ADC;
2018
+          if (raw_ADCKey_value > 900) {
2019
+            //ADC Key release
2020
+            ADCKey_count = 0;
2021
+            current_ADCKey_raw = 0;
2022
+          }
2023
+          else {
2024
+            current_ADCKey_raw += raw_ADCKey_value;
2025
+            ADCKey_count++;
2026
+          }
2027
+        }
2028
+        break;
2029
+    #endif // ADC_KEYPAD
2030
+
2003 2031
     case StartupDelay: break;
2004 2032
 
2005 2033
   } // switch(adc_sensor_state)

+ 8
- 0
Marlin/temperature.h Näytä tiedosto

@@ -81,6 +81,10 @@ enum ADCSensorState {
81 81
     Prepare_FILWIDTH,
82 82
     Measure_FILWIDTH,
83 83
   #endif
84
+  #if ENABLED(ADC_KEYPAD)
85
+    Prepare_ADC_KEY,
86
+    Measure_ADC_KEY,
87
+  #endif
84 88
   SensorsReady, // Temperatures ready. Delay the next round of readings to let ADC pins settle.
85 89
   StartupDelay  // Startup, delay initial temp reading a tiny bit so the hardware can settle
86 90
 };
@@ -272,6 +276,10 @@ class Temperature {
272 276
     #endif
273 277
 
274 278
   public:
279
+    #if ENABLED(ADC_KEYPAD)
280
+      static uint32_t current_ADCKey_raw;
281
+      static uint8_t ADCKey_count;
282
+    #endif
275 283
 
276 284
     /**
277 285
      * Instance Methods

+ 113
- 7
Marlin/ultralcd.cpp Näytä tiedosto

@@ -3997,10 +3997,53 @@ void kill_screen(const char* lcd_msg) {
3997 3997
 
3998 3998
   /**
3999 3999
    *
4000
-   * Handlers for RepRap World Keypad input
4000
+   * Handlers for Keypad input
4001 4001
    *
4002 4002
    */
4003
-  #if ENABLED(REPRAPWORLD_KEYPAD)
4003
+  #if ENABLED(ADC_KEYPAD)
4004
+
4005
+    inline void handle_adc_keypad() {
4006
+      static uint8_t adc_steps = 0;
4007
+      if (buttons_reprapworld_keypad) {
4008
+        adc_steps++;
4009
+        NOMORE(adc_steps, 20);
4010
+
4011
+        lcd_quick_feedback();
4012
+        lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
4013
+        return_to_status_ms = millis() + LCD_TIMEOUT_TO_STATUS;
4014
+        if (encoderDirection == -1) { // side effect which signals we are inside a menu
4015
+          if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN)
4016
+            encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM;
4017
+          else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP)
4018
+            encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;
4019
+          else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT)
4020
+            menu_action_back();
4021
+          else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT)
4022
+            // enqueue_and_echo_commands_P(PSTR("M0 Pause"));
4023
+            lcd_return_to_status();
4024
+        }
4025
+        else {
4026
+          const int8_t step = adc_steps > 19 ? 100 : adc_steps > 10 ? 10 : 1;
4027
+          if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN)
4028
+            encoderPosition += ENCODER_PULSES_PER_STEP * step;
4029
+          else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP)
4030
+            encoderPosition -= ENCODER_PULSES_PER_STEP * step;
4031
+          else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT)
4032
+            encoderPosition = 0;
4033
+        }
4034
+        #if ENABLED(ADC_KEYPAD_DEBUG)
4035
+          SERIAL_PROTOCOLLNPAIR("buttons_reprapworld_keypad = ", (uint32_t)buttons_reprapworld_keypad);
4036
+          SERIAL_PROTOCOLLNPAIR("encoderPosition = ", (uint32_t)encoderPosition);
4037
+        #endif
4038
+      }
4039
+      else if (!thermalManager.current_ADCKey_raw) {
4040
+        // reset stepping acceleration
4041
+        adc_steps = 0;
4042
+      }
4043
+    }
4044
+
4045
+  #elif ENABLED(REPRAPWORLD_KEYPAD)
4046
+
4004 4047
     void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) {
4005 4048
       move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
4006 4049
       encoderPosition = dir;
@@ -4111,7 +4154,7 @@ void lcd_init() {
4111 4154
       SET_INPUT_PULLUP(BTN_ENC);
4112 4155
     #endif
4113 4156
 
4114
-    #if ENABLED(REPRAPWORLD_KEYPAD)
4157
+    #if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(ADC_KEYPAD)
4115 4158
       SET_OUTPUT(SHIFT_CLK);
4116 4159
       OUT_WRITE(SHIFT_LD, HIGH);
4117 4160
       SET_INPUT_PULLUP(SHIFT_OUT);
@@ -4291,8 +4334,14 @@ void lcd_update() {
4291 4334
         slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context
4292 4335
       #endif
4293 4336
 
4294
-      #if ENABLED(REPRAPWORLD_KEYPAD)
4337
+      #if ENABLED(ADC_KEYPAD)
4338
+
4339
+        handle_adc_keypad();
4340
+
4341
+      #elif ENABLED(REPRAPWORLD_KEYPAD)
4342
+
4295 4343
         handle_reprapworld_keypad();
4344
+
4296 4345
       #endif
4297 4346
 
4298 4347
       bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
@@ -4305,10 +4354,10 @@ void lcd_update() {
4305 4354
             if (encoderRateMultiplierEnabled) {
4306 4355
               int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP;
4307 4356
 
4308
-              if (lastEncoderMovementMillis != 0) {
4357
+              if (lastEncoderMovementMillis) {
4309 4358
                 // Note that the rate is always calculated between two passes through the
4310 4359
                 // loop and that the abs of the encoderDiff value is tracked.
4311
-                float encoderStepRate = (float)(encoderMovementSteps) / ((float)(ms - lastEncoderMovementMillis)) * 1000.0;
4360
+                float encoderStepRate = float(encoderMovementSteps) / float(ms - lastEncoderMovementMillis) * 1000.0;
4312 4361
 
4313 4362
                 if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC)     encoderMultiplier = 100;
4314 4363
                 else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
@@ -4378,6 +4427,11 @@ void lcd_update() {
4378 4427
               break;
4379 4428
           } // switch
4380 4429
         }
4430
+
4431
+      #if ENABLED(ADC_KEYPAD)
4432
+        buttons_reprapworld_keypad = 0;
4433
+      #endif
4434
+
4381 4435
       #if ENABLED(ULTIPANEL)
4382 4436
         #define CURRENTSCREEN() (*currentScreen)(), lcd_clicked = false
4383 4437
       #else
@@ -4625,9 +4679,23 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
4625 4679
         #if ENABLED(LCD_HAS_SLOW_BUTTONS)
4626 4680
           buttons |= slow_buttons;
4627 4681
         #endif
4628
-        #if ENABLED(REPRAPWORLD_KEYPAD)
4682
+
4683
+        #if ENABLED(ADC_KEYPAD)
4684
+
4685
+          uint8_t newbutton_reprapworld_keypad = 0;
4686
+          buttons = 0;
4687
+          if (buttons_reprapworld_keypad == 0) {
4688
+            newbutton_reprapworld_keypad = get_ADC_keyValue();
4689
+            if (WITHIN(newbutton_reprapworld_keypad, 1, 8))
4690
+              buttons_reprapworld_keypad = _BV(newbutton_reprapworld_keypad - 1);
4691
+          }
4692
+
4693
+        #elif ENABLED(REPRAPWORLD_KEYPAD)
4694
+
4629 4695
           GET_BUTTON_STATES(buttons_reprapworld_keypad);
4696
+
4630 4697
         #endif
4698
+
4631 4699
       #else
4632 4700
         GET_BUTTON_STATES(buttons);
4633 4701
       #endif // !NEWPANEL
@@ -4693,4 +4761,42 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
4693 4761
 
4694 4762
 #endif // ULTIPANEL
4695 4763
 
4764
+#if ENABLED(ADC_KEYPAD)
4765
+
4766
+  typedef struct {
4767
+    uint16_t ADCKeyValueMin, ADCKeyValueMax;
4768
+    uint8_t  ADCKeyNo;
4769
+  } _stADCKeypadTable_;
4770
+
4771
+  static const _stADCKeypadTable_ stADCKeyTable[] = PROGMEM {
4772
+    // VALUE_MIN, VALUE_MAX, KEY
4773
+    { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F1 + 1 },     // F1
4774
+    { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F2 + 1 },     // F2
4775
+    { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F3 + 1 },     // F3
4776
+    {  300,  500, BLEN_REPRAPWORLD_KEYPAD_LEFT + 1 },   // LEFT
4777
+    { 1900, 2200, BLEN_REPRAPWORLD_KEYPAD_RIGHT + 1 },  // RIGHT
4778
+    {  570,  870, BLEN_REPRAPWORLD_KEYPAD_UP + 1 },     // UP
4779
+    { 2670, 2870, BLEN_REPRAPWORLD_KEYPAD_DOWN + 1 },   // DOWN
4780
+    { 1150, 1450, BLEN_REPRAPWORLD_KEYPAD_MIDDLE + 1 }, // ENTER
4781
+  };
4782
+
4783
+  uint8_t get_ADC_keyValue(void) {
4784
+    if (thermalManager.ADCKey_count >= 16) {
4785
+      const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw >> 2;
4786
+      #if ENABLED(ADC_KEYPAD_DEBUG)
4787
+        SERIAL_PROTOCOLLN(currentkpADCValue);
4788
+      #endif
4789
+      thermalManager.current_ADCKey_raw = 0;
4790
+      thermalManager.ADCKey_count = 0;
4791
+      if (currentkpADCValue < 4000)
4792
+        for (uint8_t i = 0; i < ADC_KEY_NUM; i++) {
4793
+          const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin),
4794
+                         hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax);
4795
+          if (WITHIN(currentkpADCValue, lo, hi)) return pgm_read_byte(&stADCKeyTable[i].ADCKeyNo);
4796
+        }
4797
+    }
4798
+    return 0;
4799
+  }
4800
+#endif
4801
+
4696 4802
 #endif // ULTRA_LCD

+ 19
- 1
Marlin/ultralcd.h Näytä tiedosto

@@ -57,6 +57,10 @@
57 57
     void dontExpireStatus();
58 58
   #endif
59 59
 
60
+  #if ENABLED(ADC_KEYPAD)
61
+    uint8_t get_ADC_keyValue();
62
+  #endif
63
+
60 64
   #if ENABLED(DOGLCD)
61 65
     extern uint16_t lcd_contrast;
62 66
     void set_lcd_contrast(const uint16_t value);
@@ -130,6 +134,21 @@
130 134
     #define REPRAPWORLD_KEYPAD_MOVE_Y_UP    (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP)
131 135
     #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT  (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT)
132 136
 
137
+    #if ENABLED(ADC_KEYPAD)
138
+      #define REPRAPWORLD_KEYPAD_MOVE_HOME  (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1)
139
+      #define KEYPAD_EN_C                   EN_REPRAPWORLD_KEYPAD_MIDDLE
140
+    #else
141
+      #define REPRAPWORLD_KEYPAD_MOVE_HOME  (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE)
142
+      #define KEYPAD_EN_C                   EN_REPRAPWORLD_KEYPAD_F1
143
+    #endif
144
+    #define REPRAPWORLD_KEYPAD_MOVE_MENU    (buttons_reprapworld_keypad & KEYPAD_EN_C)
145
+
146
+    #if BUTTON_EXISTS(ENC)
147
+      #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU)
148
+    #else
149
+      #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU
150
+    #endif
151
+
133 152
     #define REPRAPWORLD_KEYPAD_PRESSED      (buttons_reprapworld_keypad & ( \
134 153
                                               EN_REPRAPWORLD_KEYPAD_F3 | \
135 154
                                               EN_REPRAPWORLD_KEYPAD_F2 | \
@@ -141,7 +160,6 @@
141 160
                                               EN_REPRAPWORLD_KEYPAD_LEFT) \
142 161
                                             )
143 162
 
144
-    #define LCD_CLICKED ((buttons & EN_C) || (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1))
145 163
   #elif ENABLED(NEWPANEL)
146 164
     #define LCD_CLICKED (buttons & EN_C)
147 165
   #else

Loading…
Peruuta
Tallenna