jtagtransn reworked. testing looks good so far.
[goodfet] / firmware / include / jtag.h
index 59a0e51..aab18fe 100644 (file)
@@ -3,11 +3,13 @@
   \brief JTAG handler functions.
 */
 
+#ifndef JTAG_H
+#define JTAG_H
+
 #include <signal.h>
 #include <io.h>
 #include <iomacros.h>
 
-
 extern unsigned int drwidth;
 
 #define MSP430MODE 0
@@ -19,7 +21,10 @@ extern unsigned int jtag430mode;
 
 //! Shift n bytes.
 unsigned long jtagtransn(unsigned long word,
-                        unsigned int bitcount);
+                        unsigned char bitcount,
+             unsigned char flags);
+//! Shift the address width.
+unsigned long jtag_dr_shiftadr(unsigned long in);
 //! Shift 8 bits of the IR.
 unsigned char jtag_ir_shift8(unsigned char);
 //! Shift 16 bits of the DR.
@@ -150,21 +155,13 @@ void jtag430_por();
 #define JTAG_DR_SHIFT 0x81
 #define JTAG_DR_SHIFT20 0x91
 
+#define MSB         0
+#define LSB         1
+#define NOEND       2
+#define NORETIDLE   4
+
 
 //JTAG430 commands
-#define JTAG430_HALTCPU 0xA0
-#define JTAG430_RELEASECPU 0xA1
-#define JTAG430_SETINSTRFETCH 0xC1
-#define JTAG430_SETPC 0xC2
-#define JTAG430_SETREG 0xD2
-#define JTAG430_GETREG 0xD3
-#define JTAG430_WRITEMEM 0xE0
-#define JTAG430_WRITEFLASH 0xE1
-#define JTAG430_READMEM 0xE2
-#define JTAG430_ERASEFLASH 0xE3
-#define JTAG430_ERASECHECK 0xE4
-#define JTAG430_VERIFYMEM 0xE5
-#define JTAG430_BLOWFUSE 0xE6
-#define JTAG430_ISFUSEBLOWN 0xE7
-#define JTAG430_COREIP_ID 0xF0
-#define JTAG430_DEVICE_ID 0xF1
+#include "jtag430.h"
+
+#endif