Merge pull request #467 from kiyoshigawa/Marlin_v1

Support for Elefu RA Board
This commit is contained in:
ErikZalm 2013-06-08 10:01:53 -07:00
commit e36d31a3b7
3 changed files with 898 additions and 748 deletions

View File

@ -48,6 +48,7 @@
// 90 = Alpha OMCA board
// 91 = Final OMCA board
// 301 = Rambo
// 21 = Elefu Ra Board (v3)
#ifndef MOTHERBOARD
#define MOTHERBOARD 7
@ -361,6 +362,11 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
//#define REPRAPWORLD_KEYPAD
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
// The Elefu RA Board Control Panel
// http://www.elefu.com/index.php?route=product/product&product_id=53
// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARUDINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
//#define RA_CONTROL_PANEL
//automatic expansion
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD
@ -377,6 +383,12 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
#define NEWPANEL
#define ULTIPANEL
#endif
#if defined(RA_CONTROL_PANEL)
#define ULTIPANEL
#define NEWPANEL
#define LCD_I2C_TYPE_PCA8574
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
#endif
//I2C PANELS

View File

@ -53,6 +53,7 @@
#endif /* 99 */
/****************************************************************************************
* Gen7 v1.1, v1.2, v1.3 pin assignment
*
@ -571,6 +572,131 @@
#endif
/****************************************************************************************
* Elefu RA Board Pin Assignments
*
****************************************************************************************/
#if MOTHERBOARD == 21
#define KNOWN_BOARD 1
#ifndef __AVR_ATmega2560__
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
#endif
#define X_STEP_PIN 49
#define X_DIR_PIN 13
#define X_ENABLE_PIN 48
#define X_MIN_PIN 35
#define X_MAX_PIN -1 //34
#define Y_STEP_PIN 11
#define Y_DIR_PIN 9
#define Y_ENABLE_PIN 12
#define Y_MIN_PIN 33
#define Y_MAX_PIN -1 //32
#define Z_STEP_PIN 7
#define Z_DIR_PIN 6
#define Z_ENABLE_PIN 8
#define Z_MIN_PIN 31
#define Z_MAX_PIN -1 //30
#define E2_STEP_PIN 43
#define E2_DIR_PIN 47
#define E2_ENABLE_PIN 42
#define E1_STEP_PIN 18
#define E1_DIR_PIN 19
#define E1_ENABLE_PIN 38
#define E0_STEP_PIN 40
#define E0_DIR_PIN 41
#define E0_ENABLE_PIN 37
#define SDPOWER -1
#define LED_PIN -1 //Use +12V Aux port for LED Ring
#define FAN_PIN 16 //5V PWM
#define PS_ON_PIN 10 //Set to -1 if using a manual switch on the PWRSW Connector
#define SLEEP_WAKE_PIN 26 //This feature still needs work
#define HEATER_0_PIN 45 //12V PWM1
#define HEATER_1_PIN 46 //12V PWM2
#define HEATER_2_PIN 17 //12V PWM3
#define HEATER_BED_PIN 44 //DOUBLE 12V PWM
#define TEMP_0_PIN 3 //ANALOG NUMBERING
#define TEMP_1_PIN 2 //ANALOG NUMBERING
#define TEMP_2_PIN 1 //ANALOG NUMBERING
#define TEMP_BED_PIN 0 //ANALOG NUMBERING
#define BEEPER 36
#define KILL_PIN -1
// M240 Triggers a camera by emulating a Canon RC-1 Remote
// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
#define PHOTOGRAPH_PIN 29
#ifdef RA_CONTROL_PANEL
#define SDSS 53
#define SDCARDDETECT 28
#define BTN_EN1 14
#define BTN_EN2 39
#define BTN_ENC 15 //the click
#define BLEN_C 2
#define BLEN_B 1
#define BLEN_A 0
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif //RA_CONTROL_PANEL
#ifdef RA_DISCO
//variables for which pins the TLC5947 is using
#define TLC_CLOCK_PIN 25
#define TLC_BLANK_PIN 23
#define TLC_XLAT_PIN 22
#define TLC_DATA_PIN 24
//We also need to define pin to port number mapping for the 2560 to match the pins listed above. If you change the TLC pins, update this as well per the 2560 datasheet!
//This currently only works with the RA Board.
#define TLC_CLOCK_BIT 3 //bit 3 on port A
#define TLC_CLOCK_PORT &PORTA //bit 3 on port A
#define TLC_BLANK_BIT 1 //bit 1 on port A
#define TLC_BLANK_PORT &PORTA //bit 1 on port A
#define TLC_DATA_BIT 2 //bit 2 on port A
#define TLC_DATA_PORT &PORTA //bit 2 on port A
#define TLC_XLAT_BIT 0 //bit 0 on port A
#define TLC_XLAT_PORT &PORTA //bit 0 on port A
//change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful
//Leave it at at least 1 if you have enabled RA_LIGHTING
//The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module.
#define NUM_TLCS 2
//These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions.
//Modify them according to your specific situation.
//NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs.
#define TRANS_ARRAY {0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8} //forwards
//#define TRANS_ARRAY {7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15} //backwards
#endif //RA_LIGHTING
#endif /* Ra Board */
/****************************************************************************************
* Gen6 pin assignment
*
@ -1847,3 +1973,6 @@
_E0_PINS _E1_PINS _E2_PINS \
analogInputToDigitalPin(TEMP_0_PIN), analogInputToDigitalPin(TEMP_1_PIN), analogInputToDigitalPin(TEMP_2_PIN), analogInputToDigitalPin(TEMP_BED_PIN) }
#endif

View File

@ -181,6 +181,11 @@ extern volatile uint16_t buttons; //an extended version of the last checked but
#define LCD_CLASS LiquidTWI2
LCD_CLASS lcd(LCD_I2C_ADDRESS);
#elif defined(LCD_I2C_TYPE_PCA8574)
#include <LiquidCrystal_I2C.h>
#define LCD_CLASS LiquidCrystal_I2C
LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
#else
// Standard directly connected LCD implementations
#if LANGUAGE_CHOICE == 6
@ -306,6 +311,10 @@ static void lcd_implementation_init()
lcd.setMCPType(LTI_TYPE_MCP23008);
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#elif defined(LCD_I2C_TYPE_PCA8574)
lcd.init();
lcd.backlight();
#else
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif