objc

GPIO.h
Go to the documentation of this file.
1 
8 #pragma once
9 #include <runtime-hw/hw.h>
10 
12 // CLASS DEFINITIONS
13 
23 @interface GPIO : NXObject {
24 @private
25  hw_gpio_t _pin;
26 }
27 
42 + (GPIO *)inputWithPin:(uint8_t)pin;
43 
58 + (GPIO *)pullupWithPin:(uint8_t)pin;
59 
74 + (GPIO *)pulldownWithPin:(uint8_t)pin;
75 
89 + (GPIO *)outputWithPin:(uint8_t)pin;
90 
95 + (uint8_t)count;
96 
100 - (uint8_t)pin;
101 
105 - (bool)isInput;
106 
110 - (bool)isOutput;
111 
121 + (void)setDelegate:(id<GPIODelegate>)delegate;
122 
128 
133 - (BOOL)state;
134 
140 - (void)setState:(BOOL)state;
141 
142 @end
The GPIO class.
Definition: GPIO.h:23
uint8_t pin()
Returns the pin number.
bool isInput()
Returns true if the GPIO pin is configured as an input.
BOOL state()
Returns the state of the GPIO pin.
Hardware interface abstraction layer.
bool BOOL
A Boolean value.
Definition: runtime.h:60
uint8_t count()
Returns the total number of GPIO pins available.
The base class for objects in the Foundation framework.
Definition: NXObject.h:21
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
bool isOutput()
Returns true if the GPIO pin is configured as an output.
GPIO logical pin structure.
Definition: gpio.h:60
id< GPIODelegate > delegate()
Returns the current delegate for GPIO events.