Package jmri.jmrix.sprog.update
Class SprogType
- java.lang.Object
-
- jmri.jmrix.sprog.update.SprogType
-
public class SprogType extends java.lang.Object
Class to hold SPROG type
-
-
Field Summary
Fields Modifier and Type Field Description static int
NANO
static int
NO_PROMPT_FOUND
static int
NOT_A_SPROG
static int
NOT_RECOGNISED
static int
PISPROGNANO
static int
PISPROGONE
static int
SNIFFER
static int
SPROG3
static int
SPROG5
static int
SPROGII
static int
SPROGIIUSB
static int
SPROGIIv3
static int
SPROGIIv4
static int
SPROGIV
int
sprogType
static int
SPROGV4
static int
TIMEOUT
static int
UNKNOWN
-
Constructor Summary
Constructors Constructor Description SprogType(int type)
Construct a new SPROG type of a given type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBlockLen()
Get the Flash memory block Length for bootloader.static int
getBlockLen(int bootVer)
Get the Flash memory block Length for bootloader.double
getCurrentMultiplier()
Return the multiplier for scaling the current limit from hardware units to physical units (mA).int
getEraseStart()
boolean
isSprog()
Check for any SPROG typeboolean
isSprogII()
Check for a SPROG II typejava.lang.Boolean
isValidFlashAddress(int addr)
Check if an address is one which should be reprogrammed during bootloader operation.java.lang.String
toString()
java.lang.String
toString(int t)
-
-
-
Field Detail
-
UNKNOWN
public static final int UNKNOWN
- See Also:
- Constant Field Values
-
NO_PROMPT_FOUND
public static final int NO_PROMPT_FOUND
- See Also:
- Constant Field Values
-
NOT_A_SPROG
public static final int NOT_A_SPROG
- See Also:
- Constant Field Values
-
NOT_RECOGNISED
public static final int NOT_RECOGNISED
- See Also:
- Constant Field Values
-
TIMEOUT
public static final int TIMEOUT
- See Also:
- Constant Field Values
-
SPROGV4
public static final int SPROGV4
- See Also:
- Constant Field Values
-
SPROGII
public static final int SPROGII
- See Also:
- Constant Field Values
-
SPROGIIUSB
public static final int SPROGIIUSB
- See Also:
- Constant Field Values
-
SPROGIIv3
public static final int SPROGIIv3
- See Also:
- Constant Field Values
-
SPROGIIv4
public static final int SPROGIIv4
- See Also:
- Constant Field Values
-
SPROG3
public static final int SPROG3
- See Also:
- Constant Field Values
-
SPROGIV
public static final int SPROGIV
- See Also:
- Constant Field Values
-
SPROG5
public static final int SPROG5
- See Also:
- Constant Field Values
-
PISPROGONE
public static final int PISPROGONE
- See Also:
- Constant Field Values
-
NANO
public static final int NANO
- See Also:
- Constant Field Values
-
PISPROGNANO
public static final int PISPROGNANO
- See Also:
- Constant Field Values
-
SNIFFER
public static final int SNIFFER
- See Also:
- Constant Field Values
-
sprogType
public int sprogType
-
-
Constructor Detail
-
SprogType
public SprogType(int type)
Construct a new SPROG type of a given type.- Parameters:
type
- int, one of SprogType.xxx constants
-
-
Method Detail
-
isSprog
public boolean isSprog()
Check for any SPROG type- Returns:
- true if this object holds a SPROG type
-
isSprogII
public boolean isSprogII()
Check for a SPROG II type- Returns:
- true if this object holds a SPROG II type
-
getCurrentMultiplier
public double getCurrentMultiplier()
Return the multiplier for scaling the current limit from hardware units to physical units (mA).- Returns:
- the multiplier for the current limit
-
getBlockLen
public int getBlockLen()
Get the Flash memory block Length for bootloader.- Returns:
- blocklen
-
getBlockLen
public static int getBlockLen(int bootVer)
Get the Flash memory block Length for bootloader.- Parameters:
bootVer
- the bootloader version- Returns:
- length in bytes
-
isValidFlashAddress
public java.lang.Boolean isValidFlashAddress(int addr)
Check if an address is one which should be reprogrammed during bootloader operation. Checks if address is above the bootloader's address space and below the debug executive's address space.- Parameters:
addr
- int- Returns:
- true or false
-
getEraseStart
public int getEraseStart()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation of a SPROG type
-
toString
public java.lang.String toString(int t)
- Parameters:
t
- Numeric SPROG type- Returns:
- String representation of a SPROG type
-
-