]> hackdaworld.org Git - my-code/pnx.git/commitdiff
started code to set ir ...
authorhackbard <hackbard@hackdaworld.org>
Sun, 27 Mar 2011 12:17:15 +0000 (14:17 +0200)
committerhackbard <hackbard@hackdaworld.org>
Sun, 27 Mar 2011 12:17:15 +0000 (14:17 +0200)
jtag.c

diff --git a/jtag.c b/jtag.c
index ca2e683995e83f5ebb238762c36786216e1a6953..2e8298cf44767d578e14db9746ee07be7db1622f 100644 (file)
--- a/jtag.c
+++ b/jtag.c
@@ -175,6 +175,22 @@ int jtag_read_data(u8 *p,int bitlen) {
 
 }
 
+int jtag_write_data(u8 *p,int bitlen) {
+
+       int count;
+
+       count=0;
+
+       while(bitlen) {
+               jtag_clock(0,p[count/8]&(1<<count)?1:0);
+               bitlen-=1;
+               count+=1;
+       }
+
+       return 0;
+
+}
+
 int jtag_chain_init(t_jtag *jtag) {
 
        int i;
@@ -212,6 +228,33 @@ int jtag_chain_init(t_jtag *jtag) {
 
 }
 
+int jtag_set_ir(char *s,int bitlen) {
+
+       u8 ir[MAXDEV*MAX_IR_LEN/8];
+       int count;
+
+       if(biten>=MAXDEV*MAX_IR_LEN) {
+               printf("instruction register too big!\n");
+               return -1;
+       }
+
+       memset(ir,0,MAXDEV*MAX_IR_LEN/8*sizeof(u8));
+
+       while(bitlen) {
+               ir[count/8]|=p[count] ... HIER WEITER ..;
+               count+=1;
+               bitlen-=1;
+       }
+
+       jtag_enter_shift_ir();
+
+       while(len--)
+
+       jtag_leave_shift_ir();
+       return 0;
+
+}
+
 int main(int argc,char **argv) {
 
        t_jtag jtag;