]> sigrok.org Git - sigrok-firmware-fx2lafw.git/commitdiff
Fixed GPIF waveform branch, and annotated population code
authorJoel Holdsworth <redacted>
Sun, 11 Mar 2012 15:36:03 +0000 (15:36 +0000)
committerJoel Holdsworth <redacted>
Sun, 11 Mar 2012 15:36:03 +0000 (15:36 +0000)
gpif-acquisition.c

index 5a76fae50ebe46fea58a421f9c6d7b22dbe126aa..b57bcf684090588710b7f1962679ffacf147c400 100644 (file)
@@ -169,17 +169,51 @@ void gpif_acquisition_start(const struct cmd_start_acquisition *cmd)
 
        /* Populate S0 */
        pSTATE = &GPIF_WAVE_DATA;
+
+       /* DELAY
+        * Delay cmd->sample_delay clocks.
+        */
        pSTATE[0] = cmd->sample_delay;
+
+       /* OPCODE
+        * SGL=0, GIN=0, INCAD=0, NEXT=0, DATA=1, DP=0
+        * Collect data in this state.
+        */
        pSTATE[8] = 0x02;
+
+       /* OUTPUT
+        * OE[0:3]=0, CTL[0:3]=0
+        */
        pSTATE[16] = 0x00;
+
+       /* LOGIC FUNCTION
+        * Not used
+        */
        pSTATE[24] = 0x00;
 
-       /* Populate S1 */
+       /* Populate S1 - the decision point */
        pSTATE = &GPIF_WAVE_DATA + 1;
-       pSTATE[0] = 0x00;
-       pSTATE[8] = 0x01;
+
+       /* BRANCH
+        * Branch to IDLE if condition is true, back to S0 otherwise
+        */
+       pSTATE[0] = (7 << 3) | (0 << 0);
+
+       /* OPCODE
+        * SGL=0, GIN=0, INCAD=0, NEXT=0, DATA=0, DP=1
+        */
+       pSTATE[8] = (1 << 0);
+
+       /* OUTPUT
+        * OE[0:3]=0, CTL[0:3]=0
+        */
        pSTATE[16] = 0x00;
-       pSTATE[24] = 0x36;
+
+       /* LOGIC FUNCTION
+        * Evaluate if the FIFO full flag is set.
+        * LFUNC=0 (AND), TERMA=6 (FIFO Flag), TERMB=6 (FIFO Flag)
+        */
+       pSTATE[24] = (6 << 3) | (6 << 0);
 
        /* Execute the whole GPIF waveform once */
        gpif_set_tc16(1);