2 Module Representation in Header Files

A dedicated header file is available for each AVR device. The target device needs to be specified in the project settings (for any used IDE – MPLAB® X, Atmel Studio, or IAR EWAVR), and the header file will be automatically included in the main file of the created project. The header file is included as shown in the code below.

#include <avr/io.h>

All the needed register and structure definitions can be found in the header file. The macros and structures definitions which are already defined in the device-specific header file can be used, instead of using a register’s address.

This is useful in devices that contain the same module, and the header file definitions for that module are the same.