+ volatile uint32_t *testaddr = (volatile uint32_t *)0x80004000;
+ int p;
+ p=*testaddr++;
+ printf("read %d\n", p);
+ p=*testaddr++;
+ printf("read %d\n", p);
+ p=*testaddr++;
+ printf("read %d\n", p);
+ p=*testaddr++;
+ printf("read %d\n", p);
+ p=*testaddr++;
+ printf("read %d\n", p);
+ p=*testaddr++;
+ printf("read %d\n", p);
+ p=*testaddr++;
+ printf("read %d\n", p);
+ p=*testaddr++;
+ printf("read %d\n", p);
+ p=*testaddr++;
+ printf("read %d\n", p);
+
+}
+
+int cmd_do_zmer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
+ volatile uint32_t *testaddr = (volatile uint32_t *)0x80004000;
+ int32_t values[2048];
+ uint32_t status, status_old, bank,i;
+ int32_t val;
+ status_old = *testaddr;
+ //while((status_old & (1<<2))==(status & (1<<2))) status=*testaddr;
+ //while (*testaddr &(1<<6));
+ *testaddr = 0xa;
+ while (!(*testaddr & (1<<6))) printf("\ncekam\n");
+ status = *testaddr;
+ testaddr = (volatile uint32_t *)0x80008000;
+ if (status&(1<<2)){
+ // printf("bank1\n");
+ testaddr = (volatile uint32_t *)0x80009000;
+ } else {
+ //printf("bank0\n");
+ }
+ for(i=0;i<1024;i++){
+ // values[i]=*testaddr++;
+ val=*testaddr++;
+ val+=(1<<17);
+ val&=(1<<18)-1;
+ val -= (1<<17);
+ values[i]=val;
+ }
+ if (status&(1<<2)){
+ printf("bank1\n");
+ //testaddr = (volatile uint32_t *)0x80008000;
+ } else {
+ printf("bank0\n");
+ }
+ for (i=0;i<1024;i++){
+ if (i==1024){
+ printf("bank1\n");
+ }
+ printf("%d\n",values[i]);
+
+ }
+ printf("konec\n");
+
+ return 0;
+}
+
+int cmd_do_runnung_meas(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]){
+ volatile uint32_t *testaddr = (volatile uint32_t *)0x80004000;
+ int32_t values[1024];
+ uint32_t status, status_old, bank,i;
+ int32_t val;
+ status_old = *testaddr;
+ status = *testaddr;
+ while((status_old & (1<<2))==(status & (1<<2))) {status=*testaddr; printf("dely %i %i",status_old & (1<<2),status & (1<<2));}
+ if (status&(1<<2)){
+ testaddr = (volatile uint32_t *)0x80009000;
+ } else {
+ testaddr = (volatile uint32_t *)0x80008000;
+ }
+ for(i=0;i<1024;i++){
+ // values[i]=*testaddr++;
+ val=*testaddr++;
+ val = (val>> 17) == 0 ? val : -1 ^ 0x7FFFF | val;
+ values[i]=-1*val;
+ }
+ if (status&(1<<2)){
+ printf("bank1\n");
+ //testaddr = (volatile uint32_t *)0x80008000;
+ } else {
+ printf("bank0\n");
+ }
+ //printf("zacatek\n");
+ for (i=0;i<1024;i++){
+ printf("%d\n",values[i]);
+ }
+ printf("konec\n");
+ return 0;
+}
+
+
+int cmd_do_init(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
+ printf("init!\n");
+ volatile uint32_t *testaddr = (volatile uint32_t *)0x80004000;
+ *testaddr++ = 0x9;
+// *testaddr++;
+ *testaddr++ = 9;
+ *testaddr++ = 399;
+ *testaddr++ = 409;
+ *testaddr++ = 399;
+ *testaddr++ = 9;
+ *testaddr++ = 599;
+ *testaddr++ = 609;
+ //*testaddr++ = 4879;
+ *testaddr++ = 5023999;
+ *testaddr=499;
+
+ printf("OK!\n");
+ return 0;
+}
+
+int cmd_do_send(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
+ char *end;
+ volatile uint32_t *testaddr = (volatile uint32_t *)0x80004000;
+ int read;
+ int p=(int) strtol(param[1], &end, 10);
+ testaddr+=p;
+ p=(int) strtol(end, &end, 10);
+ *testaddr=p;
+ read=*testaddr;
+ printf("sent %d & read %d\n", p, read);