public bool SetAllPortState(byte ctrlState) { bool retVal = SimpleIOClass.WritePort((uint)ctrlState); if (retVal) { _ioStateMap = ctrlState; } return(retVal); }
public void SetPortMode(uint port, CtrlMode mode) { if (mode == CtrlMode.Output) { _ioModeMap = (byte)(_ioModeMap & ~PortMask[port]); } else { _ioModeMap |= PortMask[port]; } SimpleIOClass.ConfigureIO(_ioModeMap); SimpleIOClass.WritePort(_ioStateMap); }
public void SetPortState(uint port, CtrlState state) { if ((_ioModeMap & PortMask[port]) == PortMask[port]) { throw new ArgumentException("Port must be in output state to be set.", "port"); } if (state == CtrlState.High) { _ioStateMap |= PortMask[port]; } else { _ioStateMap &= (byte)~PortMask[port]; } SimpleIOClass.WritePort(_ioStateMap); }