8 s826_diocapenableswrite, S826_diocapenableswrite – Sensoray 826 User Manual
Page 59

int S826_DioSafeEnablesRead(
uint board, // board identifier
uint enables[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.
enables
Pointer to a buffer (see Section 8.3) that will receive the Safe Enable register contents.
Return Values
If the function succeeds, the return value is zero.
If the function fails, the return value is an error code.
8.3.8 S826_DioCapEnablesWrite
The S826_DioCapEnablessWrite function programs the edge sensitivity for DIO edge capturing.
int S826_DioCapEnablesWrite(
uint board, // board identifier
uint rising[2], // pointer to data buffer
uint falling[2], // pointer to data buffer
uint mode // write mode
);
Parameters
board
826 board number. This must match the settings of the board's dip switches as described in section 2.2.
rising
Pointer to a buffer (see Section 8.3) that specifies rising edge sensitivity: '1'=capture rising edges, '0'=don't capture
rising edges.
falling
Pointer to a buffer (see Section 8.3) that specifies falling edge sensitivity: '1'=capture falling edges, '0'=don't capture
falling edges.
mode
Write mode for rising/falling: 0 = write, 1 = clear bits, 2 = set bits (see “Atomic Read-Modify-Write”).
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 edges to be captured on DIO channels. It defines the edge sensitivity for each DIO channel
in terms of the I/O pin voltage. For example, if falling edge sensitivity is enabled, edge capturing will occur when the
I/O pin voltage transitions from 5V to 0V.
When mode is zero, all data flags are directly written to the capture enable registers. In modes one and two, the data
flags determine which of the 48 DIO channels are to be affected; any flag that contains a logic '1' will cause the
associated channel to be affected, while '0' will leave the channel unmodified.
After capturing has been enabled, it will remain enabled until disabled by this function or a board reset. Capturing is
disabled on all channels following a board reset.
826 Instruction Manual
54
Digital I/O