Atmel code reference or API documentation?

After looking around a bit it seems finding a good code reference for Atmel is harder then I thought.
There are some general that tell you how to code in C but what I am after is the particularities that apply to Atmel chips.
For example where can I find the information that PORTB is the register for the pins and setting a bitmask on it sets the output (or pulls up a pin)?
How do I know that comparing a bitmask to PINB gives me the current state of a pin definded by the bitmask?
Think I found somewhere the constant names for each individual pin too, but can’t remember where…
What does #define F_CPU 4800000UL do exactly and what other possible values are there?
Setting the fuses is still a mystery to me. Set them according to usual values from drivers that target same chip that I use but would like to know what I am doing there somehow… :wink:

Crawling through the code repository in the sticky gave me a lot of information from which a lot can be derived, but is there some complete reference somewhere?

have you take a look at datasheet?

Oh, there is also a datasheet with code examples… only had a technical one with electrical characteristics, timing and voltage graphs and physical dimensions.
Thanks, found a complete one now. Now I have a little bit more to read haha.