BowlerKernel
NRBootCoreType.java
Go to the documentation of this file.
1 package com.neuronrobotics.sdk.bootloader;
2 
3 // TODO: Auto-generated Javadoc
7 public enum NRBootCoreType {
8 
10  AVRxx4p (2, "avr_atmegaXX4p"),
11 
13  PIC32 (4, "pic32mx440f128h");
14 
16  private int bytesPerWord;
17 
19  private String readableName;
20 
27  private NRBootCoreType(int bytesPerWord, String name) {
28  this.setBytesPerWord(bytesPerWord);
29  setReadableName(name);
30  }
31 
37  public void setBytesPerWord(int bytesPerWord) {
38  this.bytesPerWord = bytesPerWord;
39  }
40 
46  public int getBytesPerWord() {
47  return bytesPerWord;
48  }
49 
55  public void setReadableName(String readableName) {
56  this.readableName = readableName;
57  }
58 
64  public String getReadableName() {
65  return readableName;
66  }
67 
74  public static NRBootCoreType find(String tagValue) {
75  if (NRBootCoreType.AVRxx4p.getReadableName().toLowerCase().contentEquals(tagValue.toLowerCase())){
76  return NRBootCoreType.AVRxx4p;
77  }
78  if (NRBootCoreType.PIC32.getReadableName().toLowerCase().contentEquals(tagValue.toLowerCase())){
79  return NRBootCoreType.PIC32;
80  }
81  return null;
82  }
83 
84  /* (non-Javadoc)
85  * @see java.lang.Enum#toString()
86  */
87  @Override
88  public String toString() {
89  return getReadableName();
90  }
91 }
static NRBootCoreType find(String tagValue)
NRBootCoreType(int bytesPerWord, String name)