parent
efd5658e32
commit
4683645036
@ -0,0 +1,284 @@
|
||||
# See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
||||
# See: http://code.google.com/p/arduino/wiki/Platforms
|
||||
|
||||
##############################################################
|
||||
|
||||
menu.cpu=Processor
|
||||
|
||||
########################################
|
||||
## Arduino Mega or Mega 2560
|
||||
########################################
|
||||
|
||||
mega.name=Arduino Mega or Mega 2560
|
||||
|
||||
mega.vid.0=0x2341
|
||||
mega.pid.0=0x0010
|
||||
mega.vid.1=0x2341
|
||||
mega.pid.1=0x0042
|
||||
mega.vid.2=0x2A03
|
||||
mega.pid.2=0x0010
|
||||
mega.vid.3=0x2A03
|
||||
mega.pid.3=0x0042
|
||||
|
||||
mega.upload.tool=avrdude
|
||||
mega.upload.maximum_data_size=8192
|
||||
|
||||
mega.bootloader.tool=avrdude
|
||||
mega.bootloader.low_fuses=0xFF
|
||||
mega.bootloader.unlock_bits=0x3F
|
||||
mega.bootloader.lock_bits=0x0F
|
||||
|
||||
mega.build.f_cpu=16000000L
|
||||
mega.build.core=arduino
|
||||
mega.build.variant=mega
|
||||
# default board may be overridden by the cpu menu
|
||||
mega.build.board=AVR_MEGA2560
|
||||
mega.build.mcu=atmega2560
|
||||
|
||||
## Arduino Mega w/ ATmega2560
|
||||
## -------------------------
|
||||
mega.menu.cpu.atmega2560=ATmega2560 (Mega 2560)
|
||||
|
||||
mega.menu.cpu.atmega2560.upload.protocol=wiring
|
||||
mega.menu.cpu.atmega2560.upload.maximum_size=253952
|
||||
mega.menu.cpu.atmega2560.upload.speed=115200
|
||||
|
||||
mega.menu.cpu.atmega2560.bootloader.high_fuses=0xD8
|
||||
mega.menu.cpu.atmega2560.bootloader.extended_fuses=0xFD
|
||||
mega.menu.cpu.atmega2560.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex
|
||||
|
||||
mega.menu.cpu.atmega2560.build.mcu=atmega2560
|
||||
mega.menu.cpu.atmega2560.build.board=AVR_MEGA2560
|
||||
|
||||
## Arduino Mega w/ ATmega1280
|
||||
## -------------------------
|
||||
mega.menu.cpu.atmega1280=ATmega1280
|
||||
|
||||
mega.menu.cpu.atmega1280.upload.protocol=arduino
|
||||
mega.menu.cpu.atmega1280.upload.maximum_size=126976
|
||||
mega.menu.cpu.atmega1280.upload.speed=57600
|
||||
|
||||
mega.menu.cpu.atmega1280.bootloader.high_fuses=0xDA
|
||||
mega.menu.cpu.atmega1280.bootloader.extended_fuses=0xF5
|
||||
mega.menu.cpu.atmega1280.bootloader.file=atmega/ATmegaBOOT_168_atmega1280.hex
|
||||
|
||||
mega.menu.cpu.atmega1280.build.mcu=atmega1280
|
||||
mega.menu.cpu.atmega1280.build.board=AVR_MEGA
|
||||
|
||||
########################################
|
||||
## RAMBo
|
||||
########################################
|
||||
rambo.name=RAMBo
|
||||
|
||||
rambo.upload.tool=arduino:avrdude
|
||||
rambo.upload.protocol=wiring
|
||||
rambo.upload.maximum_size=258048
|
||||
rambo.upload.speed=115200
|
||||
|
||||
rambo.bootloader.low_fuses=0xFF
|
||||
rambo.bootloader.high_fuses=0xD8
|
||||
rambo.bootloader.extended_fuses=0xFD
|
||||
rambo.bootloader.path=stk500v2
|
||||
rambo.bootloader.file=stk500boot_v2_mega2560.hex
|
||||
rambo.bootloader.unlock_bits=0x3F
|
||||
rambo.bootloader.lock_bits=0x0F
|
||||
|
||||
rambo.build.mcu=atmega2560
|
||||
rambo.build.f_cpu=16000000L
|
||||
rambo.build.board=AVR_RAMBO
|
||||
rambo.build.core=arduino:arduino
|
||||
rambo.build.variant=rambo
|
||||
|
||||
########################################
|
||||
## Sanguino
|
||||
########################################
|
||||
sanguino.name=Sanguino
|
||||
|
||||
sanguino.upload.tool=arduino:avrdude
|
||||
sanguino.upload.protocol=stk500
|
||||
sanguino.upload.maximum_size=131072
|
||||
sanguino.upload.speed=57600
|
||||
|
||||
sanguino.bootloader.low_fuses=0xD6
|
||||
sanguino.bootloader.high_fuses=0xDA
|
||||
sanguino.bootloader.extended_fuses=0xFD
|
||||
sanguino.bootloader.path=atmega
|
||||
sanguino.bootloader.unlock_bits=0x3F
|
||||
sanguino.bootloader.lock_bits=0x0F
|
||||
|
||||
sanguino.build.mcu=atmega1284p
|
||||
sanguino.build.f_cpu=16000000L
|
||||
sanguino.build.board=AVR_SANGUINO
|
||||
sanguino.build.core=arduino:arduino
|
||||
sanguino.build.variant=sanguino
|
||||
|
||||
sanguino.menu.cpu.atmega644=ATmega644P
|
||||
sanguino.menu.cpu.atmega644.upload.maximum_size=63488
|
||||
sanguino.menu.cpu.atmega644.bootloader.low_fuses=0xFF
|
||||
sanguino.menu.cpu.atmega644.bootloader.high_fuses=0x9A
|
||||
sanguino.menu.cpu.atmega644.bootloader.extended_fuses=0xFF
|
||||
sanguino.menu.cpu.atmega644.bootloader.file=ATmegaBOOT_168_atmega644p.hex
|
||||
sanguino.menu.cpu.atmega644.build.mcu=atmega644p
|
||||
|
||||
sanguino.menu.cpu.atmega12848m=ATmega1284p 8MHz
|
||||
sanguino.menu.cpu.atmega12848m.upload.speed=19200
|
||||
sanguino.menu.cpu.atmega12848m.bootloader.file=ATmegaBOOT_168_atmega1284p_8m.hex
|
||||
sanguino.menu.cpu.atmega12848m.build.f_cpu=8000000L
|
||||
|
||||
sanguino.menu.cpu.atmega1284=ATmega1284p 16MHz
|
||||
sanguino.menu.cpu.atmega1284.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
|
||||
|
||||
sanguino.menu.cpu.atmega1284m=ATmega1284p 20MHz
|
||||
sanguino.menu.cpu.atmega1284m.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
|
||||
sanguino.menu.cpu.atmega1284m.build.f_cpu=20000000L
|
||||
|
||||
########################################
|
||||
## Brainwave
|
||||
########################################
|
||||
Brainwave.name=Brainwave
|
||||
|
||||
Brainwave.bootloader.tool=avrdude
|
||||
Brainwave.bootloader.low_fuses=0xFF
|
||||
Brainwave.bootloader.high_fuses=0x99
|
||||
Brainwave.bootloader.extended_fuses=0xF0
|
||||
Brainwave.bootloader.unlock_bits=0x3F
|
||||
Brainwave.bootloader.lock_bits=0x02F
|
||||
Brainwave.bootloader.path=brainwave
|
||||
Brainwave.bootloader.file=Brainwave-646-LUFA.hex
|
||||
|
||||
Brainwave.upload.tool=avrdude
|
||||
Brainwave.upload.protocol=avr109
|
||||
Brainwave.upload.maximum_size=61440
|
||||
Brainwave.upload.speed=115200
|
||||
Brainwave.upload.disable_flushing=true
|
||||
|
||||
Brainwave.build.mcu=at90usb646
|
||||
Brainwave.build.f_cpu=16000000L
|
||||
Brainwave.build.board=AVR_BRAINWAVE
|
||||
Brainwave.build.core=at90usb
|
||||
Brainwave.build.dependency=true
|
||||
Brainwave.build.variant=brainwave
|
||||
Brainwave.build.vid=0x16D0
|
||||
Brainwave.build.pid=0x076B
|
||||
|
||||
########################################
|
||||
## BrainwavePro (CDC)
|
||||
########################################
|
||||
BrainwavePro.name=Brainwave Pro (CDC)
|
||||
|
||||
BrainwavePro.bootloader.tool=avrdude
|
||||
BrainwavePro.bootloader.low_fuses=0xFF
|
||||
BrainwavePro.bootloader.high_fuses=0x9B
|
||||
BrainwavePro.bootloader.extended_fuses=0xF0
|
||||
BrainwavePro.bootloader.unlock_bits=0x3F
|
||||
BrainwavePro.bootloader.lock_bits=0x02F
|
||||
BrainwavePro.bootloader.path=at90usb
|
||||
BrainwavePro.bootloader.file=BrainwavePro-1286-LUFA.hex
|
||||
|
||||
BrainwavePro.upload.tool=avrdude
|
||||
BrainwavePro.upload.protocol=avr109
|
||||
BrainwavePro.upload.maximum_size=126976
|
||||
BrainwavePro.upload.speed=115200
|
||||
BrainwavePro.upload.disable_flushing=true
|
||||
|
||||
BrainwavePro.build.mcu=at90usb1286
|
||||
BrainwavePro.build.f_cpu=16000000L
|
||||
BrainwavePro.build.board=AVR_BRAINWAVEPRO
|
||||
BrainwavePro.build.core=at90usb
|
||||
BrainwavePro.build.dependency=true
|
||||
BrainwavePro.build.variant=at90usb
|
||||
BrainwavePro.build.vid=0x16D0
|
||||
BrainwavePro.build.pid=0x076B
|
||||
BrainwavePro.build.extra_flags=-DAT90USBxx_TEENSYPP_ASSIGNMENTS -DUSB_VID={build.vid} -DUSB_PID={build.pid}
|
||||
|
||||
########################################
|
||||
## KosselPro -- BrainwavePro with HID boot
|
||||
########################################
|
||||
KosselPro.name=Kossel Pro (HID Bootloader)
|
||||
|
||||
KosselPro.bootloader.tool=avrdude
|
||||
KosselPro.bootloader.low_fuses=0xFF
|
||||
KosselPro.bootloader.high_fuses=0x9B
|
||||
KosselPro.bootloader.extended_fuses=0xF0
|
||||
KosselPro.bootloader.unlock_bits=0x3F
|
||||
KosselPro.bootloader.lock_bits=0x02F
|
||||
KosselPro.bootloader.path=at90usb
|
||||
KosselPro.bootloader.file=BootloaderHID.hex
|
||||
|
||||
KosselPro.upload.tool=hidloader
|
||||
KosselPro.upload.protocol=halfkay
|
||||
KosselPro.upload.maximum_size=126976
|
||||
KosselPro.upload.maximum_ram_size=8192
|
||||
KosselPro.upload.speed=115200
|
||||
KosselPro.upload.disable_flushing=true
|
||||
|
||||
KosselPro.build.mcu=at90usb1286
|
||||
KosselPro.build.f_cpu=16000000L
|
||||
KosselPro.build.board=AVR_BRAINWAVEPRO
|
||||
KosselPro.build.core=at90usb
|
||||
KosselPro.build.dependency=true
|
||||
KosselPro.build.variant=at90usb
|
||||
KosselPro.build.vid=0x16D0
|
||||
KosselPro.build.pid=0x076B
|
||||
KosselPro.build.extra_flags=-DAT90USBxx_TEENSYPP_ASSIGNMENTS -DUSB_VID={build.vid} -DUSB_PID={build.pid}
|
||||
|
||||
########################################
|
||||
## SAVMkI (CDC)
|
||||
########################################
|
||||
SAVMkI.name=SAV MkI (CDC)
|
||||
|
||||
SAVMkI.bootloader.tool=avrdude
|
||||
SAVMkI.bootloader.low_fuses=0xDE
|
||||
SAVMkI.bootloader.high_fuses=0xDB
|
||||
SAVMkI.bootloader.extended_fuses=0xF1
|
||||
SAVMkI.bootloader.unlock_bits=0x3F
|
||||
SAVMkI.bootloader.lock_bits=0x02F
|
||||
SAVMkI.bootloader.path=SAVMkI
|
||||
SAVMkI.bootloader.file=SAVMkI-1286-LUFA.hex
|
||||
|
||||
SAVMkI.upload.tool=avrdude
|
||||
SAVMkI.upload.protocol=avr109
|
||||
SAVMkI.upload.maximum_size=126976
|
||||
SAVMkI.upload.speed=115200
|
||||
SAVMkI.upload.disable_flushing=true
|
||||
|
||||
SAVMkI.build.mcu=at90usb1286
|
||||
SAVMkI.build.f_cpu=16000000L
|
||||
SAVMkI.build.board=AVR_SAVMkI
|
||||
SAVMkI.build.core=at90usb
|
||||
SAVMkI.build.dependency=true
|
||||
SAVMkI.build.variant=at90usb
|
||||
SAVMkI.build.vid=0x16D0
|
||||
SAVMkI.build.pid=0x076B
|
||||
SAVMkI.build.extra_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid}
|
||||
|
||||
########################################
|
||||
## SAVMkI (HID)
|
||||
########################################
|
||||
SAVMkI_HID.name=SAV MkI (HID Bootloader)
|
||||
|
||||
SAVMkI_HID.bootloader.tool=avrdude
|
||||
SAVMkI_HID.bootloader.low_fuses=0xDE
|
||||
SAVMkI_HID.bootloader.high_fuses=0xDB
|
||||
SAVMkI_HID.bootloader.extended_fuses=0xF1
|
||||
SAVMkI_HID.bootloader.unlock_bits=0x3F
|
||||
SAVMkI_HID.bootloader.lock_bits=0x02F
|
||||
SAVMkI_HID.bootloader.path=SAVMkI
|
||||
SAVMkI_HID.bootloader.file=SAVMkI_HID.hex
|
||||
|
||||
SAVMkI_HID.upload.tool=hidloader
|
||||
SAVMkI_HID.upload.protocol=halfkay
|
||||
SAVMkI_HID.upload.maximum_size=126976
|
||||
SAVMkI_HID.upload.maximum_ram_size=8192
|
||||
SAVMkI_HID.upload.speed=115200
|
||||
SAVMkI_HID.upload.disable_flushing=true
|
||||
|
||||
SAVMkI_HID.build.mcu=at90usb1286
|
||||
SAVMkI_HID.build.f_cpu=16000000L
|
||||
SAVMkI_HID.build.board=AVR_SAVMkI
|
||||
SAVMkI_HID.build.core=at90usb
|
||||
SAVMkI_HID.build.dependency=true
|
||||
SAVMkI_HID.build.variant=at90usb
|
||||
SAVMkI_HID.build.vid=0x16D0
|
||||
SAVMkI_HID.build.pid=0x076B
|
||||
SAVMkI_HID.build.extra_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid}
|
@ -0,0 +1,2 @@
|
||||
compiler.cpp.extra_flags=-DHAS_AUTOMATIC_VERSIONING
|
||||
recipe.hooks.prebuild.pattern=generate_version_header_for_marlin "{build.source.path}" "{build.path}/_Version.h"
|
@ -0,0 +1,120 @@
|
||||
|
||||
# Arduino AVR Core and platform.
|
||||
# ------------------------------
|
||||
|
||||
# For more info:
|
||||
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
||||
|
||||
name=Marlin AVR Boards
|
||||
version=1.5.6
|
||||
|
||||
# AVR compile variables
|
||||
# ---------------------
|
||||
|
||||
# Default "compiler.path" is correct, change only if you want to overidde the initial value
|
||||
compiler.path={runtime.tools.avr-gcc.path}/bin/
|
||||
compiler.c.cmd=avr-gcc
|
||||
compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
|
||||
# -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396
|
||||
# This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain
|
||||
compiler.c.elf.flags=-w -Os -Wl,--gc-sections
|
||||
compiler.c.elf.cmd=avr-gcc
|
||||
compiler.S.flags=-c -g -x assembler-with-cpp
|
||||
compiler.cpp.cmd=avr-g++
|
||||
compiler.cpp.flags=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD
|
||||
compiler.ar.cmd=avr-ar
|
||||
compiler.ar.flags=rcs
|
||||
compiler.objcopy.cmd=avr-objcopy
|
||||
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
|
||||
compiler.elf2hex.flags=-O ihex -R .eeprom
|
||||
compiler.elf2hex.cmd=avr-objcopy
|
||||
compiler.ldflags=
|
||||
compiler.size.cmd=avr-size
|
||||
|
||||
# This can be overriden in boards.txt
|
||||
build.extra_flags=
|
||||
|
||||
# These can be overridden in platform.local.txt
|
||||
compiler.c.extra_flags=
|
||||
compiler.c.elf.extra_flags=
|
||||
compiler.S.extra_flags=
|
||||
compiler.cpp.extra_flags=
|
||||
compiler.ar.extra_flags=
|
||||
compiler.objcopy.eep.extra_flags=
|
||||
compiler.elf2hex.extra_flags=
|
||||
|
||||
# AVR compile patterns
|
||||
# --------------------
|
||||
|
||||
## Compile c files
|
||||
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||
|
||||
## Compile c++ files
|
||||
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {compiler.cpp.extra_flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||
|
||||
## Compile S files
|
||||
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||
|
||||
## Create archives
|
||||
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
|
||||
|
||||
## Combine gc-sections, archives, and objects
|
||||
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
|
||||
|
||||
## Create eeprom
|
||||
recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
|
||||
|
||||
## Create hex
|
||||
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
|
||||
|
||||
## Compute size
|
||||
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
|
||||
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
|
||||
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
|
||||
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
|
||||
|
||||
|
||||
# AVR Uploader/Programmers tools
|
||||
# ------------------------------
|
||||
|
||||
tools.avrdude.path={runtime.tools.avrdude.path}
|
||||
tools.avrdude.cmd.path={path}/bin/avrdude
|
||||
tools.avrdude.config.path={path}/etc/avrdude.conf
|
||||
|
||||
tools.avrdude.upload.params.verbose=-v
|
||||
tools.avrdude.upload.params.quiet=-q -q
|
||||
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"
|
||||
|
||||
tools.avrdude.program.params.verbose=-v
|
||||
tools.avrdude.program.params.quiet=-q -q
|
||||
tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i"
|
||||
|
||||
tools.avrdude.erase.params.verbose=-v
|
||||
tools.avrdude.erase.params.quiet=-q -q
|
||||
tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
|
||||
|
||||
tools.avrdude.bootloader.params.verbose=-v
|
||||
tools.avrdude.bootloader.params.quiet=-q -q
|
||||
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.path}/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m
|
||||
|
||||
tools.hidloader.cmd.path=/usr/local/bin/HIDUploader
|
||||
|
||||
tools.hidloader.upload.params.verbose=-v
|
||||
tools.hidloader.upload.params.quiet=
|
||||
tools.hidloader.upload.pattern="{cmd.path}" --upload -mmcu={build.mcu} {upload.verbose} -w "{build.path}/{build.project_name}.hex"
|
||||
tools.nativehid.program.params.verbose=-v
|
||||
tools.nativehid.program.params.quiet=-q -q
|
||||
|
||||
tools.hidloader.program.params.verbose=-v
|
||||
tools.hidloader.program.params.quiet=-q -q
|
||||
tools.hidloader.program.pattern="{cmd.path}" -mmcu={build.mcu} {upload.verbose} -w "{build.path}/{build.project_name}.hex"
|
||||
|
||||
tools.hidloader.erase.params.verbose=-v
|
||||
tools.hidloader.erase.params.quiet=-q -q
|
||||
tools.hidloader.erase.pattern="{cmd.path}" --erase "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
|
||||
|
||||
# USB Default Flags
|
||||
# Default blank usb manufacturer will be filled it at compile time
|
||||
# - from numeric vendor ID, set to Unknown otherwise
|
||||
build.usb_manufacturer=
|
||||
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
|
@ -0,0 +1,278 @@
|
||||
/*
|
||||
pins_arduino.h - Pin definition functions for Arduino
|
||||
Part of Arduino - http://www.arduino.cc/
|
||||
|
||||
Copyright (c) 2007 David A. Mellis
|
||||
Modified 2012 by Fredrik Hubinette
|
||||
Modified 2014-2015 by Matthew Wilson
|
||||
|
||||
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 48
|
||||
#define NUM_ANALOG_INPUTS 8
|
||||
|
||||
// PE7 is our status LED
|
||||
#define TX_RX_LED_INIT DDRE |= (1<<7)
|
||||
#define TXLED0 0
|
||||
#define TXLED1 0
|
||||
#define RXLED0 PORTE |= (1<<7)
|
||||
#define RXLED1 PORTE &= ~(1<<7)
|
||||
|
||||
static const uint8_t SDA = 1;
|
||||
static const uint8_t SCL = 0;
|
||||
|
||||
// Map SPI port to 'new' pins D14..D17
|
||||
static const uint8_t SS = 20;
|
||||
static const uint8_t MOSI = 22;
|
||||
static const uint8_t MISO = 23;
|
||||
static const uint8_t SCK = 21;
|
||||
|
||||
// Mapping of analog pins as digital I/O
|
||||
// A6-A11 share with digital pins
|
||||
static const uint8_t A0 = 38; // F0
|
||||
static const uint8_t A1 = 39; // F1
|
||||
static const uint8_t A2 = 40; // F2
|
||||
static const uint8_t A3 = 41; // F3
|
||||
static const uint8_t A4 = 42; // F4
|
||||
static const uint8_t A5 = 43; // F5
|
||||
static const uint8_t A6 = 44; // F6
|
||||
static const uint8_t A7 = 45; // F7
|
||||
|
||||
#define analogInputToDigitalPin(p) ((p < 8) ? (p) + 38 : -1)
|
||||
|
||||
// Pins below still needs to be configured - Hubbe.
|
||||
|
||||
#define digitalPinToPCICR(p) ((((p) >= 0 && (p) <= 3) || ((p) >= 18 && (p) <= 19) || ((p) >= 36 && (p) <= 37)) ? (&PCICR) : ((uint8_t *)0))
|
||||
#define digitalPinToPCICRbit(p) 0
|
||||
#define digitalPinToPCMSK(p) ((((p) >= 0 && (p) <= 3) || ((p) >= 18 && (p) <= 19) || ((p) >= 36 && (p) <= 37)) ? (&PCMSK0) : ((uint8_t *)0))
|
||||
#define digitalPinToPCMSKbit(p) ( ((p) >= 0 && (p) <= 3) ? (p) : ((p) == 18 ? 6 : ((p) == 19 ? 7 : ((p) == 36 ? 4 : ((p) == 37 ? 5 : (-1))))))
|
||||
|
||||
#define digitalPinHasPWM(p) ((p) == 0 || (p) == 1 || (p) == 14 || (p) == 15 || (p) == 16 || (p) == 24 || (p) == 25 || (p) == 26 || (p) == 27)
|
||||
|
||||
// __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) ) )
|
||||
|
||||
#ifdef ARDUINO_MAIN
|
||||
|
||||
|
||||
// these arrays map port names (e.g. port B) to the
|
||||
// appropriate addresses for various functions (e.g. reading
|
||||
// and writing)
|
||||
// Note PA == 1, PB == 2, etc. (GAH!)
|
||||
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,
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_input_PGM[] = {
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PINA,
|
||||
(uint16_t) &PINB,
|
||||
(uint16_t) &PINC,
|
||||
(uint16_t) &PIND,
|
||||
(uint16_t) &PINE,
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
||||
PD, // 0 - PD0 - INT0 - PWM
|
||||
PD, // 1 - PD1 - INT1 - PWM
|
||||
PD, // 2 - PD2 - INT2 - RX
|
||||
PD, // 3 - PD3 - INT3 - TX
|
||||
PD, // 4 - PD4
|
||||
PD, // 5 - PD5
|
||||
PD, // 6 - PD6
|
||||
PD, // 7 - PD7
|
||||
PE, // 8 - PE0
|
||||
PE, // 9 - PE1
|
||||
PC, // 10 - PC0
|
||||
PC, // 11 - PC1
|
||||
PC, // 12 - PC2
|
||||
PC, // 13 - PC3
|
||||
PC, // 14 - PC4 - PWM
|
||||
PC, // 15 - PC5 - PWM
|
||||
PC, // 16 - PC6 - PWM
|
||||
PC, // 17 - PC7
|
||||
PE, // 18 - PE6 - INT6
|
||||
PE, // 19 - PE7 - INT7
|
||||
PB, // 20 - PB0
|
||||
PB, // 21 - PB1
|
||||
PB, // 22 - PB2
|
||||
PB, // 23 - PB3
|
||||
PB, // 24 - PB4 - PWM
|
||||
PB, // 25 - PB5 - PWM
|
||||
PB, // 26 - PB6 - PWM
|
||||
PB, // 27 - PB7 - PWM
|
||||
PA, // 28 - PA0
|
||||
PA, // 29 - PA1
|
||||
PA, // 30 - PA2
|
||||
PA, // 31 - PA3
|
||||
PA, // 32 - PA4
|
||||
PA, // 33 - PA5
|
||||
PA, // 34 - PA6
|
||||
PA, // 35 - PA7
|
||||
PE, // 36 - PE4 - INT4
|
||||
PE, // 37 - PE5 - INT5
|
||||
PF, // 38 - PF0 - A0
|
||||
PF, // 39 - PF1 - A1
|
||||
PF, // 40 - PF2 - A2
|
||||
PF, // 41 - PF3 - A3
|
||||
PF, // 42 - PF4 - A4
|
||||
PF, // 43 - PF5 - A5
|
||||
PF, // 44 - PF6 - A6
|
||||
PF, // 45 - PF7 - A7
|
||||
PE, // 46 - PE2 (not defined in teensy)
|
||||
PE, // 47 - PE3 (not defined in teensy)
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
|
||||
_BV(0), // 0 - PD0 - INT0 - PWM
|
||||
_BV(1), // 1 - PD1 - INT1 - PWM
|
||||
_BV(2), // 2 - PD2 - INT2 - RX
|
||||
_BV(3), // 3 - PD3 - INT3 - TX
|
||||
_BV(4), // 4 - PD4
|
||||
_BV(5), // 5 - PD5
|
||||
_BV(6), // 6 - PD6
|
||||
_BV(7), // 7 - PD7
|
||||
_BV(0), // 8 - PE0
|
||||
_BV(1), // 9 - PE1
|
||||
_BV(0), // 10 - PC0
|
||||
_BV(1), // 11 - PC1
|
||||
_BV(2), // 12 - PC2
|
||||
_BV(3), // 13 - PC3
|
||||
_BV(4), // 14 - PC4 - PWM
|
||||
_BV(5), // 15 - PC5 - PWM
|
||||
_BV(6), // 16 - PC6 - PWM
|
||||
_BV(7), // 17 - PC7
|
||||
_BV(6), // 18 - PE6 - INT6
|
||||
_BV(7), // 19 - PE7 - INT7
|
||||
_BV(0), // 20 - PB0
|
||||
_BV(1), // 21 - PB1
|
||||
_BV(2), // 22 - PB2
|
||||
_BV(3), // 23 - PB3
|
||||
_BV(4), // 24 - PB4 - PWM
|
||||
_BV(5), // 25 - PB5 - PWM
|
||||
_BV(6), // 26 - PB6 - PWM
|
||||
_BV(7), // 27 - PB7 - PWM
|
||||
_BV(0), // 28 - PA0
|
||||
_BV(1), // 29 - PA1
|
||||
_BV(2), // 30 - PA2
|
||||
_BV(3), // 31 - PA3
|
||||
_BV(4), // 32 - PA4
|
||||
_BV(5), // 33 - PA5
|
||||
_BV(6), // 34 - PA6
|
||||
_BV(7), // 35 - PA7
|
||||
_BV(4), // 36 - PE4 - INT4
|
||||
_BV(5), // 37 - PE5 - INT5
|
||||
_BV(0), // 38 - PF0 - A0
|
||||
_BV(1), // 39 - PF1 - A1
|
||||
_BV(2), // 40 - PF2 - A2
|
||||
_BV(3), // 41 - PF3 - A3
|
||||
_BV(4), // 42 - PF4 - A4
|
||||
_BV(5), // 43 - PF5 - A5
|
||||
_BV(6), // 44 - PF6 - A6
|
||||
_BV(7), // 45 - PF7 - A7
|
||||
_BV(2), // 46 - PE2 (not defined in teensy)
|
||||
_BV(3), // 47 - PE3 (not defined in teensy)
|
||||
};
|
||||
|
||||
|
||||
// TODO(unrepentantgeek) complete this map of PWM capable pins
|
||||
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
|
||||
TIMER0A, // 0 - PD0 - INT0 - PWM
|
||||
TIMER2B, // 1 - PD1 - INT1 - PWM
|
||||
NOT_ON_TIMER, // 2 - PD2 - INT2 - RX
|
||||
NOT_ON_TIMER, // 3 - PD3 - INT3 - TX
|
||||
NOT_ON_TIMER, // 4 - PD4
|
||||
NOT_ON_TIMER, // 5 - PD5
|
||||
NOT_ON_TIMER, // 6 - PD6
|
||||
NOT_ON_TIMER, // 7 - PD7
|
||||
NOT_ON_TIMER, // 8 - PE0
|
||||
NOT_ON_TIMER, // 9 - PE1
|
||||
NOT_ON_TIMER, // 10 - PC0
|
||||
NOT_ON_TIMER, // 11 - PC1
|
||||
NOT_ON_TIMER, // 12 - PC2
|
||||
NOT_ON_TIMER, // 13 - PC3
|
||||
TIMER3C, // 14 - PC4 - PWM
|
||||
TIMER3B, // 15 - PC5 - PWM
|
||||
TIMER3A, // 16 - PC6 - PWM
|
||||
NOT_ON_TIMER, // 17 - PC7
|
||||
NOT_ON_TIMER, // 18 - PE6 - INT6
|
||||
NOT_ON_TIMER, // 19 - PE7 - INT7
|
||||
NOT_ON_TIMER, // 20 - PB0
|
||||
NOT_ON_TIMER, // 21 - PB1
|
||||
NOT_ON_TIMER, // 22 - PB2
|
||||
NOT_ON_TIMER, // 23 - PB3
|
||||
TIMER2A, // 24 - PB4 - PWM
|
||||
TIMER1A, // 25 - PB5 - PWM
|
||||
TIMER1B, // 26 - PB6 - PWM
|
||||
NOT_ON_TIMER, // 27 - PB7 - PWM // This should be on TIMER1C
|
||||
NOT_ON_TIMER, // 28 - PA0
|
||||
NOT_ON_TIMER, // 29 - PA1
|
||||
NOT_ON_TIMER, // 30 - PA2
|
||||
NOT_ON_TIMER, // 31 - PA3
|
||||
NOT_ON_TIMER, // 32 - PA4
|
||||
NOT_ON_TIMER, // 33 - PA5
|
||||
NOT_ON_TIMER, // 34 - PA6
|
||||
NOT_ON_TIMER, // 35 - PA7
|
||||
NOT_ON_TIMER, // 36 - PE4 - INT4
|
||||
NOT_ON_TIMER, // 37 - PE5 - INT5
|
||||
NOT_ON_TIMER, // 38 - PF0 - A0
|
||||
NOT_ON_TIMER, // 39 - PF1 - A1
|
||||
NOT_ON_TIMER, // 40 - PF2 - A2
|
||||
NOT_ON_TIMER, // 41 - PF3 - A3
|
||||
NOT_ON_TIMER, // 42 - PF4 - A4
|
||||
NOT_ON_TIMER, // 43 - PF5 - A5
|
||||
NOT_ON_TIMER, // 44 - PF6 - A6
|
||||
NOT_ON_TIMER, // 45 - PF7 - A7
|
||||
NOT_ON_TIMER, // 46 - PE2 (not defined in teensy)
|
||||
NOT_ON_TIMER, // 47 - PE3 (not defined in teensy)
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM analog_pin_to_channel_PGM[8] = {
|
||||
0, // A0 PF0 ADC0
|
||||
1, // A1 PF1 ADC1
|
||||
2, // A2 PF2 ADC2
|
||||
3, // A3 PF3 ADC3
|
||||
4, // A4 PF4 ADC4
|
||||
5, // A5 PF5 ADC5
|
||||
6, // A6 PD6 ADC6
|
||||
7, // A7 PD7 ADC7
|
||||
};
|
||||
|
||||
#endif /* ARDUINO_MAIN */
|
||||
#endif /* Pins_Arduino_h */
|
@ -0,0 +1,281 @@
|
||||
/*
|
||||
pins_arduino.h - Pin definition functions for Arduino
|
||||
Part of Arduino - http://www.arduino.cc/
|
||||
|
||||
Copyright (c) 2007 David A. Mellis
|
||||
Modified 2012 by Fredrik Hubinette
|
||||
|
||||
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 48
|
||||
#define NUM_ANALOG_INPUTS 8
|
||||
|
||||
#define TX_RX_LED_INIT DDRE |= (1<<7)
|
||||
#define TXLED0 0
|
||||
#define TXLED1 0
|
||||
#define RXLED0 PORTE |= (1<<7)
|
||||
#define RXLED1 PORTE &= ~(1<<7)
|
||||
|
||||
static const uint8_t SDA = 0;
|
||||
static const uint8_t SCL = 1;
|
||||
|
||||
// Map SPI port to 'new' pins D14..D17
|
||||
static const uint8_t SS = 20;
|
||||
static const uint8_t MOSI = 22;
|
||||
static const uint8_t MISO = 23;
|
||||
static const uint8_t SCK = 21;
|
||||
|
||||
// Mapping of analog pins as digital I/O
|
||||
// A6-A11 share with digital pins
|
||||
static const uint8_t A0 = 38; // F0
|
||||
static const uint8_t A1 = 39; // F1
|
||||
static const uint8_t A2 = 40; // F2
|
||||
static const uint8_t A3 = 41; // F3
|
||||
static const uint8_t A4 = 42; // F4
|
||||
static const uint8_t A5 = 43; // F5
|
||||
static const uint8_t A6 = 44; // F6
|
||||
static const uint8_t A7 = 45; // F7
|
||||
|
||||
#define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
|
||||
|
||||
// Pins below still needs to be configured - Hubbe.
|
||||
|
||||
#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))))))
|
||||
|
||||
|
||||
#define digitalPinHasPWM(p) ((p) == 12 || (p) == 13 || (p) == 14 || (p) == 20 || (p) == 21 || (p) == 22)
|
||||
|
||||
// __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) ) )
|
||||
|
||||
#ifdef ARDUINO_MAIN
|
||||
|
||||
|
||||
// these arrays map port names (e.g. port B) to the
|
||||
// appropriate addresses for various functions (e.g. reading
|
||||
// and writing)
|
||||
// Note PA == 1, PB == 2, etc. (GAH!)
|
||||
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,
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_input_PGM[] = {
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PINA,
|
||||
(uint16_t) &PINB,
|
||||
(uint16_t) &PINC,
|
||||
(uint16_t) &PIND,
|
||||
(uint16_t) &PINE,
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
||||
PA, // 0
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PB, // 8
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PC, // 16
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PD, // 24
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PE, // 32
|
||||
PE,
|
||||
PE,
|
||||
PE,
|
||||
PE,
|
||||
PE,
|
||||
PE,
|
||||
PE, // 39 - PE7
|
||||
PF, // 40 - A0 - PF0
|
||||
PF,
|
||||
PF,
|
||||
PF,
|
||||
PF,
|
||||
PF,
|
||||
PF,
|
||||
PF, // 47 - A7 - PF7
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
|
||||
_BV(0), // PA0
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(0), // PB0
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(0), // PC0
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(0), // PD0
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(0), // PE0
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(0), // PF0
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
};
|
||||
|
||||
|
||||
// TODO(unrepentantgeek) complete this map of PWM capable pins
|
||||
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
|
||||
NOT_ON_TIMER, // 0 - PA0
|
||||
NOT_ON_TIMER, // 1 - PA1
|
||||
NOT_ON_TIMER, // 2 - PA2
|
||||
NOT_ON_TIMER, // 3 - PA3
|
||||
NOT_ON_TIMER, // 4 - PA4
|
||||
NOT_ON_TIMER, // 5 - PA5
|
||||
NOT_ON_TIMER, // 6 - PA6
|
||||
NOT_ON_TIMER, // 7 - PA7
|
||||
NOT_ON_TIMER, // 8 - PB0
|
||||
NOT_ON_TIMER, // 9 - PB1
|
||||
NOT_ON_TIMER, // 10 - PB2
|
||||
NOT_ON_TIMER, // 11 - PB3
|
||||
TIMER2A, // 12 - PB4
|
||||
TIMER1A, // 13 - PB5
|
||||
TIMER1B, // 14 - PB6
|
||||
NOT_ON_TIMER, // 15 - PB7
|
||||
NOT_ON_TIMER, // 16 - PC0
|
||||
NOT_ON_TIMER, // 17 - PC1
|
||||
NOT_ON_TIMER, // 18 - PC2
|
||||
NOT_ON_TIMER, // 19 - PC3
|
||||
TIMER3C, // 20 - PC4
|
||||
TIMER3B, // 21 - PC5
|
||||
TIMER3A, // 22 - PC6
|
||||
NOT_ON_TIMER, // 23 - PC7
|
||||
NOT_ON_TIMER, // 24 - PD0
|
||||
NOT_ON_TIMER, // 25 - PD1
|
||||
NOT_ON_TIMER, // 26 - PD2
|
||||
NOT_ON_TIMER, // 27 - PD3
|
||||
NOT_ON_TIMER, // 28 - PD4
|
||||
NOT_ON_TIMER, // 29 - PD5
|
||||
NOT_ON_TIMER, // 30 - PD6
|
||||
NOT_ON_TIMER, // 31 - PD7
|
||||
NOT_ON_TIMER, // 32 - PE0
|
||||
NOT_ON_TIMER, // 33 - PE1
|
||||
NOT_ON_TIMER, // 34 - PE2
|
||||
NOT_ON_TIMER, // 35 - PE3
|
||||
NOT_ON_TIMER, // 36 - PE4
|
||||
NOT_ON_TIMER, // 37 - PE5
|
||||
NOT_ON_TIMER, // 38 - PE6
|
||||
NOT_ON_TIMER, // 39 - PE7
|
||||
NOT_ON_TIMER, // 40 - A0 - PF0
|
||||
NOT_ON_TIMER, // 41 - A1 - PF1
|
||||
NOT_ON_TIMER, // 42 - A2 - PF2
|
||||
NOT_ON_TIMER, // 43 - A3 - PF3
|
||||
NOT_ON_TIMER, // 44 - A4 - PF4
|
||||
NOT_ON_TIMER, // 45 - A5 - PF5
|
||||
NOT_ON_TIMER, // 46 - A6 - PF6
|
||||
NOT_ON_TIMER, // 47 - A7 - PF7
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM analog_pin_to_channel_PGM[12] = {
|
||||
7, // A0 PF7 ADC7
|
||||
6, // A1 PF6 ADC6
|
||||
5, // A2 PF5 ADC5
|
||||
4, // A3 PF4 ADC4
|
||||
1, // A4 PF1 ADC1
|
||||
0, // A5 PF0 ADC0
|
||||
8, // A6 D4 PD4 ADC8
|
||||
10, // A7 D6 PD7 ADC10
|
||||
11, // A8 D8 PB4 ADC11
|
||||
12, // A9 D9 PB5 ADC12
|
||||
13, // A10 D10 PB6 ADC13
|
||||
9 // A11 D12 PD6 ADC9
|
||||
};
|
||||
|
||||
#endif /* ARDUINO_MAIN */
|
||||
#endif /* Pins_Arduino_h */
|
@ -0,0 +1,389 @@
|
||||
/*
|
||||
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 70
|
||||
#define NUM_ANALOG_INPUTS 16
|
||||
#define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
|
||||
#define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))
|
||||
|
||||
static const uint8_t SS = 53;
|
||||
static const uint8_t MOSI = 51;
|
||||
static const uint8_t MISO = 50;
|
||||
static const uint8_t SCK = 52;
|
||||
|
||||
static const uint8_t SDA = 20;
|
||||
static const uint8_t SCL = 21;
|
||||
#define LED_BUILTIN 13
|
||||
|
||||
static const uint8_t A0 = 54;
|
||||
static const uint8_t A1 = 55;
|
||||
static const uint8_t A2 = 56;
|
||||
static const uint8_t A3 = 57;
|
||||
static const uint8_t A4 = 58;
|
||||
static const uint8_t A5 = 59;
|
||||
static const uint8_t A6 = 60;
|
||||
static const uint8_t A7 = 61;
|
||||
static const uint8_t A8 = 62;
|
||||
static const uint8_t A9 = 63;
|
||||
static const uint8_t A10 = 64;
|
||||
static const uint8_t A11 = 65;
|
||||
static const uint8_t A12 = 66;
|
||||
static const uint8_t A13 = 67;
|
||||
static const uint8_t A14 = 68;
|
||||
static const uint8_t A15 = 69;
|
||||
|
||||
// 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 ) ) ) ) ) )
|
||||
|
||||
#define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : ((p) >= 18 && (p) <= 21 ? 23 - (p) : NOT_AN_INTERRUPT)))
|
||||
|
||||
#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,
|
||||
(uint16_t) &DDRH,
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &DDRJ,
|
||||
(uint16_t) &DDRK,
|
||||
(uint16_t) &DDRL,
|
||||
};
|
||||
|
||||
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,
|
||||
(uint16_t) &PORTH,
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PORTJ,
|
||||
(uint16_t) &PORTK,
|
||||
(uint16_t) &PORTL,
|
||||
};
|
||||
|
||||
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,
|
||||
(uint16_t) &PINH,
|
||||
NOT_A_PIN,
|
||||
(uint16_t) &PINJ,
|
||||
(uint16_t) &PINK,
|
||||
(uint16_t) &PINL,
|
||||
};
|
||||
|
||||
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 ** PWM2
|
||||
PE , // PE 5 ** 3 ** PWM3
|
||||
PG , // PG 5 ** 4 ** PWM4
|
||||
PE , // PE 3 ** 5 ** PWM5
|
||||
PH , // PH 3 ** 6 ** PWM6
|
||||
PH , // PH 4 ** 7 ** PWM7
|
||||
PH , // PH 5 ** 8 ** PWM8
|
||||
PH , // PH 6 ** 9 ** PWM9
|
||||
PB , // PB 4 ** 10 ** PWM10
|
||||
PB , // PB 5 ** 11 ** PWM11
|
||||
PB , // PB 6 ** 12 ** PWM12
|
||||
PB , // PB 7 ** 13 ** PWM13
|
||||
PJ , // PJ 1 ** 14 ** USART3_TX
|
||||
PJ , // PJ 0 ** 15 ** USART3_RX
|
||||
PH , // PH 1 ** 16 ** USART2_TX
|
||||
PH , // PH 0 ** 17 ** USART2_RX
|
||||
PD , // PD 3 ** 18 ** USART1_TX
|
||||
PD , // PD 2 ** 19 ** USART1_RX
|
||||
PD , // PD 1 ** 20 ** I2C_SDA
|
||||
PD , // PD 0 ** 21 ** I2C_SCL
|
||||
PA , // PA 0 ** 22 ** D22
|
||||
PA , // PA 1 ** 23 ** D23
|
||||
PA , // PA 2 ** 24 ** D24
|
||||
PA , // PA 3 ** 25 ** D25
|
||||
PA , // PA 4 ** 26 ** D26
|
||||
PA , // PA 5 ** 27 ** D27
|
||||
PA , // PA 6 ** 28 ** D28
|
||||
PA , // PA 7 ** 29 ** D29
|
||||
PC , // PC 7 ** 30 ** D30
|
||||
PC , // PC 6 ** 31 ** D31
|
||||
PC , // PC 5 ** 32 ** D32
|
||||
PC , // PC 4 ** 33 ** D33
|
||||
PC , // PC 3 ** 34 ** D34
|
||||
PC , // PC 2 ** 35 ** D35
|
||||
PC , // PC 1 ** 36 ** D36
|
||||
PC , // PC 0 ** 37 ** D37
|
||||
PD , // PD 7 ** 38 ** D38
|
||||
PG , // PG 2 ** 39 ** D39
|
||||
PG , // PG 1 ** 40 ** D40
|
||||
PG , // PG 0 ** 41 ** D41
|
||||
PL , // PL 7 ** 42 ** D42
|
||||
PL , // PL 6 ** 43 ** D43
|
||||
PL , // PL 5 ** 44 ** D44
|
||||
PL , // PL 4 ** 45 ** D45
|
||||
PL , // PL 3 ** 46 ** D46
|
||||
PL , // PL 2 ** 47 ** D47
|
||||
PL , // PL 1 ** 48 ** D48
|
||||
PL , // PL 0 ** 49 ** D49
|
||||
PB , // PB 3 ** 50 ** SPI_MISO
|
||||
PB , // PB 2 ** 51 ** SPI_MOSI
|
||||
PB , // PB 1 ** 52 ** SPI_SCK
|
||||
PB , // PB 0 ** 53 ** SPI_SS
|
||||
PF , // PF 0 ** 54 ** A0
|
||||
PF , // PF 1 ** 55 ** A1
|
||||
PF , // PF 2 ** 56 ** A2
|
||||
PF , // PF 3 ** 57 ** A3
|
||||
PF , // PF 4 ** 58 ** A4
|
||||
PF , // PF 5 ** 59 ** A5
|
||||
PF , // PF 6 ** 60 ** A6
|
||||
PF , // PF 7 ** 61 ** A7
|
||||
PK , // PK 0 ** 62 ** A8
|
||||
PK , // PK 1 ** 63 ** A9
|
||||
PK , // PK 2 ** 64 ** A10
|
||||
PK , // PK 3 ** 65 ** A11
|
||||
PK , // PK 4 ** 66 ** A12
|
||||
PK , // PK 5 ** 67 ** A13
|
||||
PK , // PK 6 ** 68 ** A14
|
||||
PK , // PK 7 ** 69 ** A15
|
||||
};
|
||||
|
||||
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 ** PWM2
|
||||
_BV( 5 ) , // PE 5 ** 3 ** PWM3
|
||||
_BV( 5 ) , // PG 5 ** 4 ** PWM4
|
||||
_BV( 3 ) , // PE 3 ** 5 ** PWM5
|
||||
_BV( 3 ) , // PH 3 ** 6 ** PWM6
|
||||
_BV( 4 ) , // PH 4 ** 7 ** PWM7
|
||||
_BV( 5 ) , // PH 5 ** 8 ** PWM8
|
||||
_BV( 6 ) , // PH 6 ** 9 ** PWM9
|
||||
_BV( 4 ) , // PB 4 ** 10 ** PWM10
|
||||
_BV( 5 ) , // PB 5 ** 11 ** PWM11
|
||||
_BV( 6 ) , // PB 6 ** 12 ** PWM12
|
||||
_BV( 7 ) , // PB 7 ** 13 ** PWM13
|
||||
_BV( 1 ) , // PJ 1 ** 14 ** USART3_TX
|
||||
_BV( 0 ) , // PJ 0 ** 15 ** USART3_RX
|
||||
_BV( 1 ) , // PH 1 ** 16 ** USART2_TX
|
||||
_BV( 0 ) , // PH 0 ** 17 ** USART2_RX
|
||||
_BV( 3 ) , // PD 3 ** 18 ** USART1_TX
|
||||
_BV( 2 ) , // PD 2 ** 19 ** USART1_RX
|
||||
_BV( 1 ) , // PD 1 ** 20 ** I2C_SDA
|
||||
_BV( 0 ) , // PD 0 ** 21 ** I2C_SCL
|
||||
_BV( 0 ) , // PA 0 ** 22 ** D22
|
||||
_BV( 1 ) , // PA 1 ** 23 ** D23
|
||||
_BV( 2 ) , // PA 2 ** 24 ** D24
|
||||
_BV( 3 ) , // PA 3 ** 25 ** D25
|
||||
_BV( 4 ) , // PA 4 ** 26 ** D26
|
||||
_BV( 5 ) , // PA 5 ** 27 ** D27
|
||||
_BV( 6 ) , // PA 6 ** 28 ** D28
|
||||
_BV( 7 ) , // PA 7 ** 29 ** D29
|
||||
_BV( 7 ) , // PC 7 ** 30 ** D30
|
||||
_BV( 6 ) , // PC 6 ** 31 ** D31
|
||||
_BV( 5 ) , // PC 5 ** 32 ** D32
|
||||
_BV( 4 ) , // PC 4 ** 33 ** D33
|
||||
_BV( 3 ) , // PC 3 ** 34 ** D34
|
||||
_BV( 2 ) , // PC 2 ** 35 ** D35
|
||||
_BV( 1 ) , // PC 1 ** 36 ** D36
|
||||
_BV( 0 ) , // PC 0 ** 37 ** D37
|
||||
_BV( 7 ) , // PD 7 ** 38 ** D38
|
||||
_BV( 2 ) , // PG 2 ** 39 ** D39
|
||||
_BV( 1 ) , // PG 1 ** 40 ** D40
|
||||
_BV( 0 ) , // PG 0 ** 41 ** D41
|
||||
_BV( 7 ) , // PL 7 ** 42 ** D42
|
||||
_BV( 6 ) , // PL 6 ** 43 ** D43
|
||||
_BV( 5 ) , // PL 5 ** 44 ** D44
|
||||
_BV( 4 ) , // PL 4 ** 45 ** D45
|
||||
_BV( 3 ) , // PL 3 ** 46 ** D46
|
||||
_BV( 2 ) , // PL 2 ** 47 ** D47
|
||||
_BV( 1 ) , // PL 1 ** 48 ** D48
|
||||
_BV( 0 ) , // PL 0 ** 49 ** D49
|
||||
_BV( 3 ) , // PB 3 ** 50 ** SPI_MISO
|
||||
_BV( 2 ) , // PB 2 ** 51 ** SPI_MOSI
|
||||
_BV( 1 ) , // PB 1 ** 52 ** SPI_SCK
|
||||
_BV( 0 ) , // PB 0 ** 53 ** SPI_SS
|
||||
_BV( 0 ) , // PF 0 ** 54 ** A0
|
||||
_BV( 1 ) , // PF 1 ** 55 ** A1
|
||||
_BV( 2 ) , // PF 2 ** 56 ** A2
|
||||
_BV( 3 ) , // PF 3 ** 57 ** A3
|
||||
_BV( 4 ) , // PF 4 ** 58 ** A4
|
||||
_BV( 5 ) , // PF 5 ** 59 ** A5
|
||||
_BV( 6 ) , // PF 6 ** 60 ** A6
|
||||
_BV( 7 ) , // PF 7 ** 61 ** A7
|
||||
_BV( 0 ) , // PK 0 ** 62 ** A8
|
||||
_BV( 1 ) , // PK 1 ** 63 ** A9
|
||||
_BV( 2 ) , // PK 2 ** 64 ** A10
|
||||
_BV( 3 ) , // PK 3 ** 65 ** A11
|
||||
_BV( 4 ) , // PK 4 ** 66 ** A12
|
||||
_BV( 5 ) , // PK 5 ** 67 ** A13
|
||||
_BV( 6 ) , // PK 6 ** 68 ** A14
|
||||
_BV( 7 ) , // PK 7 ** 69 ** A15
|
||||
};
|
||||
|
||||
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 ** PWM2
|
||||
TIMER3C , // PE 5 ** 3 ** PWM3
|
||||
TIMER0B , // PG 5 ** 4 ** PWM4
|
||||
TIMER3A , // PE 3 ** 5 ** PWM5
|
||||
TIMER4A , // PH 3 ** 6 ** PWM6
|
||||
TIMER4B , // PH 4 ** 7 ** PWM7
|
||||
TIMER4C , // PH 5 ** 8 ** PWM8
|
||||
TIMER2B , // PH 6 ** 9 ** PWM9
|
||||
TIMER2A , // PB 4 ** 10 ** PWM10
|
||||
TIMER1A , // PB 5 ** 11 ** PWM11
|
||||
TIMER1B , // PB 6 ** 12 ** PWM12
|
||||
TIMER0A , // PB 7 ** 13 ** PWM13
|
||||
NOT_ON_TIMER , // PJ 1 ** 14 ** USART3_TX
|
||||
NOT_ON_TIMER , // PJ 0 ** 15 ** USART3_RX
|
||||
NOT_ON_TIMER , // PH 1 ** 16 ** USART2_TX
|
||||
NOT_ON_TIMER , // PH 0 ** 17 ** USART2_RX
|
||||
NOT_ON_TIMER , // PD 3 ** 18 ** USART1_TX
|
||||
NOT_ON_TIMER , // PD 2 ** 19 ** USART1_RX
|
||||
NOT_ON_TIMER , // PD 1 ** 20 ** I2C_SDA
|
||||
NOT_ON_TIMER , // PD 0 ** 21 ** I2C_SCL
|
||||
NOT_ON_TIMER , // PA 0 ** 22 ** D22
|
||||
NOT_ON_TIMER , // PA 1 ** 23 ** D23
|
||||
NOT_ON_TIMER , // PA 2 ** 24 ** D24
|
||||
NOT_ON_TIMER , // PA 3 ** 25 ** D25
|
||||
NOT_ON_TIMER , // PA 4 ** 26 ** D26
|
||||
NOT_ON_TIMER , // PA 5 ** 27 ** D27
|
||||
NOT_ON_TIMER , // PA 6 ** 28 ** D28
|
||||
NOT_ON_TIMER , // PA 7 ** 29 ** D29
|
||||
NOT_ON_TIMER , // PC 7 ** 30 ** D30
|
||||
NOT_ON_TIMER , // PC 6 ** 31 ** D31
|
||||
NOT_ON_TIMER , // PC 5 ** 32 ** D32
|
||||
NOT_ON_TIMER , // PC 4 ** 33 ** D33
|
||||
NOT_ON_TIMER , // PC 3 ** 34 ** D34
|
||||
NOT_ON_TIMER , // PC 2 ** 35 ** D35
|
||||
NOT_ON_TIMER , // PC 1 ** 36 ** D36
|
||||
NOT_ON_TIMER , // PC 0 ** 37 ** D37
|
||||
NOT_ON_TIMER , // PD 7 ** 38 ** D38
|
||||
NOT_ON_TIMER , // PG 2 ** 39 ** D39
|
||||
NOT_ON_TIMER , // PG 1 ** 40 ** D40
|
||||
NOT_ON_TIMER , // PG 0 ** 41 ** D41
|
||||
NOT_ON_TIMER , // PL 7 ** 42 ** D42
|
||||
NOT_ON_TIMER , // PL 6 ** 43 ** D43
|
||||
TIMER5C , // PL 5 ** 44 ** D44
|
||||
TIMER5B , // PL 4 ** 45 ** D45
|
||||
TIMER5A , // PL 3 ** 46 ** D46
|
||||
NOT_ON_TIMER , // PL 2 ** 47 ** D47
|
||||
NOT_ON_TIMER , // PL 1 ** 48 ** D48
|
||||
NOT_ON_TIMER , // PL 0 ** 49 ** D49
|
||||
NOT_ON_TIMER , // PB 3 ** 50 ** SPI_MISO
|
||||
NOT_ON_TIMER , // PB 2 ** 51 ** SPI_MOSI
|
||||
NOT_ON_TIMER , // PB 1 ** 52 ** SPI_SCK
|
||||
NOT_ON_TIMER , // PB 0 ** 53 ** SPI_SS
|
||||
NOT_ON_TIMER , // PF 0 ** 54 ** A0
|
||||
NOT_ON_TIMER , // PF 1 ** 55 ** A1
|
||||
NOT_ON_TIMER , // PF 2 ** 56 ** A2
|
||||
NOT_ON_TIMER , // PF 3 ** 57 ** A3
|
||||
NOT_ON_TIMER , // PF 4 ** 58 ** A4
|
||||
NOT_ON_TIMER , // PF 5 ** 59 ** A5
|
||||
NOT_ON_TIMER , // PF 6 ** 60 ** A6
|
||||
NOT_ON_TIMER , // PF 7 ** 61 ** A7
|
||||
NOT_ON_TIMER , // PK 0 ** 62 ** A8
|
||||
NOT_ON_TIMER , // PK 1 ** 63 ** A9
|
||||
NOT_ON_TIMER , // PK 2 ** 64 ** A10
|
||||
NOT_ON_TIMER , // PK 3 ** 65 ** A11
|
||||
NOT_ON_TIMER , // PK 4 ** 66 ** A12
|
||||
NOT_ON_TIMER , // PK 5 ** 67 ** A13
|
||||
NOT_ON_TIMER , // PK 6 ** 68 ** A14
|
||||
NOT_ON_TIMER , // PK 7 ** 69 ** A15
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// These serial port names are intended to allow libraries and architecture-neutral
|
||||
// sketches to automatically default to the correct port name for a particular type
|
||||
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
|
||||
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
|
||||
//
|
||||
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||
//
|
||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||
//
|
||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||
// pins are NOT connected to anything by default.
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#define SERIAL_PORT_HARDWARE Serial
|
||||
#define SERIAL_PORT_HARDWARE1 Serial1
|
||||
#define SERIAL_PORT_HARDWARE2 Serial2
|
||||
#define SERIAL_PORT_HARDWARE3 Serial3
|
||||
#define SERIAL_PORT_HARDWARE_OPEN Serial1
|
||||
#define SERIAL_PORT_HARDWARE_OPEN1 Serial2
|
||||
#define SERIAL_PORT_HARDWARE_OPEN2 Serial3
|
||||
|
||||
#endif
|
@ -0,0 +1,411 @@
|
||||
/*
|
||||
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 82
|
||||
#define NUM_ANALOG_INPUTS 16
|
||||
#define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
|
||||
#define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))
|
||||
|
||||
static const uint8_t SS = 53;
|
||||
static const uint8_t MOSI = 51;
|
||||
static const uint8_t MISO = 50;
|
||||
static const uint8_t SCK = 52;
|
||||
|
||||
static const uint8_t SDA = 20;
|
||||
static const uint8_t SCL = 21;
|
||||
static const uint8_t LED_BUILTIN = 13;
|
||||
|
||||
static const uint8_t A0 = 54;
|
||||
static const uint8_t A1 = 55;
|
||||
static const uint8_t A2 = 56;
|
||||
static const uint8_t A3 = 57;
|
||||
static const uint8_t A4 = 58;
|
||||
static const uint8_t A5 = 59;
|
||||
static const uint8_t A6 = 60;
|
||||
static const uint8_t A7 = 61;
|
||||
static const uint8_t A8 = 62;
|
||||
static const uint8_t A9 = 63;
|
||||
static const uint8_t A10 = 64;
|
||||
static const uint8_t A11 = 65;
|
||||
static const uint8_t A12 = 66;
|
||||
static const uint8_t A13 = 67;
|
||||
static const uint8_t A14 = 68;
|
||||
static const uint8_t A15 = 69;
|
||||
|
||||
// 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,
|
||||
(uint16_t) &DDRH,
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &DDRJ,
|
||||
(uint16_t) &DDRK,
|
||||
(uint16_t) &DDRL,
|
||||
};
|
||||
|
||||
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,
|
||||
(uint16_t) &PORTH,
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PORTJ,
|
||||
(uint16_t) &PORTK,
|
||||
(uint16_t) &PORTL,
|
||||
};
|
||||
|
||||
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,
|
||||
(uint16_t) &PINH,
|
||||
NOT_A_PIN,
|
||||
(uint16_t) &PINJ,
|
||||
(uint16_t) &PINK,
|
||||
(uint16_t) &PINL,
|
||||
};
|
||||
|
||||
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 ** PWM2
|
||||
PE , // PE 5 ** 3 ** PWM3
|
||||
PG , // PG 5 ** 4 ** PWM4
|
||||
PE , // PE 3 ** 5 ** PWM5
|
||||
PH , // PH 3 ** 6 ** PWM6
|
||||
PH , // PH 4 ** 7 ** PWM7
|
||||
PH , // PH 5 ** 8 ** PWM8
|
||||
PH , // PH 6 ** 9 ** PWM9
|
||||
PB , // PB 4 ** 10 ** PWM10
|
||||
PB , // PB 5 ** 11 ** PWM11
|
||||
PB , // PB 6 ** 12 ** PWM12
|
||||
PB , // PB 7 ** 13 ** PWM13
|
||||
PJ , // PJ 1 ** 14 ** USART3_TX
|
||||
PJ , // PJ 0 ** 15 ** USART3_RX
|
||||
PH , // PH 1 ** 16 ** USART2_TX
|
||||
PH , // PH 0 ** 17 ** USART2_RX
|
||||
PD , // PD 3 ** 18 ** USART1_TX
|
||||
PD , // PD 2 ** 19 ** USART1_RX
|
||||
PD , // PD 1 ** 20 ** I2C_SDA
|
||||
PD , // PD 0 ** 21 ** I2C_SCL
|
||||
PA , // PA 0 ** 22 ** D22
|
||||
PA , // PA 1 ** 23 ** D23
|
||||
PA , // PA 2 ** 24 ** D24
|
||||
PA , // PA 3 ** 25 ** D25
|
||||
PA , // PA 4 ** 26 ** D26
|
||||
PA , // PA 5 ** 27 ** D27
|
||||
PA , // PA 6 ** 28 ** D28
|
||||
PA , // PA 7 ** 29 ** D29
|
||||
PC , // PC 7 ** 30 ** D30
|
||||
PC , // PC 6 ** 31 ** D31
|
||||
PC , // PC 5 ** 32 ** D32
|
||||
PC , // PC 4 ** 33 ** D33
|
||||
PC , // PC 3 ** 34 ** D34
|
||||
PC , // PC 2 ** 35 ** D35
|
||||
PC , // PC 1 ** 36 ** D36
|
||||
PC , // PC 0 ** 37 ** D37
|
||||
PD , // PD 7 ** 38 ** D38
|
||||
PG , // PG 2 ** 39 ** D39
|
||||
PG , // PG 1 ** 40 ** D40
|
||||
PG , // PG 0 ** 41 ** D41
|
||||
PL , // PL 7 ** 42 ** D42
|
||||
PL , // PL 6 ** 43 ** D43
|
||||
PL , // PL 5 ** 44 ** D44
|
||||
PL , // PL 4 ** 45 ** D45
|
||||
PL , // PL 3 ** 46 ** D46
|
||||
PL , // PL 2 ** 47 ** D47
|
||||
PL , // PL 1 ** 48 ** D48
|
||||
PL , // PL 0 ** 49 ** D49
|
||||
PB , // PB 3 ** 50 ** SPI_MISO
|
||||
PB , // PB 2 ** 51 ** SPI_MOSI
|
||||
PB , // PB 1 ** 52 ** SPI_SCK
|
||||
PB , // PB 0 ** 53 ** SPI_SS
|
||||
PF , // PF 0 ** 54 ** A0
|
||||
PF , // PF 1 ** 55 ** A1
|
||||
PF , // PF 2 ** 56 ** A2
|
||||
PF , // PF 3 ** 57 ** A3
|
||||
PF , // PF 4 ** 58 ** A4
|
||||
PF , // PF 5 ** 59 ** A5
|
||||
PF , // PF 6 ** 60 ** A6
|
||||
PF , // PF 7 ** 61 ** A7
|
||||
PK , // PK 0 ** 62 ** A8
|
||||
PK , // PK 1 ** 63 ** A9
|
||||
PK , // PK 2 ** 64 ** A10
|
||||
PK , // PK 3 ** 65 ** A11
|
||||
PK , // PK 4 ** 66 ** A12
|
||||
PK , // PK 5 ** 67 ** A13
|
||||
PK , // PK 6 ** 68 ** A14
|
||||
PK , // PK 7 ** 69 ** A15
|
||||
PG , // PG 4 ** 70 ** D70
|
||||
PG , // PG 3 ** 71 ** D71
|
||||
PJ , // PJ 2 ** 72 ** D72
|
||||
PJ , // PJ 3 ** 73 ** D73
|
||||
PJ , // PJ 7 ** 74 ** D74
|
||||
PJ , // PJ 4 ** 75 ** D75
|
||||
PJ , // PJ 5 ** 76 ** D76
|
||||
PJ , // PJ 6 ** 77 ** D77
|
||||
PE , // PE 2 ** 78 ** D78
|
||||
PE , // PE 6 ** 79 ** D79
|
||||
PE , // PE 7 ** 80 ** D80
|
||||
PD , // PD 4 ** 81 ** D81
|
||||
PD , // PD 5 ** 82 ** D82
|
||||
PD , // PD 6 ** 83 ** D83
|
||||
PH , // PH 2 ** 84 ** D84
|
||||
PH , // PH 7 ** 85 ** D85
|
||||
};
|
||||
|
||||
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 ** PWM2
|
||||
_BV( 5 ) , // PE 5 ** 3 ** PWM3
|
||||
_BV( 5 ) , // PG 5 ** 4 ** PWM4
|
||||
_BV( 3 ) , // PE 3 ** 5 ** PWM5
|
||||
_BV( 3 ) , // PH 3 ** 6 ** PWM6
|
||||
_BV( 4 ) , // PH 4 ** 7 ** PWM7
|
||||
_BV( 5 ) , // PH 5 ** 8 ** PWM8
|
||||
_BV( 6 ) , // PH 6 ** 9 ** PWM9
|
||||
_BV( 4 ) , // PB 4 ** 10 ** PWM10
|
||||
_BV( 5 ) , // PB 5 ** 11 ** PWM11
|
||||
_BV( 6 ) , // PB 6 ** 12 ** PWM12
|
||||
_BV( 7 ) , // PB 7 ** 13 ** PWM13
|
||||
_BV( 1 ) , // PJ 1 ** 14 ** USART3_TX
|
||||
_BV( 0 ) , // PJ 0 ** 15 ** USART3_RX
|
||||
_BV( 1 ) , // PH 1 ** 16 ** USART2_TX
|
||||
_BV( 0 ) , // PH 0 ** 17 ** USART2_RX
|
||||
_BV( 3 ) , // PD 3 ** 18 ** USART1_TX
|
||||
_BV( 2 ) , // PD 2 ** 19 ** USART1_RX
|
||||
_BV( 1 ) , // PD 1 ** 20 ** I2C_SDA
|
||||
_BV( 0 ) , // PD 0 ** 21 ** I2C_SCL
|
||||
_BV( 0 ) , // PA 0 ** 22 ** D22
|
||||
_BV( 1 ) , // PA 1 ** 23 ** D23
|
||||
_BV( 2 ) , // PA 2 ** 24 ** D24
|
||||
_BV( 3 ) , // PA 3 ** 25 ** D25
|
||||
_BV( 4 ) , // PA 4 ** 26 ** D26
|
||||
_BV( 5 ) , // PA 5 ** 27 ** D27
|
||||
_BV( 6 ) , // PA 6 ** 28 ** D28
|
||||
_BV( 7 ) , // PA 7 ** 29 ** D29
|
||||
_BV( 7 ) , // PC 7 ** 30 ** D30
|
||||
_BV( 6 ) , // PC 6 ** 31 ** D31
|
||||
_BV( 5 ) , // PC 5 ** 32 ** D32
|
||||
_BV( 4 ) , // PC 4 ** 33 ** D33
|
||||
_BV( 3 ) , // PC 3 ** 34 ** D34
|
||||
_BV( 2 ) , // PC 2 ** 35 ** D35
|
||||
_BV( 1 ) , // PC 1 ** 36 ** D36
|
||||
_BV( 0 ) , // PC 0 ** 37 ** D37
|
||||
_BV( 7 ) , // PD 7 ** 38 ** D38
|
||||
_BV( 2 ) , // PG 2 ** 39 ** D39
|
||||
_BV( 1 ) , // PG 1 ** 40 ** D40
|
||||
_BV( 0 ) , // PG 0 ** 41 ** D41
|
||||
_BV( 7 ) , // PL 7 ** 42 ** D42
|
||||
_BV( 6 ) , // PL 6 ** 43 ** D43
|
||||
_BV( 5 ) , // PL 5 ** 44 ** D44
|
||||
_BV( 4 ) , // PL 4 ** 45 ** D45
|
||||
_BV( 3 ) , // PL 3 ** 46 ** D46
|
||||
_BV( 2 ) , // PL 2 ** 47 ** D47
|
||||
_BV( 1 ) , // PL 1 ** 48 ** D48
|
||||
_BV( 0 ) , // PL 0 ** 49 ** D49
|
||||
_BV( 3 ) , // PB 3 ** 50 ** SPI_MISO
|
||||
_BV( 2 ) , // PB 2 ** 51 ** SPI_MOSI
|
||||
_BV( 1 ) , // PB 1 ** 52 ** SPI_SCK
|
||||
_BV( 0 ) , // PB 0 ** 53 ** SPI_SS
|
||||
_BV( 0 ) , // PF 0 ** 54 ** A0
|
||||
_BV( 1 ) , // PF 1 ** 55 ** A1
|
||||
_BV( 2 ) , // PF 2 ** 56 ** A2
|
||||
_BV( 3 ) , // PF 3 ** 57 ** A3
|
||||
_BV( 4 ) , // PF 4 ** 58 ** A4
|
||||
_BV( 5 ) , // PF 5 ** 59 ** A5
|
||||
_BV( 6 ) , // PF 6 ** 60 ** A6
|
||||
_BV( 7 ) , // PF 7 ** 61 ** A7
|
||||
_BV( 0 ) , // PK 0 ** 62 ** A8
|
||||
_BV( 1 ) , // PK 1 ** 63 ** A9
|
||||
_BV( 2 ) , // PK 2 ** 64 ** A10
|
||||
_BV( 3 ) , // PK 3 ** 65 ** A11
|
||||
_BV( 4 ) , // PK 4 ** 66 ** A12
|
||||
_BV( 5 ) , // PK 5 ** 67 ** A13
|
||||
_BV( 6 ) , // PK 6 ** 68 ** A14
|
||||
_BV( 7 ) , // PK 7 ** 69 ** A15
|
||||
_BV( 4 ) , // PG 4 ** 70 ** D70
|
||||
_BV( 3 ) , // PG 3 ** 71 ** D71
|
||||
_BV( 2 ) , // PJ 2 ** 72 ** D72
|
||||
_BV( 3 ) , // PJ 3 ** 73 ** D73
|
||||
_BV( 7 ) , // PJ 7 ** 74 ** D74
|
||||
_BV( 4 ) , // PJ 4 ** 75 ** D75
|
||||
_BV( 5 ) , // PJ 5 ** 76 ** D76
|
||||
_BV( 6 ) , // PJ 6 ** 77 ** D77
|
||||
_BV( 2 ) , // PE 2 ** 78 ** D78
|
||||
_BV( 6 ) , // PE 6 ** 79 ** D79
|
||||
_BV( 7 ) , // PE 7 ** 80 ** D80
|
||||
_BV( 4 ) , // PD 4 ** 81 ** D81
|
||||
_BV( 5 ) , // PD 5 ** 82 ** D82
|
||||
_BV( 6 ) , // PD 6 ** 83 ** D83
|
||||
_BV( 2 ) , // PH 2 ** 84 ** D84
|
||||
_BV( 7 ) , // PH 7 ** 85 ** D85
|
||||
};
|
||||
|
||||
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 ** PWM2
|
||||
TIMER3C , // PE 5 ** 3 ** PWM3
|
||||
TIMER0B , // PG 5 ** 4 ** PWM4
|
||||
TIMER3A , // PE 3 ** 5 ** PWM5
|
||||
TIMER4A , // PH 3 ** 6 ** PWM6
|
||||
TIMER4B , // PH 4 ** 7 ** PWM7
|
||||
TIMER4C , // PH 5 ** 8 ** PWM8
|
||||
TIMER2B , // PH 6 ** 9 ** PWM9
|
||||
TIMER2A , // PB 4 ** 10 ** PWM10
|
||||
TIMER1A , // PB 5 ** 11 ** PWM11
|
||||
TIMER1B , // PB 6 ** 12 ** PWM12
|
||||
TIMER0A , // PB 7 ** 13 ** PWM13
|
||||
NOT_ON_TIMER , // PJ 1 ** 14 ** USART3_TX
|
||||
NOT_ON_TIMER , // PJ 0 ** 15 ** USART3_RX
|
||||
NOT_ON_TIMER , // PH 1 ** 16 ** USART2_TX
|
||||
NOT_ON_TIMER , // PH 0 ** 17 ** USART2_RX
|
||||
NOT_ON_TIMER , // PD 3 ** 18 ** USART1_TX
|
||||
NOT_ON_TIMER , // PD 2 ** 19 ** USART1_RX
|
||||
NOT_ON_TIMER , // PD 1 ** 20 ** I2C_SDA
|
||||
NOT_ON_TIMER , // PD 0 ** 21 ** I2C_SCL
|
||||
NOT_ON_TIMER , // PA 0 ** 22 ** D22
|
||||
NOT_ON_TIMER , // PA 1 ** 23 ** D23
|
||||
NOT_ON_TIMER , // PA 2 ** 24 ** D24
|
||||
NOT_ON_TIMER , // PA 3 ** 25 ** D25
|
||||
NOT_ON_TIMER , // PA 4 ** 26 ** D26
|
||||
NOT_ON_TIMER , // PA 5 ** 27 ** D27
|
||||
NOT_ON_TIMER , // PA 6 ** 28 ** D28
|
||||
NOT_ON_TIMER , // PA 7 ** 29 ** D29
|
||||
NOT_ON_TIMER , // PC 7 ** 30 ** D30
|
||||
NOT_ON_TIMER , // PC 6 ** 31 ** D31
|
||||
NOT_ON_TIMER , // PC 5 ** 32 ** D32
|
||||
NOT_ON_TIMER , // PC 4 ** 33 ** D33
|
||||
NOT_ON_TIMER , // PC 3 ** 34 ** D34
|
||||
NOT_ON_TIMER , // PC 2 ** 35 ** D35
|
||||
NOT_ON_TIMER , // PC 1 ** 36 ** D36
|
||||
NOT_ON_TIMER , // PC 0 ** 37 ** D37
|
||||
NOT_ON_TIMER , // PD 7 ** 38 ** D38
|
||||
NOT_ON_TIMER , // PG 2 ** 39 ** D39
|
||||
NOT_ON_TIMER , // PG 1 ** 40 ** D40
|
||||
NOT_ON_TIMER , // PG 0 ** 41 ** D41
|
||||
NOT_ON_TIMER , // PL 7 ** 42 ** D42
|
||||
NOT_ON_TIMER , // PL 6 ** 43 ** D43
|
||||
TIMER5C , // PL 5 ** 44 ** D44
|
||||
TIMER5B , // PL 4 ** 45 ** D45
|
||||
TIMER5A , // PL 3 ** 46 ** D46
|
||||
NOT_ON_TIMER , // PL 2 ** 47 ** D47
|
||||
NOT_ON_TIMER , // PL 1 ** 48 ** D48
|
||||
NOT_ON_TIMER , // PL 0 ** 49 ** D49
|
||||
NOT_ON_TIMER , // PB 3 ** 50 ** SPI_MISO
|
||||
NOT_ON_TIMER , // PB 2 ** 51 ** SPI_MOSI
|
||||
NOT_ON_TIMER , // PB 1 ** 52 ** SPI_SCK
|
||||
NOT_ON_TIMER , // PB 0 ** 53 ** SPI_SS
|
||||
NOT_ON_TIMER , // PF 0 ** 54 ** A0
|
||||
NOT_ON_TIMER , // PF 1 ** 55 ** A1
|
||||
NOT_ON_TIMER , // PF 2 ** 56 ** A2
|
||||
NOT_ON_TIMER , // PF 3 ** 57 ** A3
|
||||
NOT_ON_TIMER , // PF 4 ** 58 ** A4
|
||||
NOT_ON_TIMER , // PF 5 ** 59 ** A5
|
||||
NOT_ON_TIMER , // PF 6 ** 60 ** A6
|
||||
NOT_ON_TIMER , // PF 7 ** 61 ** A7
|
||||
NOT_ON_TIMER , // PK 0 ** 62 ** A8
|
||||
NOT_ON_TIMER , // PK 1 ** 63 ** A9
|
||||
NOT_ON_TIMER , // PK 2 ** 64 ** A10
|
||||
NOT_ON_TIMER , // PK 3 ** 65 ** A11
|
||||
NOT_ON_TIMER , // PK 4 ** 66 ** A12
|
||||
NOT_ON_TIMER , // PK 5 ** 67 ** A13
|
||||
NOT_ON_TIMER , // PK 6 ** 68 ** A14
|
||||
NOT_ON_TIMER , // PK 7 ** 69 ** A15
|
||||
NOT_ON_TIMER , // PG 4 ** 70 ** D70
|
||||
NOT_ON_TIMER , // PG 3 ** 71 ** D71
|
||||
NOT_ON_TIMER , // PJ 2 ** 72 ** D72
|
||||
NOT_ON_TIMER , // PJ 3 ** 73 ** D73
|
||||
NOT_ON_TIMER , // PJ 7 ** 74 ** D74
|
||||
NOT_ON_TIMER , // PJ 4 ** 75 ** D75
|
||||
NOT_ON_TIMER , // PJ 5 ** 76 ** D76
|
||||
NOT_ON_TIMER , // PJ 6 ** 77 ** D77
|
||||
NOT_ON_TIMER , // PE 2 ** 78 ** D78
|
||||
NOT_ON_TIMER , // PE 6 ** 79 ** D79
|
||||
NOT_ON_TIMER , // PE 7 ** 80 ** D80
|
||||
NOT_ON_TIMER , // PD 4 ** 81 ** D81
|
||||
NOT_ON_TIMER , // PD 5 ** 82 ** D82
|
||||
NOT_ON_TIMER , // PD 6 ** 83 ** D83
|
||||
NOT_ON_TIMER , // PH 2 ** 84 ** D84
|
||||
NOT_ON_TIMER , // PH 7 ** 85 ** D85
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,285 @@
|
||||
/*
|
||||
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 $
|
||||
|
||||
Changelog
|
||||
-----------
|
||||
11/25/11 - ryan@ryanmsutton.com - Add pins for Sanguino 644P and 1284P
|
||||
07/15/12 - ryan@ryanmsutton.com - Updated for arduino0101
|
||||
*/
|
||||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#define NOT_A_PIN 0
|
||||
#define NOT_A_PORT 0
|
||||
|
||||
#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 TIMER5A 14
|
||||
#define TIMER5B 15
|
||||
#define TIMER5C 16
|
||||
|
||||
const static uint8_t SS = 4;
|
||||
const static uint8_t MOSI = 5;
|
||||
const static uint8_t MISO = 6;
|
||||
const static uint8_t SCK = 7;
|
||||
|
||||
static const uint8_t SDA = 17;
|
||||
static const uint8_t SCL = 16;
|
||||
static const uint8_t LED_BUILTIN = 13;
|
||||
|
||||
static const uint8_t A0 = 31;
|
||||
static const uint8_t A1 = 30;
|
||||
static const uint8_t A2 = 29;
|
||||
static const uint8_t A3 = 28;
|
||||
static const uint8_t A4 = 27;
|
||||
static const uint8_t A5 = 26;
|
||||
static const uint8_t A6 = 25;
|
||||
static const uint8_t A7 = 24;
|
||||
|
||||
// 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[];
|
||||
|
||||
// ATMEL ATMEGA644P / SANGUINO
|
||||
//
|
||||
// +---\/---+
|
||||
// INT0 (D 0) PB0 1| |40 PA0 (AI 0 / D31)
|
||||
// INT1 (D 1) PB1 2| |39 PA1 (AI 1 / D30)
|
||||
// INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29)
|
||||
// PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28)
|
||||
// PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27)
|
||||
// MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26)
|
||||
// MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25)
|
||||
// SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24)
|
||||
// RST 9| |32 AREF
|
||||
// VCC 10| |31 GND
|
||||
// GND 11| |30 AVCC
|
||||
// XTAL2 12| |29 PC7 (D 23)
|
||||
// XTAL1 13| |28 PC6 (D 22)
|
||||
// RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI
|
||||
// TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO
|
||||
// RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS
|
||||
// TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK
|
||||
// PWM (D 12) PD4 18| |23 PC1 (D 17) SDA
|
||||
// PWM (D 13) PD5 19| |22 PC0 (D 16) SCL
|
||||
// PWM (D 14) PD6 20| |21 PD7 (D 15) PWM
|
||||
// +--------+
|
||||
//
|
||||
#define NUM_DIGITAL_PINS 24
|
||||
#define NUM_ANALOG_INPUTS 8
|
||||
#define analogInputToDigitalPin(p) ((p < 7) ? (p) + 24 : -1)
|
||||
|
||||
#define digitalPinHasPWM(p) ((p) == 3 || (p) == 4 || (p) == 12 || (p) == 13 || (p) == 14 || (p) == 15 )
|
||||
|
||||
#define digitalPinToPCICR(p) ( (((p) >= 0) && ((p) <= 31)) ? (&PCICR) : ((uint8_t *)0) )
|
||||
|
||||
#define digitalPinToPCICRbit(p) ( (((p) >= 24) && ((p) <= 31)) ? 0 : \
|
||||
( (((p) >= 0) && ((p) <= 7)) ? 1 : \
|
||||
( (((p) >= 16) && ((p) <= 23)) ? 2 : \
|
||||
( (((p) >= 8) && ((p) <= 15)) ? 3 : \
|
||||
0 ) ) ) )
|
||||
|
||||
#define digitalPinToPCMSK(p) ( (((p) >= 24) && ((p) <= 31)) ? (&PCMSK0) : \
|
||||
( (((p) >= 0) && ((p) <= 7)) ? (&PCMSK1) : \
|
||||
( (((p) >= 16) && ((p) <= 23)) ? (&PCMSK2) : \
|
||||
( (((p) >= 8) && ((p) <= 15)) ? (&PCMSK3) : \
|
||||
((uint8_t *)0) ) ) ) )
|
||||
|
||||
|
||||
#define digitalPinToPCMSKbit(p) ( (((p) >= 24) && ((p) <= 31)) ? (31 - (p)) : \
|
||||
( (((p) >= 0) && ((p) <= 7)) ? (p) : \
|
||||
( (((p) >= 16) && ((p) <= 23)) ? ((p) - 16) : \
|
||||
( (((p) >= 8) && ((p) <= 15)) ? ((p) - 8) : \
|
||||
0 ) ) ) )
|
||||
|
||||
#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
|
||||
|
||||
#ifdef ARDUINO_MAIN
|
||||
// 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,
|
||||
(uint16_t) &DDRA,
|
||||
(uint16_t) &DDRB,
|
||||
(uint16_t) &DDRC,
|
||||
(uint16_t) &DDRD,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_output_PGM[] =
|
||||
{
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PORTA,
|
||||
(uint16_t) &PORTB,
|
||||
(uint16_t) &PORTC,
|
||||
(uint16_t) &PORTD,
|
||||
};
|
||||
const uint16_t PROGMEM port_to_input_PGM[] =
|
||||
{
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PINA,
|
||||
(uint16_t) &PINB,
|
||||
(uint16_t) &PINC,
|
||||
(uint16_t) &PIND,
|
||||
};
|
||||
const uint8_t PROGMEM digital_pin_to_port_PGM[] =
|
||||
{
|
||||
PB, /* 0 */
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PD, /* 8 */
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PC, /* 16 */
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PA, /* 24 */
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PA,
|
||||
PA /* 31 */
|
||||
};
|
||||
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] =
|
||||
{
|
||||
_BV(0), /* 0, port B */
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(0), /* 8, port D */
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(0), /* 16, port C */
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(7), /* 24, port A */
|
||||
_BV(6),
|
||||
_BV(5),
|
||||
_BV(4),
|
||||
_BV(3),
|
||||
_BV(2),
|
||||
_BV(1),
|
||||
_BV(0)
|
||||
};
|
||||
const uint8_t PROGMEM digital_pin_to_timer_PGM[] =
|
||||
{
|
||||
NOT_ON_TIMER, /* 0 - PB0 */
|
||||
NOT_ON_TIMER, /* 1 - PB1 */
|
||||
NOT_ON_TIMER, /* 2 - PB2 */
|
||||
TIMER0A, /* 3 - PB3 */
|
||||
TIMER0B, /* 4 - PB4 */
|
||||
NOT_ON_TIMER, /* 5 - PB5 */
|
||||
NOT_ON_TIMER, /* 6 - PB6 */
|
||||
NOT_ON_TIMER, /* 7 - PB7 */
|
||||
NOT_ON_TIMER, /* 8 - PD0 */
|
||||
NOT_ON_TIMER, /* 9 - PD1 */
|
||||
NOT_ON_TIMER, /* 10 - PD2 */
|
||||
NOT_ON_TIMER, /* 11 - PD3 */
|
||||
TIMER1B, /* 12 - PD4 */
|
||||
TIMER1A, /* 13 - PD5 */
|
||||
TIMER2B, /* 14 - PD6 */
|
||||
TIMER2A, /* 15 - PD7 */
|
||||
NOT_ON_TIMER, /* 16 - PC0 */
|
||||
NOT_ON_TIMER, /* 17 - PC1 */
|
||||
NOT_ON_TIMER, /* 18 - PC2 */
|
||||
NOT_ON_TIMER, /* 19 - PC3 */
|
||||
NOT_ON_TIMER, /* 20 - PC4 */
|
||||
NOT_ON_TIMER, /* 21 - PC5 */
|
||||
NOT_ON_TIMER, /* 22 - PC6 */
|
||||
NOT_ON_TIMER, /* 23 - PC7 */
|
||||
NOT_ON_TIMER, /* 24 - PA0 */
|
||||
NOT_ON_TIMER, /* 25 - PA1 */
|
||||
NOT_ON_TIMER, /* 26 - PA2 */
|
||||
NOT_ON_TIMER, /* 27 - PA3 */
|
||||
NOT_ON_TIMER, /* 28 - PA4 */
|
||||
NOT_ON_TIMER, /* 29 - PA5 */
|
||||
NOT_ON_TIMER, /* 30 - PA6 */
|
||||
NOT_ON_TIMER /* 31 - PA7 */
|
||||
};
|
||||
#endif
|
||||
#endif
|
@ -0,0 +1,238 @@
|
||||
/*
|
||||
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 20
|
||||
#define NUM_ANALOG_INPUTS 6
|
||||
#define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1)
|
||||
|
||||
#if defined(__AVR_ATmega8__)
|
||||
#define digitalPinHasPWM(p) ((p) == 9 || (p) == 10 || (p) == 11)
|
||||
#else
|
||||
#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
|
||||
#endif
|
||||
|
||||
static const uint8_t SS = 10;
|
||||
static const uint8_t MOSI = 11;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 13;
|
||||
|
||||
static const uint8_t SDA = 18;
|
||||
static const uint8_t SCL = 19;
|
||||
#define LED_BUILTIN 13
|
||||
|
||||
static const uint8_t A0 = 14;
|
||||
static const uint8_t A1 = 15;
|
||||
static const uint8_t A2 = 16;
|
||||
static const uint8_t A3 = 17;
|
||||
static const uint8_t A4 = 18;
|
||||
static const uint8_t A5 = 19;
|
||||
static const uint8_t A6 = 20;
|
||||
static const uint8_t A7 = 21;
|
||||
|
||||
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
|
||||
#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
|
||||
#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0))))
|
||||
#define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14)))
|
||||
|
||||
#define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : 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 ATMEGA8 & 168 / ARDUINO
|
||||
//
|
||||
// +-\/-+
|
||||
// PC6 1| |28 PC5 (AI 5)
|
||||
// (D 0) PD0 2| |27 PC4 (AI 4)
|
||||
// (D 1) PD1 3| |26 PC3 (AI 3)
|
||||
// (D 2) PD2 4| |25 PC2 (AI 2)
|
||||
// PWM+ (D 3) PD3 5| |24 PC1 (AI 1)
|
||||
// (D 4) PD4 6| |23 PC0 (AI 0)
|
||||
// VCC 7| |22 GND
|
||||
// GND 8| |21 AREF
|
||||
// PB6 9| |20 AVCC
|
||||
// PB7 10| |19 PB5 (D 13)
|
||||
// PWM+ (D 5) PD5 11| |18 PB4 (D 12)
|
||||
// PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM
|
||||
// (D 7) PD7 13| |16 PB2 (D 10) PWM
|
||||
// (D 8) PB0 14| |15 PB1 (D 9) PWM
|
||||
// +----+
|
||||
//
|
||||
// (PWM+ indicates the additional PWM pins on the ATmega168.)
|
||||
|
||||
// ATMEL ATMEGA1280 / ARDUINO
|
||||
//
|
||||
// 0-7 PE0-PE7 works
|
||||
// 8-13 PB0-PB5 works
|
||||
// 14-21 PA0-PA7 works
|
||||
// 22-29 PH0-PH7 works
|
||||
// 30-35 PG5-PG0 works
|
||||
// 36-43 PC7-PC0 works
|
||||
// 44-51 PJ7-PJ0 works
|
||||
// 52-59 PL7-PL0 works
|
||||
// 60-67 PD7-PD0 works
|
||||
// A0-A7 PF0-PF7
|
||||
// A8-A15 PK0-PK7
|
||||
|
||||
|
||||
// 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,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_output_PGM[] = {
|
||||
NOT_A_PORT,
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PORTB,
|
||||
(uint16_t) &PORTC,
|
||||
(uint16_t) &PORTD,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_input_PGM[] = {
|
||||
NOT_A_PORT,
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PINB,
|
||||
(uint16_t) &PINC,
|
||||
(uint16_t) &PIND,
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
||||
PD, /* 0 */
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PD,
|
||||
PB, /* 8 */
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PB,
|
||||
PC, /* 14 */
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
PC,
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
|
||||
_BV(0), /* 0, port D */
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(6),
|
||||
_BV(7),
|
||||
_BV(0), /* 8, port B */
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
_BV(0), /* 14, port C */
|
||||
_BV(1),
|
||||
_BV(2),
|
||||
_BV(3),
|
||||
_BV(4),
|
||||
_BV(5),
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
|
||||
NOT_ON_TIMER, /* 0 - port D */
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER,
|
||||
// on the ATmega168, digital pin 3 has hardware pwm
|
||||
#if defined(__AVR_ATmega8__)
|
||||
NOT_ON_TIMER,
|
||||
#else
|
||||
TIMER2B,
|
||||
#endif
|
||||
NOT_ON_TIMER,
|
||||
// on the ATmega168, digital pins 5 and 6 have hardware pwm
|
||||
#if defined(__AVR_ATmega8__)
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER,
|
||||
#else
|
||||
TIMER0B,
|
||||
TIMER0A,
|
||||
#endif
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER, /* 8 - port B */
|
||||
TIMER1A,
|
||||
TIMER1B,
|
||||
#if defined(__AVR_ATmega8__)
|
||||
TIMER2,
|
||||
#else
|
||||
TIMER2A,
|
||||
#endif
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER, /* 14 - port C */
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER,
|
||||
NOT_ON_TIMER,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// These serial port names are intended to allow libraries and architecture-neutral
|
||||
// sketches to automatically default to the correct port name for a particular type
|
||||
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
|
||||
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
|
||||
//
|
||||
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||
//
|
||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||
//
|
||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||
// pins are NOT connected to anything by default.
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#define SERIAL_PORT_HARDWARE Serial
|
||||
|
||||
#endif
|
Loading…
Reference in new issue