ch.hei.kart
Enum KartControlRegister

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

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

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

Author:
Michael Clausen (clm@hevs.ch)

Enum Constant Summary
DrivePwmPeriod
          The Drive PWM period as UINT16.
DriveSpeed
          Drive motor speed as INT5.
HardwareSettings
          Hardware settings register.
LEDs
          LED control register.
SteeringEndSwitchAddress
          Specifies the address at which the end switch is read at bit 0 (if it isn't local).
SteeringPosition
          Steering position setpoint as UINT16 register.
SteeringStepPeriod
          The Stepper (Steering) motor step period as UINT16.
UpdateInterval
          Update interval (from kart to App) in milliseconds.
 
Method Summary
 int getAddress()
          Returns the address of the register in the kart's memory.
static KartControlRegister valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static KartControlRegister[] 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

DrivePwmPeriod

public static final KartControlRegister DrivePwmPeriod
The Drive PWM period as UINT16. Divider value from the FPGA main clock frequency to the PWM step. Default value is 0x40.


DriveSpeed

public static final KartControlRegister DriveSpeed
Drive motor speed as INT5. Negative numbers = backwards, positive numbers = forwards.


SteeringStepPeriod

public static final KartControlRegister SteeringStepPeriod
The Stepper (Steering) motor step period as UINT16. Divider value from the clock frequency to the stepper motor step period. Default value is 0x100.


SteeringPosition

public static final KartControlRegister SteeringPosition
Steering position setpoint as UINT16 register. Stepper motor target position (zero is stepper end sensor, values are positive only).


SteeringEndSwitchAddress

public static final KartControlRegister SteeringEndSwitchAddress
Specifies the address at which the end switch is read at bit 0 (if it isn't local).


HardwareSettings

public static final KartControlRegister HardwareSettings
Hardware settings register. Defines how the motor rotations are linked to the kart move actions. Bit 0: Kart goes as DC motor. When '0', the kart goes backwards when the motor turns forward. Bit 1: Kart turns right (clockwise). When '1', kart turns to the right as stepper motor phases go from 1 to 4. Bit 2: End sensor is on left side. If '1', the angles are measured clockwise. Bit 3: Stepper end emulation. Emulates an end switch contact for the direction motor. Bit 4: Restart slaves. Puts following slaves back in startup mode: stepper motor


LEDs

public static final KartControlRegister LEDs
LED control register. Allows to change the state of the 4 onboard LED drivers.


UpdateInterval

public static final KartControlRegister UpdateInterval
Update interval (from kart to App) in milliseconds.

Method Detail

values

public static KartControlRegister[] 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 (KartControlRegister c : KartControlRegister.values())
    System.out.println(c);

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

valueOf

public static KartControlRegister 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 address of the register in the kart's memory.

Returns:
Address of the register.