Hi,
I need clarification.
I undertand what << operator does
The left shift operator << causes the bits of the left operand to be shifted left by the number of positions specified by the right operand.
e.g variable << number_of_bits;
Now with pin registers I have following command
1 << DDC3
I thought DDC3 would represent the 4th bit of the DDRC register but by the look of it DDC3 is the index of that bit so it is 4.
then the comand really is
1<<4
which returns
1000
So the command
DDRC|=1<<DDC3
would set the forth bit of the DDRC register to one meaning setting A3 pin as output
Do I understand this correctly?
I find the practice of having separate names for "4" depending on which registers you're going to apply (1<<4) to to be "annoying", but it's common practice. (and you actually want that if the name is something like "the tx complete bit", rather than "bit 4 in register portc", so it sort-of makes sense.)
Unlike Arduino's board-wide "pin numbers", the Atmel-provided definitions have no way of uniquely identifying a port/bit combination in a single symbol.