/**
 * Marlin 3D Printer Firmware
 * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
 *
 * Based on Sprinter and grbl.
 * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

/**
 * Arduino Mega with RAMPS v1.4 for Anycubic
 *
 * Defines RAMPS_D44_PIN 44
 * Defines FAN_PIN RAMPS_D44_PIN or -1
 */
 
 //Customized for Carstens Anet A8 Trigorilla Board with Original LCD+Keypad

#ifndef BOARD_NAME
  #define BOARD_NAME "Anycubic RAMPS 1.4"
#endif

#define IS_RAMPS_EFB

#include "pins_RAMPS.h"

#undef E1_STEP_PIN
#undef E1_DIR_PIN
#undef E1_ENABLE_PIN
#undef E1_CS_PIN

//SPI CS Pins for TMC2130 soldered to Servo Outputs
#define X_CS_PIN         SERVO3_PIN
#define Y_CS_PIN         SERVO2_PIN
#define Z_CS_PIN         SERVO1_PIN
#define E0_CS_PIN        SERVO0_PIN

//Custom Zonestart Wiring
#if ENABLED(ZONESTAR_LCD)
  #define LCD_PINS_RS        23
  #define LCD_PINS_ENABLE    27
  #define LCD_PINS_D4        16
  #define LCD_PINS_D5        25
  #define LCD_PINS_D6        29
  #define LCD_PINS_D7        35
  #define ADC_KEYPAD_PIN     11
  #define BTN_EN1            -1
  #define BTN_EN2            -1
  #define BTN_ENC            -1
  // pin 29 N/C
#endif // ZONESTAR_LCD

//Curstom Endstop PINS for TMC2130 Driver and using interrupts
#define X_MIN_PIN         19  //TMC2130
#define X_MAX_PIN         2   //unused
#define Y_MIN_PIN         18  //TMC2130
#define Y_MAX_PIN         15  //unused
#define Z_MIN_PIN         3   //Z Probe via Custom Redundancy Board
#define Z_MAX_PIN         14  //unused