MHVLib  20111011
An efficiency oriented runtime library for AVR microcontrollers
A:/eclipse/mhvlib/MHV_io_ArduinoMega.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2011, Make, Hack, Void Inc
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *  * Redistributions of source code must retain the above copyright
00008  *    notice, this list of conditions and the following disclaimer.
00009  *  * Redistributions in binary form must reproduce the above copyright
00010  *    notice, this list of conditions and the following disclaimer in the
00011  *    documentation and/or other materials provided with the distribution.
00012  *  * Neither the name of the Make, Hack, Void nor the
00013  *    names of its contributors may be used to endorse or promote products
00014  *    derived from this software without specific prior written permission.
00015  *
00016  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00017  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00018  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019  * DISCLAIMED. IN NO EVENT SHALL MAKE, HACK, VOID BE LIABLE FOR ANY
00020  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00021  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00022  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00023  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00024  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00025  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026  */
00027 
00028 
00029 #ifndef MHV_IO_ARDUINO_MEGA_H_
00030 #define MHV_IO_ARDUINO_MEGA_H_
00031 
00032 #include <avr/io.h>
00033 
00034 //                                                      Dir,    Output, Input,  Bit,PCINT
00035 #define MHV_ARDUINO_PIN_0       &DDRE,  &PORTE, &PINE,  0,      8       //USART0_RX
00036 #define MHV_ARDUINO_PIN_1       &DDRE,  &PORTE, &PINE,  1,      -1      //USART0_TX
00037 #define MHV_ARDUINO_PIN_2       &DDRE,  &PORTE, &PINE,  4,      -1      //PWM2
00038 #define MHV_ARDUINO_PIN_3       &DDRE,  &PORTE, &PINE,  5,      -1      //PWM3
00039 #define MHV_ARDUINO_PIN_4       &DDRG,  &PORTG, &PING,  5,      -1      //PWM4
00040 #define MHV_ARDUINO_PIN_5       &DDRE,  &PORTE, &PINE,  3,      -1      //PWM5
00041 #define MHV_ARDUINO_PIN_6       &DDRH,  &PORTH, &PINH,  3,      -1      //PWM6
00042 #define MHV_ARDUINO_PIN_7       &DDRH,  &PORTH, &PINH,  4,      -1      //PWM7
00043 #define MHV_ARDUINO_PIN_8       &DDRH,  &PORTH, &PINH,  5,      -1      //PWM8
00044 #define MHV_ARDUINO_PIN_9       &DDRH,  &PORTH, &PINH,  6,      -1      //PWM9
00045 #define MHV_ARDUINO_PIN_10      &DDRB,  &PORTB, &PINB,  4,      4       //PWM10
00046 #define MHV_ARDUINO_PIN_11      &DDRB,  &PORTB, &PINB,  5,      5       //PWM11
00047 #define MHV_ARDUINO_PIN_12      &DDRB,  &PORTB, &PINB,  6,      6       //PWM12
00048 #define MHV_ARDUINO_PIN_13      &DDRB,  &PORTB, &PINB,  7,      7       //PWM13
00049 #define MHV_ARDUINO_PIN_14      &DDRJ,  &PORTJ, &PINJ,  1,      10      //USART3_TX
00050 #define MHV_ARDUINO_PIN_15      &DDRJ,  &PORTJ, &PINJ,  0,      9       //USART3_RX
00051 #define MHV_ARDUINO_PIN_16      &DDRH,  &PORTH, &PINH,  1,      -1      //USART2_TX
00052 #define MHV_ARDUINO_PIN_17      &DDRH,  &PORTH, &PINH,  0,      -1      //USART2_RX
00053 #define MHV_ARDUINO_PIN_18      &DDRD,  &PORTD, &PIND,  3,      -1      //USART1_TX
00054 #define MHV_ARDUINO_PIN_19      &DDRD,  &PORTD, &PIND,  2,      -1      //USART1_RX
00055 #define MHV_ARDUINO_PIN_20      &DDRD,  &PORTD, &PIND,  1,      -1      //I2C_SDA
00056 #define MHV_ARDUINO_PIN_21      &DDRD,  &PORTD, &PIND,  0,      -1      //I2C_SCL
00057 #define MHV_ARDUINO_PIN_22      &DDRA,  &PORTA, &PINA,  0,      -1      //D22
00058 #define MHV_ARDUINO_PIN_23      &DDRA,  &PORTA, &PINA,  1,      -1      //D23
00059 #define MHV_ARDUINO_PIN_24      &DDRA,  &PORTA, &PINA,  2,      -1      //D24
00060 #define MHV_ARDUINO_PIN_25      &DDRA,  &PORTA, &PINA,  3,      -1      //D25
00061 #define MHV_ARDUINO_PIN_26      &DDRA,  &PORTA, &PINA,  4,      -1      //D26
00062 #define MHV_ARDUINO_PIN_27      &DDRA,  &PORTA, &PINA,  5,      -1      //D27
00063 #define MHV_ARDUINO_PIN_28      &DDRA,  &PORTA, &PINA,  6,      -1      //D28
00064 #define MHV_ARDUINO_PIN_29      &DDRA,  &PORTA, &PINA,  7,      -1      //D29
00065 #define MHV_ARDUINO_PIN_30      &DDRC,  &PORTC, &PINC,  7,      -1      //D30
00066 #define MHV_ARDUINO_PIN_31      &DDRC,  &PORTC, &PINC,  6,      -1      //D31
00067 #define MHV_ARDUINO_PIN_32      &DDRC,  &PORTC, &PINC,  5,      -1      //D32
00068 #define MHV_ARDUINO_PIN_33      &DDRC,  &PORTC, &PINC,  4,      -1      //D33
00069 #define MHV_ARDUINO_PIN_34      &DDRC,  &PORTC, &PINC,  3,      -1      //D34
00070 #define MHV_ARDUINO_PIN_35      &DDRC,  &PORTC, &PINC,  2,      -1      //D35
00071 #define MHV_ARDUINO_PIN_36      &DDRC,  &PORTC, &PINC,  1,      -1      //D36
00072 #define MHV_ARDUINO_PIN_37      &DDRC,  &PORTC, &PINC,  0,      -1      //D37
00073 #define MHV_ARDUINO_PIN_38      &DDRD,  &PORTD, &PIND,  7,      -1      //D38
00074 #define MHV_ARDUINO_PIN_39      &DDRG,  &PORTG, &PING,  2,      -1      //D39
00075 #define MHV_ARDUINO_PIN_40      &DDRG,  &PORTG, &PING,  1,      -1      //D40
00076 #define MHV_ARDUINO_PIN_41      &DDRG,  &PORTG, &PING,  0,      -1      //D41
00077 #define MHV_ARDUINO_PIN_42      &DDRL,  &PORTL, &PINL,  7,      -1      //D42
00078 #define MHV_ARDUINO_PIN_43      &DDRL,  &PORTL, &PINL,  6,      -1      //D43
00079 #define MHV_ARDUINO_PIN_44      &DDRL,  &PORTL, &PINL,  5,      -1      //D44
00080 #define MHV_ARDUINO_PIN_45      &DDRL,  &PORTL, &PINL,  4,      -1      //D45
00081 #define MHV_ARDUINO_PIN_46      &DDRL,  &PORTL, &PINL,  3,      -1      //D46
00082 #define MHV_ARDUINO_PIN_47      &DDRL,  &PORTL, &PINL,  2,      -1      //D47
00083 #define MHV_ARDUINO_PIN_48      &DDRL,  &PORTL, &PINL,  1,      -1      //D48
00084 #define MHV_ARDUINO_PIN_49      &DDRL,  &PORTL, &PINL,  0,      -1      //D49
00085 #define MHV_ARDUINO_PIN_50      &DDRB,  &PORTB, &PINB,  3,      3       //SPI_MISO
00086 #define MHV_ARDUINO_PIN_51      &DDRB,  &PORTB, &PINB,  2,      2       //SPI_MOSI
00087 #define MHV_ARDUINO_PIN_52      &DDRB,  &PORTB, &PINB,  1,      1       //SPI_SCK
00088 #define MHV_ARDUINO_PIN_53      &DDRB,  &PORTB, &PINB,  0,      0       //SPI_SS
00089 #define MHV_ARDUINO_PIN_A0      &DDRF,  &PORTF, &PINF,  0,      -1      //A0
00090 #define MHV_ARDUINO_PIN_A1      &DDRF,  &PORTF, &PINF,  1,      -1      //A1
00091 #define MHV_ARDUINO_PIN_A2      &DDRF,  &PORTF, &PINF,  2,      -1      //A2
00092 #define MHV_ARDUINO_PIN_A3      &DDRF,  &PORTF, &PINF,  3,      -1      //A3
00093 #define MHV_ARDUINO_PIN_A4      &DDRF,  &PORTF, &PINF,  4,      -1      //A4
00094 #define MHV_ARDUINO_PIN_A5      &DDRF,  &PORTF, &PINF,  5,      -1      //A5
00095 #define MHV_ARDUINO_PIN_A6      &DDRF,  &PORTF, &PINF,  6,      -1      //A6
00096 #define MHV_ARDUINO_PIN_A7      &DDRF,  &PORTF, &PINF,  7,      -1      //A7
00097 #define MHV_ARDUINO_PIN_A8      &DDRK,  &PORTK, &PINK,  0,      16      //A8
00098 #define MHV_ARDUINO_PIN_A9      &DDRK,  &PORTK, &PINK,  1,      17      //A9
00099 #define MHV_ARDUINO_PIN_A10     &DDRK,  &PORTK, &PINK,  2,      18      //A10
00100 #define MHV_ARDUINO_PIN_A11     &DDRK,  &PORTK, &PINK,  3,      19      //A11
00101 #define MHV_ARDUINO_PIN_A12     &DDRK,  &PORTK, &PINK,  4,      20      //A12
00102 #define MHV_ARDUINO_PIN_A13     &DDRK,  &PORTK, &PINK,  5,      21      //A13
00103 #define MHV_ARDUINO_PIN_A14     &DDRK,  &PORTK, &PINK,  6,      22      //A14
00104 #define MHV_ARDUINO_PIN_A15     &DDRK,  &PORTK, &PINK,  7,      23      //A15
00105 
00106 
00107 #endif /* MHV_IO_ARDUINO_MEGA_H_ */