def set_digital_latch(self, pin, threshold_type, cb=None):
if <NUM_LIT:0> <= threshold_type <= <NUM_LIT:1>:<EOL><INDENT>self._command_handler.set_digital_latch(pin, threshold_type, cb)<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
This method "arms" a digital pin for its data to be latched and saved in the latching table
If a callback method is provided, when latching criteria is achieved, the callback function is called
with latching data notification. In that case, the latching table is not updated.

:param pin: Digital pin number

:param threshold_type: DIGITAL_LATCH_HIGH | DIGITAL_LATCH_LOW

:param cb: callback function

:return: True if successful, False if parameter data is invalid