FastArduino - ATtinyX5 Support v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
Enumerations | Functions
board Namespace Reference

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...
 

Detailed Description

Defines all types and constants specific to support ATtinyX5 MCU targets.

Enumeration Type Documentation

◆ Port

enum class board::Port : uint8_t
strong

Defines all available ports of ATtinyX5.

Enumerator
PORT_B 

Port B (5 IO)

Definition at line 54 of file attiny_x5.h.

◆ DigitalPin

enum class board::DigitalPin : uint8_t
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.

◆ AnalogClock

enum class board::AnalogClock : uint8_t
strong

Defines available clocks of ATtinyX5, used for analog input.

Definition at line 90 of file attiny_x5.h.

◆ AnalogReference

enum class board::AnalogReference : uint8_t
strong

Defines available voltage references of ATtinyX5, used for analog input.

Enumerator
AREF 

Voltage reference is given by the AREF (PB0) pin.

AVCC 

Voltage reference is given by the Vcc pin.

INTERNAL_1_1V 

Voltage reference is internal 1.1V reference, generated from the internal bandgap reference.

INTERNAL_2_56V 

Voltage reference is internal 2.56V reference, without external bypass capacitor, disconnected from PB0 (AREF).

INTERNAL_2_56V_BYPASS_CAP 

Voltage reference is internal 2.56V reference, with external bypass capacitor at PB0 (AREF).

Definition at line 102 of file attiny_x5.h.

◆ AnalogPin

enum class board::AnalogPin : uint8_t
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.

◆ PWMPin

enum class board::PWMPin : uint8_t
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.

◆ ExternalInterruptPin

enum class board::ExternalInterruptPin : uint8_t
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.

◆ InterruptPin

enum class board::InterruptPin : uint8_t
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.

◆ USART

enum class board::USART : uint8_t
strong

Defines all USART modules of ATtinyX5, actually none at all.

Definition at line 201 of file attiny_x5.h.

◆ Timer

enum class board::Timer : uint8_t
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.

◆ SleepMode

enum class board::SleepMode : uint8_t
strong

Defines all available sleep modes for ATmega328P.

Enumerator
IDLE 

In this mode, CPU is stopped but all other peripherals and interrupts work normally.

In this mode, current consumption is reduced to about 25% of active mode consumption.

ADC_NOISE_REDUCTION 

In this mode, CPU is stopped but other peripherals and interrupts work normally, except IO.

This mode is actually very similar to IDLE.

POWER_DOWN 

In this mode, everything is stopped (including oscillator) but external interrupts, USI start condition (if enabled) and Watchdog Timer (if enabled).

This is lowest current consumption mode, typically a few uA, depending on other factors (voltage, watchdog enabled or not). Waking up from this mode may take significant time until internal oscillator is restarted and stabilized; refer to datasheet for more detailed data (look for Start-up times).

POWER_SAVE 

This mode is exactly the same POWER_DOWN.

STANDBY 

This mode is exactly the same POWER_DOWN.

EXTENDED_STANDBY 

This mode is exactly the same POWER_SAVE.

Definition at line 219 of file attiny_x5.h.

Function Documentation

◆ init()

static void board::init ( )
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.