ch.hei.kart
Enum KartStatusRegister

java.lang.Object
  extended by java.lang.Enum<KartStatusRegister>
      extended by ch.hei.kart.KartStatusRegister
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<KartStatusRegister>

public enum KartStatusRegister
extends java.lang.Enum<KartStatusRegister>

Enumeration in order to identify the different status registers of the Kart.

Author:
Michael Clausen (clm@hevs.ch)

Enum Constant Summary
AmbientLightSensor1
          Proximity sensor 1 ambient light measure.
AmbientLightSensor2
          Proximity sensor 2 ambient light measure.
AmbientLightSensor3
          Proximity sensor 3 ambient light measure.
AmbientLightSensor4
          Proximity sensor 4 ambient light measure.
BatteryVoltageLevel
          ADC value of the battery voltage level measure.
DistanceSensor
          Ultrasonic distance sensor value.
HallSensorCounter1
          Hall sensor 1 pulse count.
HallSensorCounter2
          Hall sensor 2 pulse count.
ProximitySensor1
          Proximity sensor 1 value.
ProximitySensor2
          Proximity sensor 2 value.
ProximitySensor3
          Proximity sensor 3 value.
ProximitySensor4
          Proximity sensor 4 value.
SteeringEndSwitchState
          State of the steering end switch, 0=closed, 1=open.
SteeringPosition
          Actual steering position.
SteeringStatus
          Steering FSM status: 0=busy 1=target position reached.
 
Method Summary
static KartStatusRegister fromAddress(int address)
          Creates a status register enumerator from his integer value.
 int getAddress()
          Returns the actual address of the status register in the Kart's memory.
static KartStatusRegister valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static KartStatusRegister[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

HallSensorCounter1

public static final KartStatusRegister HallSensorCounter1
Hall sensor 1 pulse count.


HallSensorCounter2

public static final KartStatusRegister HallSensorCounter2
Hall sensor 2 pulse count.


SteeringStatus

public static final KartStatusRegister SteeringStatus
Steering FSM status: 0=busy 1=target position reached.


SteeringPosition

public static final KartStatusRegister SteeringPosition
Actual steering position.


SteeringEndSwitchState

public static final KartStatusRegister SteeringEndSwitchState
State of the steering end switch, 0=closed, 1=open.


BatteryVoltageLevel

public static final KartStatusRegister BatteryVoltageLevel
ADC value of the battery voltage level measure.


DistanceSensor

public static final KartStatusRegister DistanceSensor
Ultrasonic distance sensor value. Bigger values means more distance.


ProximitySensor1

public static final KartStatusRegister ProximitySensor1
Proximity sensor 1 value.


ProximitySensor2

public static final KartStatusRegister ProximitySensor2
Proximity sensor 2 value.


ProximitySensor3

public static final KartStatusRegister ProximitySensor3
Proximity sensor 3 value.


ProximitySensor4

public static final KartStatusRegister ProximitySensor4
Proximity sensor 4 value.


AmbientLightSensor1

public static final KartStatusRegister AmbientLightSensor1
Proximity sensor 1 ambient light measure.


AmbientLightSensor2

public static final KartStatusRegister AmbientLightSensor2
Proximity sensor 2 ambient light measure.


AmbientLightSensor3

public static final KartStatusRegister AmbientLightSensor3
Proximity sensor 3 ambient light measure.


AmbientLightSensor4

public static final KartStatusRegister AmbientLightSensor4
Proximity sensor 4 ambient light measure.

Method Detail

values

public static KartStatusRegister[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (KartStatusRegister c : KartStatusRegister.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static KartStatusRegister valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getAddress

public int getAddress()
Returns the actual address of the status register in the Kart's memory.

Returns:
Status register address.

fromAddress

public static KartStatusRegister fromAddress(int address)
Creates a status register enumerator from his integer value.

Parameters:
address - The integer address value.
Returns:
A enumerator or null if the address does not exist.