12 s826_diooutputsourcewrite, S826_diooutputsourcewrite, Calling s826_diooutputsourcewrite – Sensoray 826 User Manual
Page 62

Remarks
This function cancels blocking for an arbitrary set of DIO channels so that another thread, which is blocked by
S826_DioCapRead while waiting for DIO edge events to be captured, will return immediately with
S826_ERR_CANCELLED.
8.3.12 S826_DioOutputSourceWrite
The S826_DioOutputSourceWrite function assigns the signal sources for all DIO pins.
int S826_DioOutputSourceWrite(
uint board, // board identifier
uint data[2] // pointer to data buffer
);
Parameters
board
826 board number. This must match the settings of the board's dip switches as described in section 2.2.
data
Pointer to a buffer (see Section 8.3) that specifies signal sources: 0=DIO output register, 1=alternate source.
Return Values
If the function succeeds, the return value is zero.
If the function fails, the return value is an error code.
Remarks
This function specifies the signal source that will be used to drive each DIO pin. Each DIO pin may be driven by its
output register or by its alternate signal source. Upon board reset, all DIO channels assume their default configuration
so that all DIO pins are driven by the DIO output registers (vs. alternate sources).
A DIO pin's signal source is determined by the corresponding bit in the data buffer. When the bit is set to '1' the pin will
be driven by the channel's alternate signal source; when set to '0' (default) the pin will behave as a standard digital
output, driven by the channel's output register.
The data[0] quadlet selects the signal sources for DIO channels 0 to 23:
Bit
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
DIO
-
-
-
-
-
-
-
-
23 22 21 20 19 18 17 16 15 14 13 12 11 10
9
8
7
6
5
4
3
2
1
0
Src
-
-
-
-
-
-
-
- NMI RST C5 C4 C3 C2 C1 C0 NMI RST C5 C4 C3 C2 C1 C0 NMI RST C5 C4 C3 C2 C1 C0
The data[1] quadlet selects the signal sources for DIO channels 24 to 47:
Bit
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
DIO
-
-
-
-
-
-
-
-
47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24
Src
-
-
-
-
-
-
-
- NMI RST C5 C4 C3 C2 C1 C0 NMI RST C5 C4 C3 C2 C1 C0 NMI RST C5 C4 C3 C2 C1 C0
Every DIO channel is associated with one of eight alternate signal sources as shown in the above tables. The tables use
the following abbreviations for alternate signal sources:
826 Instruction Manual
57
Digital I/O