Commit fcfe3a46 authored by MagoKimbra's avatar MagoKimbra

Merge remote-tracking branch 'refs/remotes/origin/master' into dev

parents ab8ea733 9016f36c
#ifndef Arduino_h
#define Arduino_h
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <avr/pgmspace.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include "binary.h"
#ifdef __cplusplus
extern "C"{
#endif
#define HIGH 0x1
#define LOW 0x0
#define INPUT 0x0
#define OUTPUT 0x1
#define INPUT_PULLUP 0x2
#define true 0x1
#define false 0x0
#define PI 3.1415926535897932384626433832795
#define HALF_PI 1.5707963267948966192313216916398
#define TWO_PI 6.283185307179586476925286766559
#define DEG_TO_RAD 0.017453292519943295769236907684886
#define RAD_TO_DEG 57.295779513082320876798154814105
#define SERIAL 0x0
#define DISPLAY 0x1
#define LSBFIRST 0
#define MSBFIRST 1
#define CHANGE 1
#define FALLING 2
#define RISING 3
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
#define DEFAULT 0
#define EXTERNAL 1
#define INTERNAL 2
#else
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) ||defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644P__)
#define INTERNAL1V1 2
#define INTERNAL2V56 3
#else
#define INTERNAL 3
#endif
#define DEFAULT 1
#define EXTERNAL 0
#endif
// undefine stdlib's abs if encountered
#ifdef abs
#undef abs
#endif
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x))
#define interrupts() sei()
#define noInterrupts() cli()
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
#define lowByte(w) ((uint8_t) ((w) & 0xff))
#define highByte(w) ((uint8_t) ((w) >> 8))
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
typedef unsigned int word;
#define bit(b) (1UL << (b))
typedef uint8_t boolean;
typedef uint8_t byte;
void init(void);
void pinMode(uint8_t, uint8_t);
void digitalWrite(uint8_t, uint8_t);
int digitalRead(uint8_t);
int analogRead(uint8_t);
void analogReference(uint8_t mode);
void analogWrite(uint8_t, int);
unsigned long millis(void);
unsigned long micros(void);
void delay(unsigned long);
void delayMicroseconds(unsigned int us);
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
void attachInterrupt(uint8_t, void (*)(void), int mode);
void detachInterrupt(uint8_t);
void setup(void);
void loop(void);
// Get the bit location within the hardware port of the given virtual pin.
// This comes from the pins_*.c file for the active board configuration.
#define analogInPinToBit(P) (P)
// On the ATmega1280, the addresses of some of the port registers are
// greater than 255, so we can't store them in uint8_t's.
extern const uint16_t PROGMEM port_to_mode_PGM[];
extern const uint16_t PROGMEM port_to_input_PGM[];
extern const uint16_t PROGMEM port_to_output_PGM[];
extern const uint8_t PROGMEM digital_pin_to_port_PGM[];
// extern const uint8_t PROGMEM digital_pin_to_bit_PGM[];
extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[];
extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
// Get the bit location within the hardware port of the given virtual pin.
// This comes from the pins_*.c file for the active board configuration.
//
// These perform slightly better as macros compared to inline functions
//
#define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
#define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )
#define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
#define analogInPinToBit(P) (P)
#define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )
#define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
#define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )
#define NOT_A_PIN 0
#define NOT_A_PORT 0
#ifdef ARDUINO_MAIN
#define PA 1
#define PB 2
#define PC 3
#define PD 4
#define PE 5
#define PF 6
#define PG 7
#define PH 8
#define PJ 10
#define PK 11
#define PL 12
#endif
#define NOT_ON_TIMER 0
#define TIMER0A 1
#define TIMER0B 2
#define TIMER1A 3
#define TIMER1B 4
#define TIMER2 5
#define TIMER2A 6
#define TIMER2B 7
#define TIMER3A 8
#define TIMER3B 9
#define TIMER3C 10
#define TIMER4A 11
#define TIMER4B 12
#define TIMER4C 13
#define TIMER4D 14
#define TIMER5A 15
#define TIMER5B 16
#define TIMER5C 17
#ifdef __cplusplus
} // extern "C"
#endif
#ifdef __cplusplus
#include "WCharacter.h"
#include "WString.h"
#include "HardwareSerial.h"
uint16_t makeWord(uint16_t w);
uint16_t makeWord(byte h, byte l);
#define word(...) makeWord(__VA_ARGS__)
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
void noTone(uint8_t _pin);
// WMath prototypes
long random(long);
long random(long, long);
void randomSeed(unsigned int);
long map(long, long, long, long, long);
#endif
#include "pins_arduino.h"
#endif
# See: http://code.google.com/p/arduino/wiki/Platforms
##############################################################
uno.name=Arduino Uno
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard
##############################################################
megatronics.name=Megatronics
megatronics.upload.protocol=wiring
megatronics.upload.maximum_size=258048
megatronics.upload.speed=115200
megatronics.bootloader.low_fuses=0xFF
megatronics.bootloader.high_fuses=0xD8
megatronics.bootloader.extended_fuses=0xFD
megatronics.bootloader.path=stk500v2
megatronics.bootloader.file=stk500boot_v2_mega2560.hex
megatronics.bootloader.unlock_bits=0x3F
megatronics.bootloader.lock_bits=0x0F
megatronics.build.mcu=atmega2560
megatronics.build.f_cpu=16000000L
megatronics.build.core=arduino
megatronics.build.variant=mega
##############################################################
mega1281.name=Minitronics
mega1281.upload.protocol=arduino
mega1281.upload.maximum_size=126976
mega1281.upload.speed=57600
mega1281.bootloader.low_fuses=0xFF
mega1281.bootloader.high_fuses=0xDA
mega1281.bootloader.extended_fuses=0xF5
mega1281.bootloader.path=atmega
mega1281.bootloader.file=ATmegaBOOT_168_atmega1281.hex
mega1281.bootloader.unlock_bits=0x3F
mega1281.bootloader.lock_bits=0x0F
mega1281.build.mcu=atmega1281
mega1281.build.f_cpu=16000000L
mega1281.build.core=arduino
mega1281.build.variant=minitronics
##############################################################
mega2560.name=Arduino Mega 2560 or Mega ADK
mega2560.upload.protocol=wiring
mega2560.upload.maximum_size=258048
mega2560.upload.speed=115200
mega2560.bootloader.low_fuses=0xFF
mega2560.bootloader.high_fuses=0xD8
mega2560.bootloader.extended_fuses=0xFD
mega2560.bootloader.path=stk500v2
mega2560.bootloader.file=stk500boot_v2_mega2560.hex
mega2560.bootloader.unlock_bits=0x3F
mega2560.bootloader.lock_bits=0x0F
mega2560.build.mcu=atmega2560
mega2560.build.f_cpu=16000000L
mega2560.build.core=arduino
mega2560.build.variant=mega
##############################################################
mega.name=Arduino Mega (ATmega1280)
mega.upload.protocol=arduino
mega.upload.maximum_size=126976
mega.upload.speed=57600
mega.bootloader.low_fuses=0xFF
mega.bootloader.high_fuses=0xDA
mega.bootloader.extended_fuses=0xF5
mega.bootloader.path=atmega
mega.bootloader.file=ATmegaBOOT_168_atmega1280.hex
mega.bootloader.unlock_bits=0x3F
mega.bootloader.lock_bits=0x0F
mega.build.mcu=atmega1280
mega.build.f_cpu=16000000L
mega.build.core=arduino
mega.build.variant=mega
:020000021000EC
:10F000000C9466F80C9485F80C9485F80C9485F8AB
:10F010000C9485F80C9485F80C9485F80C9485F87C
:10F020000C9485F80C9485F80C9485F80C9485F86C
:10F030000C9485F80C9485F80C9485F80C9485F85C
:10F040000C9485F80C9485F80C9485F80C9485F84C
:10F050000C9485F80C9485F80C9485F80C9485F83C
:10F060000C9485F80C9485F80C9485F80C9485F82C
:10F070000C9485F80C9485F80C9485F80C9485F81C
:10F080000C9485F80C9485F80C9485F80C9485F80C
:10F090000C9485F80C9485F80C9485F80C9485F8FC
:10F0A0000C9485F80C9485F80C9485F80C9485F8EC
:10F0B0000C9485F80C9485F80C9485F80C9485F8DC
:10F0C0000C9485F80C9485F80C9485F811241FBED7
:10F0D000CFEFD1E2DEBFCDBF12E0A0E0B2E0E6E3C9
:10F0E000F9EF01E00BBF02C007900D92A833B10702
:10F0F000D9F713E0A8E3B2E001C01D92A334B10731
:10F10000E1F70E949EF90C9499FC0C9400F8909100
:10F110003802913019F0923041F008959091C0007A
:10F1200095FFFCCF8093C60008959091C80095FF8D
:10F13000FCCF8093CE0008951F93982F95959595B9
:10F1400095959595905D182F1F701A304CF4105DB1
:10F15000892F0E9487F8812F0E9487F81F910895B8
:10F16000195A892F0E9487F8812F0E9487F81F91D2
:10F170000895EF92FF920F931F9380913802813090
:10F1800069F1823031F080E01F910F91FF90EF9094
:10F190000895EE24FF2487018091C80087FD17C0E1
:10F1A0000894E11CF11C011D111D81E4E81682E4A4
:10F1B000F8068FE0080780E0180770F3E0913A0244
:10F1C000F0913B0209958091C80087FFE9CF8091BB
:10F1D000CE001F910F91FF90EF900895EE24FF2431
:10F1E00087018091C00087FD17C00894E11CF11CC5
:10F1F000011D111D81E4E81682E4F8068FE008077E
:10F2000080E0180770F3E0913A02F0913B02099513
:10F210008091C00087FFE9CF8091C6001F910F91B8
:10F22000FF90EF9008951F930E94B9F8182F0E9445
:10F2300087F8113634F410330CF01053812F1F91DE
:10F2400008951755812F1F9108951F930E9413F958
:10F25000182F0E9413F91295107F810F1F910895A6
:10F2600020913802882339F0213031F0223061F0CA
:10F2700081508823C9F708959091C00097FFFCCF73
:10F280009091C6008150F5CF9091C80097FFFCCFB8
:10F290009091CE008150EDCF1F93182F0E94B9F8A6
:10F2A000803281F0809139028F5F809339028530FE
:10F2B00011F01F910895E0913A02F0913B020995F7
:10F2C0001F91089584E10E9487F8812F0E9487F89A
:10F2D00080E10E9487F8EDCF0E94B9F8803271F08A
:10F2E000809139028F5F80933902853009F008954B
:10F2F000E0913A02F0913B020995089584E10E9461
:10F3000087F880E10E9487F8089515C0889A2FEF4A
:10F3100031EE44E0215030404040E1F700C00000B1
:10F3200088982FEF31EE44E0215030404040E1F723
:10F3300000C000008150882349F70895EF92FF92A2
:10F340000F931F93DF93CF9300D000D0CDB7DEB7DC
:10F35000000081E08093380280E18093C400109225
:10F36000C5001092C00086E08093C20088E18093BF
:10F37000C1006898709A809A81E00E9485F90E9485
:10F38000B9F88033C1F18133C9F1803409F456C032
:10F39000813409F45AC0823459F1853409F467C0C4
:10F3A000803549F1823539F1813529F1853509F406
:10F3B00064C0863509F46CC0843609F475C084379E
:10F3C00009F4E0C0853709F43AC1863709F44BC027
:10F3D000813209F44DC1809139028F5F80933902E7
:10F3E000853069F6E0913A02F0913B020995C7CF6A
:10F3F00084E10E9430F90E946CF9C1CF0E94B9F8F3
:10F40000803249F784E10E9487F881E40E9487F8FE
:10F4100086E50E9487F882E50E9487F880E20E94D4
:10F4200087F889E40E9487F883E50E9487F880E5E1
:10F430000E9487F880E10E9487F8A1CF0E94B9F866
:10F440008638C8F20E94B9F8D6CF0E94B9F8803841
:10F4500009F430C1813809F429C1823809F43FC167
:10F46000883909F401C180E00E944CF988CF85E019
:10F470000E9430F90E946CF982CF0E94B9F8809303
:10F480003C020E94B9F880933D020E946CF977CF4C
:10F490000E94B9F8803309F411C183E00E9430F969
:10F4A00080E00E944CF96BCF0E94B9F880933F0333
:10F4B0000E94B9F880933E03809142038E7F80932F
:10F4C00042030E94B9F8853429F480914203816097
:10F4D0008093420380913E0390913F030097A1F0F7
:10F4E0006EE3E62E62E0F62E00E010E00E94B9F82E
:10F4F000D7018D937D010F5F1F4F80913E03909147
:10F500003F030817190790F30E94B9F8803209F0F9
:10F5100062CF8091420380FFF8C080913C029091BD
:10F520003D02880F991F90933D0280933C022091E9
:10F530003E0330913F0321153105E9F04EE3E42EFF
:10F5400042E0F42E00E010E0F70161917F010E949B
:10F550008BFC80913C0290913D02019690933D027C
:10F5600080933C020F5F1F4F20913E0330913F0379
:10F570000217130748F384E10E9487F880E10E9494
:10F5800087F8FDCE0E94B9F880933F030E94B9F836
:10F5900080933E0380913C0290913D0297FD2BC1E8
:10F5A000209142032D7F20934203880F991F90934F
:10F5B0003D0280933C020E94B9F8853409F415C1DC
:10F5C000809142038E7F809342030E94B9F880327B
:10F5D00009F0D5CE84E10E9487F800E010E012C067
:10F5E000E0913C02F0913D0284910E9487F8809165
:10F5F0003C0290913D02019690933D0280933C0223
:10F600000F5F1F4F80913E0390913F03081719072A
:10F6100038F58091420380FD66C081FFE1CF809183
:10F620003C0290913D02A0E0B0E080509040AF4F8E
:10F63000BF4FABBFFC0187910E9487F8D8CF0E94D3
:10F64000B9F8803209F0C7CE84E10E9487F88EE1D4
:10F650000E9487F887E90E9487F884E00E9487F873
:10F6600080E10E9487F88BCE83E00E944CF987CE20
:10F670000E94B9F8813209F082CE0E94B9F8813235
:10F6800009F07DCE809A889810924003E0E0F0E087
:10F69000E050FE4F8081882309F4BDC00E9487F8A6
:10F6A000E0914003EF5FE0934003F1CF81E00E94DF
:10F6B0004CF965CE82E00E944CF961CE0E94B9F807
:10F6C0000E94B9F8082F0E94B9F8002309F489C0F4
:10F6D000013009F496C084E00E944CF950CE80E1DC
:10F6E0000E944CF94CCE80913C0290913D020E94C8
:10F6F00083FC0E9487F880913C0290913D02019624
:10F7000090933D0280933C027BCF80913D02880F15
:10F71000880B8170809341038BBF80913C02909154
:10F720003D02880F991F90933D0280933C02809187
:10F730003E0380FF09C080913E0390913F030196F4
:10F7400090933F0380933E03F894F999FECF1127DD
:10F75000E0913C02F0913D02CEE3D2E080913E0385
:10F7600090913F03103091F40091570001700130E7
:10F77000D9F303E000935700E8950091570001701A
:10F780000130D9F301E100935700E89509901990F1
:10F790000091570001700130D9F301E00093570048
:10F7A000E8951395103898F01127009157000170D3
:10F7B0000130D9F305E000935700E8950091570018
:10F7C00001700130D9F301E100935700E8953296BA
:10F7D000029709F0C7CF103011F00296E5CF11243F
:10F7E000CACE8EE10E944CF9CACD8091420381605D
:10F7F00080934203EACE2091420322602093420389
:10F80000D4CE87E90E944CF9BACD789B77C088980E
:10F8100081E30E9487F88AE00E9487F88DE00E94C9
:10F8200087F88AE30E9487F880E20E9487F80E94A6
:10F83000B9F8082F0E9487F8043739F3023781F1AD
:10F840000737B1F0053759F0023609F440C00A36DF
:10F8500011F7E0913A02F0913B020995DCCF0E944A
:10F86000B9F80E9487F80E94B9F80E9487F8F7CF8C
:10F870000E94B9F80E9487F80E9425F9E82E0E949C
:10F8800025F9082F0E94B9F80E9487F80E9425F9EF
:10F89000EC821B82EB81FC81E00FF11D8083BBCFEA
:10F8A0000E94B9F80E9487F80E9425F9E82E0E946C
:10F8B00025F9082F8DE30E9487F8EA821982E981F1
:10F8C000FA81E00FF11D80810E949CF8A4CF82E6AE
:10F8D0000E9487F885E70E9487F883E70E9487F8EF
:10F8E00080E885BF1092740010927500E0E0F1E1AD
:10F8F00081913097E9F7E0E0F1E1FACF889A80E36F
:10F900000E9487F888CFF999FECF92BD81BDF89A01
:10F91000992780B50895262FF999FECF1FBA92BD79
:10F9200081BD20BD0FB6F894FA9AF99A0FBE0196E0
:06F930000895F894FFCFDA
:10F9360041546D656761424F4F54202F20417264D8
:10F9460075696E6F204D656761202D20284329203B
:10F9560041726475696E6F204C4C43202D203039FE
:08F96600303933300A0D008036
:040000031000F000F9
:00000001FF
/*
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 <avr/pgmspace.h>
#define NUM_DIGITAL_PINS 53
#define NUM_ANALOG_INPUTS 8
#define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
#define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))
static const uint8_t SS = 9;
static const uint8_t MOSI = 11;
static const uint8_t MISO = 12;
static const uint8_t SCK = 10;
static const uint8_t SDA = 20;
static const uint8_t SCL = 21;
static const uint8_t LED_BUILTIN = 46;
static const uint8_t A0 = 46;
static const uint8_t A1 = 47;
static const uint8_t A2 = 48;
static const uint8_t A3 = 49;
static const uint8_t A4 = 50;
static const uint8_t A5 = 51;
static const uint8_t A6 = 52;
static const uint8_t A7 = 53;
// A majority of the pins are NOT PCINTs, SO BE WARNED (i.e. you cannot use them as receive pins)
// Only pins available for RECEIVE (TRANSMIT can be on any pin):
// (I've deliberately left out pin mapping to the Hardware USARTs - seems senseless to me)
// Pins: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
#define digitalPinToPCICR(p) ( (((p) >= 10) && ((p) <= 13)) || \
(((p) >= 50) && ((p) <= 53)) || \
(((p) >= 62) && ((p) <= 69)) ? (&PCICR) : ((uint8_t *)0) )
#define digitalPinToPCICRbit(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? 0 : \
( (((p) >= 62) && ((p) <= 69)) ? 2 : \
0 ) )
#define digitalPinToPCMSK(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? (&PCMSK0) : \
( (((p) >= 62) && ((p) <= 69)) ? (&PCMSK2) : \
((uint8_t *)0) ) )
#define digitalPinToPCMSKbit(p) ( (((p) >= 10) && ((p) <= 13)) ? ((p) - 6) : \
( ((p) == 50) ? 3 : \
( ((p) == 51) ? 2 : \
( ((p) == 52) ? 1 : \
( ((p) == 53) ? 0 : \
( (((p) >= 62) && ((p) <= 69)) ? ((p) - 62) : \
0 ) ) ) ) ) )
#ifdef ARDUINO_MAIN
const uint16_t PROGMEM port_to_mode_PGM[] = {
NOT_A_PORT,
(uint16_t) &DDRA,
(uint16_t) &DDRB,
(uint16_t) &DDRC,
(uint16_t) &DDRD,
(uint16_t) &DDRE,
(uint16_t) &DDRF,
(uint16_t) &DDRG,
};
const uint16_t PROGMEM port_to_output_PGM[] = {
NOT_A_PORT,
(uint16_t) &PORTA,
(uint16_t) &PORTB,
(uint16_t) &PORTC,
(uint16_t) &PORTD,
(uint16_t) &PORTE,
(uint16_t) &PORTF,
(uint16_t) &PORTG,
};
const uint16_t PROGMEM port_to_input_PGM[] = {
NOT_A_PIN,
(uint16_t) &PINA,
(uint16_t) &PINB,
(uint16_t) &PINC,
(uint16_t) &PIND,
(uint16_t) &PINE,
(uint16_t) &PINF,
(uint16_t) &PING,
};
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
// PORTLIST
// -------------------------------------------
PE , // PE 0 ** 0 ** USART0_RX
PE , // PE 1 ** 1 ** USART0_TX
PE , // PE 4 ** 2 ** PWM0
PE , // PE 5 ** 3 ** PWM1
PG , // PG 5 ** 4 ** PWM2
PE , // PE 3 ** 5 ** PWM3
PB , // PB 4 ** 6 ** PWM4
PB , // PB 5 ** 7 ** PWM5
PB , // PB 6 ** 8 ** PWM6
PB , // PB 7 ** 9 ** PWM7
PB , // PB 1 ** 10 ** SPI_SCK
PB , // PB 2 ** 11 ** SPI_MOSI
PB , // PB 3 ** 12 ** SPI_MISO
PE , // PE 2 ** 13 ** D13
PE , // PE 6 ** 14 ** D14
PE , // PE 7 ** 15 ** D15
PB , // PB 0 ** 16 ** SPI_SS
PD , // PD 0 ** 17 ** I2C_SCL
PD , // PD 1 ** 18 ** I2C_SDA
PD , // PD 2 ** 19 ** D19
PD , // PD 3 ** 20 ** D20
PD , // PD 4 ** 21 ** D21
PD , // PA 5 ** 22 ** D22
PD , // PA 6 ** 23 ** D23
PD , // PA 7 ** 24 ** D24
PG , // PG 0 ** 25 ** D25
PG , // PG 1 ** 26 ** D26
PG , // PG 2 ** 27 ** D27
PG , // PG 3 ** 28 ** D28
PG , // PG 4 ** 29 ** D29
PC , // PC 0 ** 30 ** D30
PC , // PC 1 ** 31 ** D31
PC , // PC 2 ** 32 ** D32
PC , // PC 3 ** 33 ** D33
PC , // PC 4 ** 34 ** D34
PC , // PC 5 ** 35 ** D35
PC , // PC 6 ** 36 ** D36
PC , // PC 7 ** 37 ** D37
PA , // PA 0 ** 38 ** D38
PA , // PA 1 ** 39 ** D39
PA , // PA 2 ** 40 ** D40
PA , // PA 3 ** 41 ** D41
PA , // PA 4 ** 42 ** D42
PA , // PA 5 ** 43 ** D43
PA , // PA 6 ** 44 ** D44
PA , // PA 7 ** 45 ** D45
PF , // PF 0 ** 46 ** A0
PF , // PF 1 ** 47 ** A1
PF , // PF 2 ** 48 ** A2
PF , // PF 3 ** 49 ** A3
PF , // PF 4 ** 50 ** A4
PF , // PF 5 ** 51 ** A5
PF , // PF 6 ** 52 ** A6
PF , // PF 7 ** 53 ** A7
};
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
// PIN IN PORT
// -------------------------------------------
_BV( 0 ) , // PE 0 ** 0 ** USART0_RX
_BV( 1 ) , // PE 1 ** 1 ** USART0_TX
_BV( 4 ) , // PE 4 ** 2 ** PWM0
_BV( 5 ) , // PE 5 ** 3 ** PWM1
_BV( 5 ) , // PG 5 ** 4 ** PWM2
_BV( 3 ) , // PE 3 ** 5 ** PWM3
_BV( 4 ) , // PB 4 ** 6 ** PWM4
_BV( 5 ) , // PB 5 ** 7 ** PWM5
_BV( 6 ) , // PB 6 ** 8 ** PWM6
_BV( 7 ) , // PB 7 ** 9 ** PWM7
_BV( 1 ) , // PB 1 ** 10 ** SPI_SCK
_BV( 2 ) , // PB 2 ** 11 ** SPI_MOSI
_BV( 3 ) , // PB 3 ** 12 ** SPI_MISO
_BV( 2 ) , // PE 2 ** 13 ** D13
_BV( 6 ) , // PE 6 ** 14 ** D14
_BV( 7 ) , // PE 7 ** 15 ** D15
_BV( 0 ) , // PB 0 ** 16 ** SPI_SS
_BV( 0 ) , // PD 0 ** 17 ** I2C_SCL
_BV( 1 ) , // PD 1 ** 18 ** I2C_SDA
_BV( 2 ) , // PD 2 ** 19 ** D19
_BV( 3 ) , // PD 3 ** 20 ** D20
_BV( 4 ) , // PD 4 ** 21 ** D21
_BV( 5 ) , // PA 5 ** 22 ** D22
_BV( 6 ) , // PA 6 ** 23 ** D23
_BV( 7 ) , // PA 7 ** 24 ** D24
_BV( 0 ) , // PG 0 ** 25 ** D25
_BV( 1 ) , // PG 1 ** 26 ** D26
_BV( 2 ) , // PG 2 ** 27 ** D27
_BV( 3 ) , // PG 3 ** 28 ** D28
_BV( 4 ) , // PG 4 ** 29 ** D29
_BV( 0 ) , // PC 0 ** 30 ** D30
_BV( 1 ) , // PC 1 ** 31 ** D31
_BV( 2 ) , // PC 2 ** 32 ** D32
_BV( 3 ) , // PC 3 ** 33 ** D33
_BV( 4 ) , // PC 4 ** 34 ** D34
_BV( 5 ) , // PC 5 ** 35 ** D35
_BV( 6 ) , // PC 6 ** 36 ** D36
_BV( 7 ) , // PC 7 ** 37 ** D37
_BV( 0 ) , // PA 0 ** 38 ** D38
_BV( 1 ) , // PA 1 ** 39 ** D39
_BV( 2 ) , // PA 2 ** 40 ** D40
_BV( 3 ) , // PA 3 ** 41 ** D41
_BV( 4 ) , // PA 4 ** 42 ** D42
_BV( 5 ) , // PA 5 ** 43 ** D43
_BV( 6 ) , // PA 6 ** 44 ** D44
_BV( 7 ) , // PA 7 ** 45 ** D45
_BV( 0 ) , // PF 0 ** 46 ** A0
_BV( 1 ) , // PF 1 ** 47 ** A1
_BV( 2 ) , // PF 2 ** 48 ** A2
_BV( 3 ) , // PF 3 ** 49 ** A3
_BV( 4 ) , // PF 4 ** 50 ** A4
_BV( 5 ) , // PF 5 ** 51 ** A5
_BV( 6 ) , // PF 6 ** 52 ** A6
_BV( 7 ) , // PF 7 ** 53 ** A7
};
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
// TIMERS
// -------------------------------------------
NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX
NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX
TIMER3B , // PE 4 ** 2 ** PWM0
TIMER3C , // PE 5 ** 3 ** PWM1
TIMER0B , // PG 5 ** 4 ** PWM2
TIMER3A , // PE 3 ** 5 ** PWM3
TIMER2A , // PB 4 ** 6 ** PWM4
TIMER1A , // PB 5 ** 7 ** PWM5
TIMER1B , // PB 6 ** 8 ** PWM6
TIMER0A , // PB 7 ** 9 ** PWM7
NOT_ON_TIMER , // PB 1 ** 10 ** SPI_SCK
NOT_ON_TIMER , // PB 2 ** 11 ** SPI_MOSI
NOT_ON_TIMER , // PB 3 ** 12 ** SPI_MISO
NOT_ON_TIMER , // PE 2 ** 13 ** D13
NOT_ON_TIMER , // PE 6 ** 14 ** D14
NOT_ON_TIMER , // PE 7 ** 15 ** D15
NOT_ON_TIMER , // PB 0 ** 16 ** SPI_SS
NOT_ON_TIMER , // PD 0 ** 17 ** I2C_SCL
NOT_ON_TIMER , // PD 1 ** 18 ** I2C_SDA
NOT_ON_TIMER , // PD 2 ** 19 ** D19
NOT_ON_TIMER , // PD 3 ** 20 ** D20
NOT_ON_TIMER , // PD 4 ** 21 ** D21
NOT_ON_TIMER , // PA 5 ** 22 ** D22
NOT_ON_TIMER , // PA 6 ** 23 ** D23
NOT_ON_TIMER , // PA 7 ** 24 ** D24
NOT_ON_TIMER , // PG 0 ** 25 ** D25
NOT_ON_TIMER , // PG 1 ** 26 ** D26
NOT_ON_TIMER , // PG 2 ** 27 ** D27
NOT_ON_TIMER , // PG 3 ** 28 ** D28
NOT_ON_TIMER , // PG 4 ** 29 ** D29
NOT_ON_TIMER , // PC 0 ** 30 ** D30
NOT_ON_TIMER , // PC 1 ** 31 ** D31
NOT_ON_TIMER , // PC 2 ** 32 ** D32
NOT_ON_TIMER , // PC 3 ** 33 ** D33
NOT_ON_TIMER , // PC 4 ** 34 ** D34
NOT_ON_TIMER , // PC 5 ** 35 ** D35
NOT_ON_TIMER , // PC 6 ** 36 ** D36
NOT_ON_TIMER , // PC 7 ** 37 ** D37
NOT_ON_TIMER , // PA 0 ** 38 ** D38
NOT_ON_TIMER , // PA 1 ** 39 ** D39
NOT_ON_TIMER , // PA 2 ** 40 ** D40
NOT_ON_TIMER , // PA 3 ** 41 ** D41
NOT_ON_TIMER , // PA 4 ** 42 ** D42
NOT_ON_TIMER , // PA 5 ** 43 ** D43
NOT_ON_TIMER , // PA 6 ** 44 ** D44
NOT_ON_TIMER , // PA 7 ** 45 ** D45
NOT_ON_TIMER , // PF 0 ** 46 ** A0
NOT_ON_TIMER , // PF 1 ** 47 ** A1
NOT_ON_TIMER , // PF 2 ** 48 ** A2
NOT_ON_TIMER , // PF 3 ** 49 ** A3
NOT_ON_TIMER , // PF 4 ** 50 ** A4
NOT_ON_TIMER , // PF 5 ** 51 ** A5
NOT_ON_TIMER , // PF 6 ** 52 ** A6
NOT_ON_TIMER , // PF 7 ** 53 ** A7
};
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment