Blame | Last modification | View Log | RSS feed
/*** Marlin 3D Printer Firmware* Copyright (C) 2017 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/>.**///// some of the pin mapping functions of the Teensduino extension to the Arduino IDE// do not function the same as the other Arduino extensions//#ifndef __PINSDEBUG_TEENSYDUINO_H__#define __PINSDEBUG_TEENSYDUINO_H__#undef NUM_DIGITAL_PINS#define NUM_DIGITAL_PINS 48 // Teensy says 46 but FASTIO is 48// "digitalPinToPort" function just returns the pin number so need to create our own.// Can't use the name "digitalPinToPort" for our own because it interferes with the// FAST_PWM_FAN function if we do#define PA 1#define PB 2#define PC 3#define PD 4#define PE 5#define PF 6const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {PD, // 0 - PD0 - INT0 - PWMPD, // 1 - PD1 - INT1 - PWMPD, // 2 - PD2 - INT2 - RXPD, // 3 - PD3 - INT3 - TXPD, // 4 - PD4PD, // 5 - PD5PD, // 6 - PD6PD, // 7 - PD7PE, // 8 - PE0PE, // 9 - PE1PC, // 10 - PC0PC, // 11 - PC1PC, // 12 - PC2PC, // 13 - PC3PC, // 14 - PC4 - PWMPC, // 15 - PC5 - PWMPC, // 16 - PC6 - PWMPC, // 17 - PC7PE, // 18 - PE6 - INT6PE, // 19 - PE7 - INT7PB, // 20 - PB0PB, // 21 - PB1PB, // 22 - PB2PB, // 23 - PB3PB, // 24 - PB4 - PWMPB, // 25 - PB5 - PWMPB, // 26 - PB6 - PWMPB, // 27 - PB7 - PWMPA, // 28 - PA0PA, // 29 - PA1PA, // 30 - PA2PA, // 31 - PA3PA, // 32 - PA4PA, // 33 - PA5PA, // 34 - PA6PA, // 35 - PA7PE, // 36 - PE4 - INT4PE, // 37 - PE5 - INT5PF, // 38 - PF0 - A0PF, // 39 - PF1 - A1PF, // 40 - PF2 - A2PF, // 41 - PF3 - A3PF, // 42 - PF4 - A4PF, // 43 - PF5 - A5PF, // 44 - PF6 - A6PF, // 45 - PF7 - A7PE, // 46 - PE2 (not defined in teensyduino)PE, // 47 - PE3 (not defined in teensyduino)};#define digitalPinToPort_Teensy(P) ( pgm_read_byte( digital_pin_to_port_PGM_Teensy + (P) ) )// digitalPinToBitMask(pin) is OK#define digitalRead_mod(p) digitalRead(p) // Teensyduino's version of digitalRead doesn't// disable the PWMs so we can use it as is// portModeRegister(pin) is OK#endif // __PINSDEBUG_TEENSYDUINO_H__