- static final byte WR_CONFIG = 0x1d;
- static final byte RD_CONFIG = 0x24;
- static final byte CONFIG_TIMERS_OFF = (1 << 3);
- static final byte CONFIG_DMA_PAUSE = (1 << 2);
- static final byte CONFIG_TIMER_SUSPEND = (1 << 1);
- static final byte SET_FLASH_INFO_PAGE = (1 << 0);
-
- static final byte GET_PC = 0x28;
- static final byte READ_STATUS = 0x34;
- static final byte STATUS_CHIP_ERASE_DONE = (byte) (1 << 7);
- static final byte STATUS_PCON_IDLE = (1 << 6);
- static final byte STATUS_CPU_HALTED = (1 << 5);
- static final byte STATUS_POWER_MODE_0 = (1 << 4);
- static final byte STATUS_HALT_STATUS = (1 << 3);
- static final byte STATUS_DEBUG_LOCKED = (1 << 2);
- static final byte STATUS_OSCILLATOR_STABLE = (1 << 1);
- static final byte STATUS_STACK_OVERFLOW = (1 << 0);
-
- static final byte SET_HW_BRKPNT = 0x3b;
- static byte HW_BRKPNT_N(byte n) { return (byte) ((n) << 3); }
- static final byte HW_BRKPNT_N_MASK = (0x3 << 3);
- static final byte HW_BRKPNT_ENABLE = (1 << 2);
-
- static final byte HALT = 0x44;
- static final byte RESUME = 0x4c;
- static byte DEBUG_INSTR(byte n) { return (byte) (0x54|(n)); }
- static final byte STEP_INSTR = 0x5c;
- static byte STEP_REPLACE(byte n) { return (byte) (0x64|(n)); }
- static final byte GET_CHIP_ID = 0x68;
-
-
- static boolean ishex(int c) {
- if ('0' <= c && c <= '9')
- return true;
- if ('a' <= c && c <= 'f')
- return true;
- if ('A' <= c && c <= 'F')
- return true;
- return false;
- }
-
- static boolean ishex(String s) {
- for (int i = 0; i < s.length(); i++)
- if (!ishex(s.charAt(i)))
- return false;
- return true;
- }
- static boolean isspace(int c) {
- switch (c) {
- case ' ':
- case '\t':
- return true;
- }
- return false;
- }
+ public static final byte WR_CONFIG = 0x1d;
+ public static final byte RD_CONFIG = 0x24;
+ public static final byte CONFIG_TIMERS_OFF = (1 << 3);
+ public static final byte CONFIG_DMA_PAUSE = (1 << 2);
+ public static final byte CONFIG_TIMER_SUSPEND = (1 << 1);
+ public static final byte SET_FLASH_INFO_PAGE = (1 << 0);
+
+ public static final byte GET_PC = 0x28;
+ public static final byte READ_STATUS = 0x34;
+ public static final byte STATUS_CHIP_ERASE_DONE = (byte) (1 << 7);
+ public static final byte STATUS_PCON_IDLE = (1 << 6);
+ public static final byte STATUS_CPU_HALTED = (1 << 5);
+ public static final byte STATUS_POWER_MODE_0 = (1 << 4);
+ public static final byte STATUS_HALT_STATUS = (1 << 3);
+ public static final byte STATUS_DEBUG_LOCKED = (1 << 2);
+ public static final byte STATUS_OSCILLATOR_STABLE = (1 << 1);
+ public static final byte STATUS_STACK_OVERFLOW = (1 << 0);
+
+ public static final byte SET_HW_BRKPNT = 0x3b;
+ public static byte HW_BRKPNT_N(byte n) { return (byte) ((n) << 3); }
+ public static final byte HW_BRKPNT_N_MASK = (0x3 << 3);
+ public static final byte HW_BRKPNT_ENABLE = (1 << 2);
+
+ public static final byte HALT = 0x44;
+ public static final byte RESUME = 0x4c;
+ public static byte DEBUG_INSTR(byte n) { return (byte) (0x54|(n)); }
+ public static final byte STEP_INSTR = 0x5c;
+ public static byte STEP_REPLACE(byte n) { return (byte) (0x64|(n)); }
+ public static final byte GET_CHIP_ID = 0x68;