/* 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);