/* Buttons 
   Last updated 24.6.00
 */

#include "H8.h"
#include "IOPorts.h"

#ifndef   Buttons_H_DEFINED
#define   Buttons_H_DEFINED

/* The state of a button can be read as the value of a single
   bit from an I/O port. When the button is pressed the value is
   0, when released the value is 1. Run, OnOff, ... can be used
   to read the state of the corresponding button and return 0
   when released and !0 when pressed. 

   I/0 port 4, bit2 and bit1 can also be used to initiate
   external interrupts IRQ0 and IRQ1. This means that the Run
   and OnOff buttons can cause IRQ0 and IRQ1. These
   external interrupts are controlled by two registers, ISCR
   and IER, Section 4, Exception Handling, p. 61.
 */

/* I/O port 4 */   
#define Run         ! ( P4DR & bit2 )     
#define OnOff       ! ( P4DR & bit1 )


/* I/O port 7 */
#define Prgm        ! ( P7DR & bit7 )     
#define View        ! ( P7DR & bit6 )

#endif /* Buttons_H_DEFINED */
