ESTGPIOPortsData
@interface ESTGPIOPortsData : NSObject <NSCopying>
ESTGPIOPortData is Value Object representing state of all available GPIO port.
-
Initialize object with values for GPIO ports 0 and 1. For incorrect port values nil is returned.
Basic init method ([ESTGPIOPortsData alloc] init]) should not be used. NSAssert will be thrown in that case.
Declaration
Objective-C
- (nonnull instancetype)initWithPort0Value:(ESTGPIOPortValue)port0Value port1Value:(ESTGPIOPortValue)port1Value;
Swift
init(port0Value: ESTGPIOPortValue, port1Value: ESTGPIOPortValue)
Parameters
port0Value
Desired value for port 0.
port1Value
Desired value for port 1.
Return Value
Initialized object or nil (for incorrect values).
-
Method allows to set value for particular port.
Declaration
Objective-C
- (nonnull NSError *)setPort:(ESTGPIOPort)port value:(ESTGPIOPortValue)value;
Swift
func setPort(_ port: ESTGPIOPort, value: ESTGPIOPortValue) -> Error
Parameters
port
Port should the value be set to.
value
Desired value for port.
Return Value
Error of operation. No error means success.
-
Method allows to get value for GPIO port.
Declaration
Objective-C
- (ESTGPIOPortValue)getValueForPort:(ESTGPIOPort)port;
Swift
func getValueFor(_ port: ESTGPIOPort) -> ESTGPIOPortValue
Parameters
port
Port should the value be get from.