int jtag_set_ir(char *s,int bitlen) {
- u8 ir[MAXDEV*MAX_IR_LEN/8];
+ u8 ir[MAXDEV*MAXIRLEN/8];
int count;
- if(biten>=MAXDEV*MAX_IR_LEN) {
+ if(bitlen>=MAXDEV*MAXIRLEN) {
printf("instruction register too big!\n");
return -1;
}
- memset(ir,0,MAXDEV*MAX_IR_LEN/8*sizeof(u8));
+ memset(ir,0,MAXDEV*MAXIRLEN/8*sizeof(u8));
+ printf("ir to set: ");
while(bitlen) {
- ir[count/8]|=p[count] ... HIER WEITER ..;
+ ir[count/8]|=(s[count]<<(count%8));
+ printf("%d",ir[count/8]&(1<<count%8)?1:0);
count+=1;
bitlen-=1;
}
+ printf("\n");
jtag_enter_shift_ir();
-
- while(len--)
-
+ jtag_write_data(ir,bitlen);
jtag_leave_shift_ir();
+
return 0;
}
int main(int argc,char **argv) {
t_jtag jtag;
+ u8 io[256];
+ int i;
memset(&jtag,0,sizeof(t_jtag));
jtag_chain_init(&jtag);
printf("done\n\n");
+ printf("testing some instructions ...\n\n");
+ jtag_set_ir("000001000001",12);
+ jtag_enter_shift_dr();
+ jtag_read_data(io,64);
+ for(i=0;i<64;i++) {
+ printf("%d",io[i/8]&(1<<(i%8))?1:0);
+ }
+ printf("\n");
+ jtag_leave_shift_dr();
+
return 0;
}