beautypg.com

3 s826_safewrenwrite, 4 s826_safewrenread, S826_safewrenwrite – Sensoray 826 User Manual

Page 73: S826_safewrenread, S826_safewrenwrite)

background image

int S826_SafeControlRead(
uint board, // board identifier
uint *settings // safemode settings
);

Parameters

board

826 board number. This must match the settings of the board's dip switches as described in section 2.2.

settings

Pointer to buffer that will receive the safemode configuration and state as detailed in S826_SafeControlWrite.

mode

Write mode: 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.

10.2.3 S826_SafeWrenWrite

The S826_SafeWrenWrite function enables or disables write protection for safemode-related registers.

int S826_SafeWrenWrite(
uint board, // board identifier
uint wren // write enable/disable
);

Parameters

board

826 board number. This must match the settings of the board's dip switches as described in section 2.2.

wren

1 = write protect (default upon board reset), 2 = write enable, other values have no effect. When writes are disabled
(write protected), attempts to write to protected registers will without notification (return S826_ERR_OK).

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value is an error code.

Remarks

See “Write Protection” for a list of registers that are write protected/enabled by this function.

10.2.4 S826_SafeWrenRead

The S826_SafeWrenRead function returns the board's fail-safe configuration and control settings.

int S826_SafeWrenRead(
uint board, // board identifier
uint *wren // write protection status
);

Parameters

board

826 board number. This must match the settings of the board's dip switches as described in section 2.2.

826 Instruction Manual

68

Safemode Controller