I'm using an ATtiny861a, and noticed iotn861a.h has several macros defined under "Device Pin Definitions", for example:
#define PB0_DDR DDRDOSI #define PB0_PORT PORTMOSI #define PB0_PIN PINMOSI #define PB0_BIT MOSI
But I can't find the definitions for any of the symbols on the right. Unfortunately, neither can my compiler. e.g. When I try to use PB0_PORT I get a compiler error like "'PORTMOSI' undeclared (first use in this function)".
I suspect there's supposed to be lines somewhere (maybe in iotnx61.h) like:
#define DDRMOSI DDRB #define PORTMOSI PORTB #define PINMOSI PINB #define MOSI 0
Is this a bug in the library? If so, where can I report it? Note I'm using AtmelStudio 7 (and whatever avr-libc came with it).
The macros would be handy so I can use them to construct helpers like:
#define LED PB0 SETBIT(PORTNAME(LED), BITINDEX(LED))
I'd prefer to pull pin pinid-to-port-mappings from the stock headers rather than define them myself for each chip.
EDIT: I noticed some further issues. e.g. PB4_PORT and PA4_PORT are defined as the same thing, which strikes me as obviously wrong.