Embedded Systems Design with the Atmel AVR Microcontroller Part II
Embedded Systems Design with the Atmel AVR Microcontroller Part II
Embedded Systems Design with the Atmel AVR Microcontroller Part II
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
APPENDIX B<br />
ATmega164 Header File<br />
During C programming, <strong>the</strong> contents of a specific register may be referred to by name when an<br />
appropriate header file is included <strong>with</strong>in your program. The header file provides <strong>the</strong> link between<br />
<strong>the</strong> register name used <strong>with</strong>in a program and <strong>the</strong> hardware location of <strong>the</strong> register.<br />
Provided below is <strong>the</strong> ATmega164 header file from <strong>the</strong> ICC <strong>AVR</strong> compiler. This header file<br />
was provided courtesy of ImageCraft Incorporated.<br />
#ifndef __iom164pv_h<br />
#define __iom164pv_h<br />
/* ATmega164P header file for<br />
* ImageCraft ICC<strong>AVR</strong> compiler<br />
*/<br />
/* i/o register addresses<br />
* >= 0x60 are memory mapped only<br />
*/<br />
/* 2006/10/01 created<br />
*/<br />
/* Port D */<br />
#define PIND (*(volatile unsigned char *)0x29)<br />
#define DDRD (*(volatile unsigned char *)0x2A)<br />
#define PORTD (*(volatile unsigned char *)0x2B)<br />
/* Port C */<br />
#define PINC (*(volatile unsigned char *)0x26)<br />
#define DDRC (*(volatile unsigned char *)0x27)<br />
#define PORTC (*(volatile unsigned char *)0x28)<br />
/* Port B */<br />
#define PINB (*(volatile unsigned char *)0x23)<br />
#define DDRB (*(volatile unsigned char *)0x24)<br />
#define PORTB (*(volatile unsigned char *)0x25)<br />
273