FastArduino - ATtinyX5 Support v1.10
C++ library to build fast but small Arduino/AVR projects
|
Defines all types and constants specific to support ATtinyX5 MCU targets. More...
Enumerations | |
enum class | Port : uint8_t { PORT_B = 0 , NONE = UINT8_MAX } |
Defines all available ports of ATtinyX5. More... | |
enum class | DigitalPin : uint8_t { D0_PB0 = 0 , D1_PB1 , D2_PB2 , D3_PB3 , D4_PB4 , LED = D0_PB0 , NONE = UINT8_MAX } |
Defines all available digital input/output pins of ATtinyX5, with additional pin imaginary numbering (as for an Arduino board). More... | |
enum class | AnalogClock : uint8_t { MAX_FREQ_50KHz = 0 , MAX_FREQ_100KHz , MAX_FREQ_200KHz , MAX_FREQ_500KHz , MAX_FREQ_1MHz } |
Defines available clocks of ATtinyX5, used for analog input. More... | |
enum class | AnalogReference : uint8_t { AREF = 0 , AVCC , INTERNAL_1_1V , INTERNAL_2_56V , INTERNAL_2_56V_BYPASS_CAP } |
Defines available voltage references of ATtinyX5, used for analog input. More... | |
enum class | AnalogPin : uint8_t { A1 = 0 , A2 , A3 , BANDGAP , GND , TEMP , NONE = UINT8_MAX } |
Defines all available analog input pins of ATtinyX5, with reference to ATtinyX5 pins. More... | |
enum class | PWMPin : uint8_t { D0_PB0_OC0A = 0 , D1_PB1_OC0B , NONE = UINT8_MAX } |
Defines all digital output pins of ATtinyX5, capable of PWM output. More... | |
enum class | ExternalInterruptPin : uint8_t { D2_PB2_EXT0 = 0 } |
Defines all digital output pins of ATtinyX5, usable as direct external interrupt pins. More... | |
enum class | InterruptPin : uint8_t { D0_PB0_PCI0 = uint8_t(DigitalPin::D0_PB0) , D1_PB1_PCI0 = uint8_t(DigitalPin::D1_PB1) , D2_PB2_PCI0 = uint8_t(DigitalPin::D2_PB2) , D3_PB3_PCI0 = uint8_t(DigitalPin::D3_PB3) , D4_PB4_PCI0 = uint8_t(DigitalPin::D4_PB4) } |
Defines all digital output pins of ATtinyX5, usable as pin change interrupt (PCI) pins. More... | |
enum class | USART : uint8_t |
Defines all USART modules of ATtinyX5, actually none at all. More... | |
enum class | Timer : uint8_t { TIMER0 = 0 , TIMER1 = 1 } |
Defines all timers available for ATtinyX5. More... | |
enum class | SleepMode : uint8_t { IDLE = SLEEP_MODE_IDLE , ADC_NOISE_REDUCTION = SLEEP_MODE_ADC , POWER_DOWN = SLEEP_MODE_PWR_DOWN , POWER_SAVE = SLEEP_MODE_PWR_DOWN , STANDBY = SLEEP_MODE_PWR_DOWN , EXTENDED_STANDBY = SLEEP_MODE_PWR_DOWN } |
Defines all available sleep modes for ATmega328P. More... | |
Functions | |
static void | init () |
Performs special initialization for ATtinyX5, actually nothing at all. More... | |
Defines all types and constants specific to support ATtinyX5 MCU targets.
|
strong |
Defines all available ports of ATtinyX5.
Enumerator | |
---|---|
PORT_B | Port B (5 IO) |
Definition at line 54 of file attiny_x5.h.
|
strong |
Defines all available digital input/output pins of ATtinyX5, with additional pin imaginary numbering (as for an Arduino board).
Each symbol is in the form Dxx_Pyz
, where xx
is the imaginary pin number, y
is the port letter (B, C or D) and z
is the bit number for that pin within its port.
Enumerator | |
---|---|
D0_PB0 | Pin PB0 (D0) |
D1_PB1 | Pin PB1 (D1) |
D2_PB2 | Pin PB2 (D2) |
D3_PB3 | Pin PB3 (D3) |
D4_PB4 | Pin PB4 (D4) |
LED | Shortcut for LED pin, arbitrarily chosen to be D0. |
Definition at line 69 of file attiny_x5.h.
|
strong |
Defines available clocks of ATtinyX5, used for analog input.
Definition at line 90 of file attiny_x5.h.
|
strong |
Defines available voltage references of ATtinyX5, used for analog input.
Definition at line 102 of file attiny_x5.h.
|
strong |
Defines all available analog input pins of ATtinyX5, with reference to ATtinyX5 pins.
Note that this includes also other sources than pin, e.g. the internal bandgap reference or the temperature sensor.
Enumerator | |
---|---|
A1 | Pin ADC1 (PB2) |
A2 | Pin ADC2 (PB4) |
A3 | Pin ADC3 (PB3) |
BANDGAP | Bandgap reference. |
GND | Ground reference. |
TEMP | Temperature sensor. |
Definition at line 131 of file attiny_x5.h.
|
strong |
Defines all digital output pins of ATtinyX5, capable of PWM output.
Each symbol is in the form Dxx_Pyz_OCuv
, where xx
is the imaginary pin number , y
is the port letter (B, C or D), z
is the bit number for that pin within its port, u
is the number of the timer used by this PWM pin and v
the letter indicating which compare register of the timer this PWM pin is mapped to.
Definition at line 157 of file attiny_x5.h.
|
strong |
Defines all digital output pins of ATtinyX5, usable as direct external interrupt pins.
Each symbol is in the form Dxx_Pyz_EXTu
, where xx
is the imaginary pin number , y
is the port letter (B, C or D), z
is the bit number for that pin within its port and u
is the number of the interrupt for that pin.
Definition at line 176 of file attiny_x5.h.
|
strong |
Defines all digital output pins of ATtinyX5, usable as pin change interrupt (PCI) pins.
Each symbol is in the form Dxx_Pyz_PCIu
, where xx
is the imaginary pin number, y
is the port letter (B, C or D), z
is the bit number for that pin within its port and u
is the number of the PCI vector for that pin.
Definition at line 189 of file attiny_x5.h.
|
strong |
Defines all USART modules of ATtinyX5, actually none at all.
Definition at line 201 of file attiny_x5.h.
|
strong |
Defines all timers available for ATtinyX5.
Enumerator | |
---|---|
TIMER0 | Timer0 (8 bits) |
TIMER1 | Timer1 (8 bits) |
Definition at line 208 of file attiny_x5.h.
|
strong |
Defines all available sleep modes for ATmega328P.
Definition at line 219 of file attiny_x5.h.
|
inlinestatic |
Performs special initialization for ATtinyX5, actually nothing at all.
This must be called first in your main()
function, even before sei()
. In general you should ALWAYS call this function at the beginning of your main()
even if you know it will not do anything; this will prevent strange behaviors when you want to port your code to another MCU target for which init()
does perform important initialization, e.g. ATmega32u4 (Arduino LEONARDO).
Definition at line 49 of file attiny_x5.h.