peripherals
Class Peripheral

java.lang.Object
  extended by peripherals.Peripheral
Direct Known Subclasses:
KeyPad, LEDArray, Potentiometer, SevenSegmentDisplayArray

public abstract class Peripheral
extends java.lang.Object

This is a general class representing the peripherals on the CENG336 Board. Specific peripherals are inherited from this class.

Since:
19.01.2007
Author:
maho

Field Summary
protected  int id
          Identification number of the peripherals on Ceng 336 Board.
protected  boolean isEnabled
          Value representing if the peripheral is activated during simulation.
protected static int KEY_PAD
           
protected static int LED_ARRAY
           
protected  PIC pic
          Reference of microcontroller
protected static int POTENTIOMETER
           
protected static int SEVEN_SEGMENT_DISPLAY_ARRAY
           
 
Constructor Summary
Peripheral(int id, PIC pic)
          Constructor with default value(true) of isEnabled.
Peripheral(int id, PIC pic, boolean isEnabled)
          Main constructor of the Peripheral class.
 
Method Summary
 int getId()
           
 PIC getPic()
           
 boolean isEnabled()
           
 void setEnabled(boolean isEnabled)
           
 void setId(int id)
           
 void setPic(PIC pic)
           
abstract  void update()
          This abstract method communicates with the virtual card and makes necessary changes on it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEVEN_SEGMENT_DISPLAY_ARRAY

protected static int SEVEN_SEGMENT_DISPLAY_ARRAY

LED_ARRAY

protected static int LED_ARRAY

KEY_PAD

protected static int KEY_PAD

POTENTIOMETER

protected static int POTENTIOMETER

id

protected int id
Identification number of the peripherals on Ceng 336 Board. All peripherals have one instance so each peripheral type has a unique ID.


isEnabled

protected boolean isEnabled
Value representing if the peripheral is activated during simulation.


pic

protected PIC pic
Reference of microcontroller

Constructor Detail

Peripheral

public Peripheral(int id,
                  PIC pic)
Constructor with default value(true) of isEnabled. Id should be specified

Parameters:
id - type-unique id
Since:
19.01.2007

Peripheral

public Peripheral(int id,
                  PIC pic,
                  boolean isEnabled)
Main constructor of the Peripheral class.

Parameters:
id - type-unique id
isEnabled - status of peripheral
Since:
19.01.2007
Method Detail

update

public abstract void update()
This abstract method communicates with the virtual card and makes necessary changes on it.

Since:
19.01.2007

getId

public int getId()
Returns:
the id
Since:
19.01.2007

setId

public void setId(int id)
Parameters:
id - the id to set
Since:
19.01.2007

isEnabled

public boolean isEnabled()
Returns:
the isEnabled
Since:
19.01.2007

setEnabled

public void setEnabled(boolean isEnabled)
Parameters:
isEnabled - the isEnabled to set
Since:
19.01.2007

getPic

public PIC getPic()
Returns:
the pic
Since:
21.01.2007

setPic

public void setPic(PIC pic)
Parameters:
pic - the pic to set
Since:
21.01.2007