Prusa MINI Firmware overview
pinsDebug_Teensyduino.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19 #pragma once
20 
21 //
22 // some of the pin mapping functions of the Teensduino extension to the Arduino IDE
23 // do not function the same as the other Arduino extensions
24 //
25 
26 
27 #define TEENSYDUINO_IDE
28 
29 //digitalPinToTimer(pin) function works like Arduino but Timers are not defined
30 #define TIMER0B 1
31 #define TIMER1A 7
32 #define TIMER1B 8
33 #define TIMER1C 9
34 #define TIMER2A 6
35 #define TIMER2B 2
36 #define TIMER3A 5
37 #define TIMER3B 4
38 #define TIMER3C 3
39 
40 // digitalPinToPort function just returns the pin number so need to create our own
41 #define PA 1
42 #define PB 2
43 #define PC 3
44 #define PD 4
45 #define PE 5
46 #define PF 6
47 
48 #undef digitalPinToPort
49 
51  PD, // 0 - PD0 - INT0 - PWM
52  PD, // 1 - PD1 - INT1 - PWM
53  PD, // 2 - PD2 - INT2 - RX
54  PD, // 3 - PD3 - INT3 - TX
55  PD, // 4 - PD4
56  PD, // 5 - PD5
57  PD, // 6 - PD6
58  PD, // 7 - PD7
59  PE, // 8 - PE0
60  PE, // 9 - PE1
61  PC, // 10 - PC0
62  PC, // 11 - PC1
63  PC, // 12 - PC2
64  PC, // 13 - PC3
65  PC, // 14 - PC4 - PWM
66  PC, // 15 - PC5 - PWM
67  PC, // 16 - PC6 - PWM
68  PC, // 17 - PC7
69  PE, // 18 - PE6 - INT6
70  PE, // 19 - PE7 - INT7
71  PB, // 20 - PB0
72  PB, // 21 - PB1
73  PB, // 22 - PB2
74  PB, // 23 - PB3
75  PB, // 24 - PB4 - PWM
76  PB, // 25 - PB5 - PWM
77  PB, // 26 - PB6 - PWM
78  PB, // 27 - PB7 - PWM
79  PA, // 28 - PA0
80  PA, // 29 - PA1
81  PA, // 30 - PA2
82  PA, // 31 - PA3
83  PA, // 32 - PA4
84  PA, // 33 - PA5
85  PA, // 34 - PA6
86  PA, // 35 - PA7
87  PE, // 36 - PE4 - INT4
88  PE, // 37 - PE5 - INT5
89  PF, // 38 - PF0 - A0
90  PF, // 39 - PF1 - A1
91  PF, // 40 - PF2 - A2
92  PF, // 41 - PF3 - A3
93  PF, // 42 - PF4 - A4
94  PF, // 43 - PF5 - A5
95  PF, // 44 - PF6 - A6
96  PF, // 45 - PF7 - A7
97  PE, // 46 - PE2 (not defined in teensyduino)
98  PE, // 47 - PE3 (not defined in teensyduino)
99 };
100 
101 #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
102 
103 // digitalPinToBitMask(pin) is OK
104 
105 #define digitalRead_mod(p) extDigitalRead(p) // Teensyduino's version of digitalRead doesn't
106  // disable the PWMs so we can use it as is
107 
108 // portModeRegister(pin) is OK
PB
#define PB
Definition: pinsDebug_Teensyduino.h:42
PD
#define PD
Definition: pinsDebug_Teensyduino.h:44
PROGMEM
#define PROGMEM
Definition: pgmspace.h:29
PF
#define PF
Definition: pinsDebug_Teensyduino.h:46
uint8_t
const uint8_t[]
Definition: 404_html.c:3
PA
#define PA
Definition: pinsDebug_Teensyduino.h:41
digital_pin_to_port_PGM
const uint8_t PROGMEM digital_pin_to_port_PGM[]
Definition: pinsDebug_Teensyduino.h:50
PE
#define PE
Definition: pinsDebug_Teensyduino.h:45
PC
#define PC
Definition: pinsDebug_Teensyduino.h:43