ZBasic System Library
For reference purposes, the ShiftIn() function is roughly equivalent to ShiftInEx(dpin, cpin,
bitCnt, &H04, 74). However, the value read will be in the high order 8 bits of the returned value.
This subroutine uses the I/O Timer if the flags parameter has bit 2 on. If the I/O Timer is already in use,
the function returns immediately and the return value is zero. No other use of this resource should be
attempted while the shifting is in progress. Interrupts are disabled during the shifting process. However,
RTC ticks are accumulated during the shifting process so the RTC should not lose time.
Bit 3 of the flags parameter specifies the active edge of the clock pulse, i.e. whether the data line will be
sampled relative to the leading edge or the trailing edge of the clock pulse. Bit 1 of the flags parameter
controls whether the sampling will be done before or after the active edge. When bit 1 of the flags
parameter is zero, the data line will be sampled approximately 2 CPU clock cycles after the active edge of
the clock pulse. When bit 1 of the flags parameter is one, the data line will be sampled approximately 5
CPU clock cycles before the active edge of the clock pulse. With a 14.7MHz CPU clock, these intervals
are approximately 135nS and 340nS, respectively.
This function is not available in BasicX compatibility mode.