/* I/O ports 
   Last updated 21.5.00
 */

#include "H8.h"

#ifndef   IOPorts_H_DEFINED
#define   IOPorts_H_DEFINED

/* Each I/O port has a data direction register ( DDR ) that selects 
   input ( 0 ) or output ( 1 ), and a data register ( DR ) that 
   stores output data. The data direction register is write only. 
   A copy of the data direction register is maintained by the ROM
   based run time environment. When operating on the data direction
   register the copy should be used as follows

         P6DDR_ROM |= bit5; P6DDR = P6DDR_ROM;

  to select pin 5 as output and maintain the mode of the other pins of
  port 6.
 */ 

/* Port 4, Section 7, page 100. */  
#define P4DR       *((volatile byte *) 0xffb7) 
#define P4DDR      *((volatile byte *) 0xffb5)
#define P4DDR_ROM  *((volatile byte *) 0xfd83)

/* Port 6, Section 7, page 106. */
#define P6DR       *((volatile byte *) 0xffbb)
#define P6DDR      *((volatile byte *) 0xffb9)
#define P6DDR_ROM  *((volatile byte *) 0xfd85)

/* Port 7 is an input port, Section 7, page 110.*/

#define P7DR       *((volatile byte *) 0xffbe)

#endif /* IOPorts_H_DEFINED */ 
