BL4S100 User’s Manual
60
setSyncIn
int setSyncIn(int channel, int source, int edge);
FUNCTION DESCRIPTION
Sets the synch for the block the digital input channel is associated with.
Note that when more than one block is synchronized to the same synch signal (global
or external), each block has its own independent edge-detection circuit. These circuits
will synch to the edge within plus or minus one count of the block’s current clock
source (main or prescale). This means synchronized blocks may have a small offset
when compared to each other.
PARAMETERS
channel
digital input channel that is on the block that will have its synch
set, 0–11 (pins IN0–IN11)
source
source of the synch signal.
-1 to use the RIO chip's Global Synch signal
or
input-capable channel to use as an external synch signal
edge
edge of the synch signal.
BL_EDGE_RISE
— synchronize event on rising edge
BL_EDGE_FALL
— synchronize event on falling edge
BL_EDGE_BOTH
— synchronize events on both edges
0
— disable the synch on this block (if the source of the external
synch is given, it will be set to a digital input)
RETURN VALUE
0 — success.
-EINVAL
— invalid parameter value.
-EPERM
— pin type does not permit this function.
-EACCES
— resource needed by this function is not available.
-EFAULT
— internal data fault detected.
SEE ALSO
brdInit, setSyncOut