Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
/* pins_arduino.h - Pin definition functions for Arduino Part of Arduino - http://www.arduino.cc/ Copyright (c) 2007 David A. Mellis Copyright 2015~2018 Spence Konde 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 #define ATTINYX4 1 #define __AVR_ATtinyX4__ #define USE_SOFTWARE_SPI 1 #include <avr/pgmspace.h> #define NUM_DIGITAL_PINS 12 #define NUM_ANALOG_INPUTS 8 #define analogInputToDigitalPin(p) (p) #define digitalPinHasPWM(p) ((p) == 5 || (p) == 6 || (p) == 7 || (p) == 8) //This part has a USI, not an SPI module. Accordingly, there is no MISO/MOSI in hardware. There's a DI and a DO. When the chip is used as master, DI is used as MISO, DO is MOSI; the defines here specify the pins for master mode, as SPI master is much more commonly used in Arduino-land than SPI slave, and these defines are required for compatibility. Be aware of this when using the USI SPI fucntionality (and also, be aware that the MISO and MOSI markings on the pinout diagram in the datasheet are for ISP programming, where the chip is a slave. The pinout diagram included with this core attempts to clarify this) #define ADC_TEMPERATURE 34 #define SS 3 #define MOSI 5 #define MISO 6 #define SCK 4 #define USI_DDR_PORT DDRA #define USI_SCK_PORT DDRA #define USCK_DD_PIN DDA4 #define DO_DD_PIN DDA5 #define DI_DD_PIN DDA6 # define DDR_USI DDRA # define PORT_USI PORTA # define PIN_USI PINA # define PORT_USI_SDA PORTA6 # define PORT_USI_SCL PORTA4 # define PIN_USI_SDA PINA6 # define PIN_USI_SCL PINA4 # define USI_START_VECTOR USI_START_vect # define USI_OVERFLOW_VECTOR USI_OVF_vect # define DDR_USI_CL DDR_USI # define PORT_USI_CL PORT_USI # define PIN_USI_CL PIN_USI #ifndef USI_START_COND_INT # define USI_START_COND_INT USISIF #endif static const uint8_t SDA = 6; static const uint8_t SCL = 4; //Ax constants should not be used for digitalRead/digitalWrite/analogWrite functions, only analogRead(). //#define ANALOG_PINS_ARE_ADC_NUMBERS 1 static const uint8_t A0 = 0x80 | 0; static const uint8_t A1 = 0x80 | 1; static const uint8_t A2 = 0x80 | 2; static const uint8_t A3 = 0x80 | 3; static const uint8_t A4 = 0x80 | 4; static const uint8_t A5 = 0x80 | 5; static const uint8_t A6 = 0x80 | 6; static const uint8_t A7 = 0x80 | 7; #define PIN_A0 (0) #define PIN_A1 ( 1) #define PIN_A2 ( 2) #define PIN_A3 ( 3) #define PIN_A4 ( 4) #define PIN_A5 ( 5) #define PIN_A6 ( 6) #define PIN_A7 ( 7) #define PIN_B0 ( 10) #define PIN_B1 ( 9) #define PIN_B2 ( 8) #define PIN_B3 (11) /* RESET */ #define LED_BUILTIN (8) //---------------------------------------------------------- //---------------------------------------------------------- //Core Configuration (used to be in core_build_options.h) //If Software Serial communications doesn't work, run the TinyTuner sketch provided with the core to give you a calibrated OSCCAL value. //Change the value here with the tuned value. By default this option uses the default value which the compiler will optimise out. #define TUNED_OSCCAL_VALUE OSCCAL //e.g //#define TUNED_OSCCAL_VALUE 0x57 //Choosing not to initialise saves power and flash. 1 = initialise. #define INITIALIZE_ANALOG_TO_DIGITAL_CONVERTER 1 #define INITIALIZE_SECONDARY_TIMERS 1 /* The old standby ... millis on Timer 0. */ #define TIMER_TO_USE_FOR_MILLIS 0 /* Where to put the software serial? (Arduino Digital pin numbers) */ //WARNING, if using software, TX is on AIN0, RX is on AIN1. Comparator is favoured to use its interrupt for the RX pin. #define USE_SOFTWARE_SERIAL 1 //Please define the port on which the analog comparator is found. #define ANALOG_COMP_DDR DDRA #define ANALOG_COMP_PORT PORTA #define ANALOG_COMP_PIN PINA #define ANALOG_COMP_AIN0_BIT 3 #define ANALOG_COMP_AIN1_BIT 1 /* Analog reference bit masks. */ // VCC used as analog reference, disconnected from PA0 (AREF) #define DEFAULT (0) // External voltage reference at PA0 (AREF) pin, internal reference turned off #define EXTERNAL (1) // Internal 1.1V voltage reference #define INTERNAL (2) #define INTERNAL1V1 INTERNAL //---------------------------------------------------------- //---------------------------------------------------------- //---------------------------------------------------------- //---------------------------------------------------------- // PCICR = Pin Change Interrupt Control Register #define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 11) ? (&GIMSK) : ((uint8_t *)NULL)) #define digitalPinToPCICRbit(p) ( ((p) <= 7) ? PCIE0 : PCIE1 ) #define digitalPinToPCMSK(p) ( ((p) <= 7) ? (&PCMSK0) : (((p) <= 10) ? (&PCMSK1) : ((uint8_t *)NULL)) ) #define digitalPinToPCMSKbit(p) ( ((p) <= 7) ? (p) : (10 - (p)) ) #define digitalPinToInterrupt(p) ((p) == 8 ? 0 : NOT_AN_INTERRUPT) #ifdef ARDUINO_MAIN #warning "This is the CLOCKWISE pin mapping - make sure you're using the pinout diagram with the pins in clockwise order" // ATMEL ATTINY84 / ARDUINO // // +-\/-+ // VCC 1| |14 GND // (D 10) PB0 2| |13 PA0 (D 0) AREF // (D 9) PB1 3| |12 PA1 (D 1) // (D 11) PB3 4| |11 PA2 (D 2) // PWM INT0 (D 8) PB2 5| |10 PA3 (D 3) // PWM (D 7) PA7 6| |9 PA4 (D 4) // PWM (D 6) PA6 7| |8 PA5 (D 5) PWM // +----+ const uint16_t PROGMEM port_to_mode_PGM[] = { NOT_A_PORT, (uint16_t)&DDRA, (uint16_t)&DDRB, }; const uint16_t PROGMEM port_to_output_PGM[] = { NOT_A_PORT, (uint16_t)&PORTA, (uint16_t)&PORTB, }; const uint16_t PROGMEM port_to_input_PGM[] = { NOT_A_PORT, (uint16_t)&PINA, (uint16_t)&PINB, }; const uint8_t PROGMEM digital_pin_to_port_PGM[] = { PA, /* 0 */ PA, PA, PA, PA, PA, PA, PA, PB, /* 8 */ PB, PB, PB, /* 11 */ }; const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { _BV(0), /* port A */ _BV(1), _BV(2), _BV(3), _BV(4), _BV(5), _BV(6), _BV(7), _BV(2), /* port B */ _BV(1), _BV(0), _BV(3), }; const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, TIMER1B, /* OC1B */ TIMER1A, /* OC1A */ TIMER0B, /* OC0B */ TIMER0A, /* OC0A */ NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, }; #endif #endif //Old code, just here for temporary backup until I decide it is not needed. /* //WARNING, if using software, RX must be on a pin which has a Pin change interrupt <= 7 (e.g. PCINT6, or PCINT1, but not PCINT8) #define USE_SOFTWARE_SERIAL 1 //These are set to match Optiboot pins. #define SOFTWARE_SERIAL_PORT PORTA #define SOFTWARE_SERIAL_TX 9 #define SOFTWARE_SERIAL_PIN PINA #define SOFTWARE_SERIAL_RX 8*/
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
+12,000$ in 2 days
CSS | 53 min ago | 0.72 KB
Crypto admin access
53 min ago | 0.43 KB
Free Crypto Method
CSS | 54 min ago | 0.72 KB
Documents
54 min ago | 0.43 KB
Untitled
20 hours ago | 0.68 KB
The Road Not Taken
1 day ago | 0.79 KB
OG OLDHAM CODE
3 days ago | 27.75 KB
remove current bid and bid now button from au...
PHP | 4 days ago | 0.80 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!