/* pins_arduino.h - Pin definition functions for Arduino Part of Arduino - http://www.arduino.cc/ Copyright (c) 2007 David A. Mellis This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ */ #ifndef Pins_Arduino_h #define Pins_Arduino_h #include // Workaround for wrong definitions in "iom32u4.h". // This should be fixed in the AVR toolchain. #undef UHCON #undef UHINT #undef UHIEN #undef UHADDR #undef UHFNUM #undef UHFNUML #undef UHFNUMH #undef UHFLEN #undef UPINRQX #undef UPINTX #undef UPNUM #undef UPRST #undef UPCONX #undef UPCFG0X #undef UPCFG1X #undef UPSTAX #undef UPCFG2X #undef UPIENX #undef UPDATX #undef TCCR2A #undef WGM20 #undef WGM21 #undef COM2B0 #undef COM2B1 #undef COM2A0 #undef COM2A1 #undef TCCR2B #undef CS20 #undef CS21 #undef CS22 #undef WGM22 #undef FOC2B #undef FOC2A #undef TCNT2 #undef TCNT2_0 #undef TCNT2_1 #undef TCNT2_2 #undef TCNT2_3 #undef TCNT2_4 #undef TCNT2_5 #undef TCNT2_6 #undef TCNT2_7 #undef OCR2A #undef OCR2_0 #undef OCR2_1 #undef OCR2_2 #undef OCR2_3 #undef OCR2_4 #undef OCR2_5 #undef OCR2_6 #undef OCR2_7 #undef OCR2B #undef OCR2_0 #undef OCR2_1 #undef OCR2_2 #undef OCR2_3 #undef OCR2_4 #undef OCR2_5 #undef OCR2_6 #undef OCR2_7 #define NUM_DIGITAL_PINS 30 #define NUM_ANALOG_INPUTS 12 #define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) #define TXLED0 PORTD |= (1<<5) #define TXLED1 PORTD &= ~(1<<5) #define RXLED0 PORTB |= (1<<0) #define RXLED1 PORTB &= ~(1<<0) static const uint8_t SDA = 2; static const uint8_t SCL = 3; #define LED_BUILTIN 13 // Map SPI port to 'new' pins D14..D17 static const uint8_t SS = 17; static const uint8_t MOSI = 16; static const uint8_t MISO = 14; static const uint8_t SCK = 15; // Mapping of analog pins as digital I/O // A6-A11 share with digital pins static const uint8_t ADC0 = 18; static const uint8_t ADC1 = 19; static const uint8_t ADC2 = 20; static const uint8_t ADC3 = 21; static const uint8_t ADC4 = 22; static const uint8_t ADC5 = 23; static const uint8_t ADC6 = 24; // D4 static const uint8_t ADC7 = 25; // D6 static const uint8_t ADC8 = 26; // D8 static const uint8_t ADC9 = 27; // D9 static const uint8_t ADC10 = 28; // D10 static const uint8_t ADC11 = 29; // D12 #define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) #define digitalPinToPCICRbit(p) 0 #define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) #define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) // __AVR_ATmega32U4__ has an unusual mapping of pins to channels extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; #define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) #define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) #ifdef ARDUINO_MAIN // On the Arduino board, digital pins are also used // for the analog output (software PWM). Analog input // pins are a separate set. // ATMEL ATMEGA32U4 / ARDUINO LEONARDO // // D0 PD2 RXD1/INT2 // D1 PD3 TXD1/INT3 // D2 PD1 SDA SDA/INT1 // D3# PD0 PWM8/SCL OC0B/SCL/INT0 // D4 A6 PD4 ADC8 // D5# PC6 ??? OC3A/#OC4A // D6# A7 PD7 FastPWM #OC4D/ADC10 // D7 PE6 INT6/AIN0 // // D8 A8 PB4 ADC11/PCINT4 // D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 // D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 // D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 // D12 A11 PD6 T1/#OC4D/ADC9 // D13# PC7 PWM10 CLK0/OC4A // // A0 D18 PF7 ADC7 // A1 D19 PF6 ADC6 // A2 D20 PF5 ADC5 // A3 D21 PF4 ADC4 // A4 D22 PF1 ADC1 // A5 D23 PF0 ADC0 // // New pins D14..D17 to map SPI port to digital pins // // MISO D14 PB3 MISO,PCINT3 // SCK D15 PB1 SCK,PCINT1 // MOSI D16 PB2 MOSI,PCINT2 // SS D17 PB0 RXLED,SS/PCINT0 // // Connected LEDs on board for TX and RX // TXLED D24 PD5 XCK1 // RXLED D17 PB0 // HWB PE2 HWB // these arrays map port names (e.g. port B) to the // appropriate addresses for various functions (e.g. reading // and writing) const uint16_t PROGMEM port_to_mode_PGM[] = { NOT_A_PORT, NOT_A_PORT, (uint16_t) &DDRB, (uint16_t) &DDRC, (uint16_t) &DDRD, (uint16_t) &DDRE, (uint16_t) &DDRF, }; const uint16_t PROGMEM port_to_output_PGM[] = { NOT_A_PORT, NOT_A_PORT, (uint16_t) &PORTB, (uint16_t) &PORTC, (uint16_t) &PORTD, (uint16_t) &
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -43,6 +43,9 @@
 #include <stdio.h>
 #include <string.h>
 
+#ifdef _ /* fix libintl-stub */
+#undef _
+#endif
 /* gettext helper macros.  */
 #define _(Str) dgettext ("elfutils", Str)
 
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -36,7 +36,9 @@
 #include <libdw.h>
 #include <dwarf.h>
 
-
+#ifdef _ /* fix libintl-stub */
+#undef _
+#endif
 /* gettext helper macros.  */
 #define _(Str) dgettext ("elfutils", Str)
 
--- a/libdwfl/libdwflP.h
+++ b/libdwfl/libdwflP.h
@@ -46,6 +46,9 @@
 
 typedef struct Dwfl_Process Dwfl_Process;
 
+#ifdef _ /* fix libintl-stub */
+#undef _
+#endif
 /* gettext helper macros.  */
 #define _(Str) dgettext ("elfutils", Str)
 
--- a/libasm/libasmP.h
+++ b/libasm/libasmP.h
@@ -35,6 +35,9 @@
 
 #include "libdwelf.h"
 
+#ifdef _ /* fix libintl-stub */
+#undef _
+#endif
 /* gettext helper macros.  */
 #define _(Str) dgettext ("elfutils", Str)