public interface GPIO extends MetaWearController.ModuleController
Module.GPIO
Modifier and Type | Interface and Description |
---|---|
static class |
GPIO.AnalogMode
Available reading modes from the GPIO analog pins
|
static class |
GPIO.Callbacks
Callbacks for the GPIO module
|
static class |
GPIO.ChangeType
Enumeration of conditions on when to notify the user of a pin's state change
|
static class |
GPIO.PullMode
Pull modes for setting digital input pins
|
static class |
GPIO.Register
Enumeration of registers under the GPIO module
|
Modifier and Type | Field and Description |
---|---|
static byte |
ANALOG_DATA_SIZE |
static byte |
DIGITAL_DATA_SIZE |
static byte |
PIN_CHANGE_NOTIFY_SIZE |
Modifier and Type | Method and Description |
---|---|
void |
clearDigitalOutput(byte pin)
Clear a digital output pin
|
void |
disablePinChangeNotification(byte pin)
Disable notifications on pin state change.
|
void |
enablePinChangeNotification(byte pin)
Enable notifications on a pin state change.
|
void |
readAnalogInput(byte pin,
GPIO.AnalogMode mode)
Read the value of an analog pin.
|
void |
readDigitalInput(byte pin)
Read the value of a digital pin.
|
void |
setDigitalInput(byte pin,
GPIO.PullMode mode)
Set a digital input pin
|
void |
setDigitalOutput(byte pin)
Set a digital output pin
|
void |
setPinChangeType(byte pin,
GPIO.ChangeType type)
Sets the pin change detection type
|
static final byte ANALOG_DATA_SIZE
static final byte DIGITAL_DATA_SIZE
static final byte PIN_CHANGE_NOTIFY_SIZE
void readAnalogInput(byte pin, GPIO.AnalogMode mode)
pin
- Pin to readmode
- Read mode on the pinGPIO.Callbacks.receivedAnalogInputAsAbsReference(byte, short)
,
GPIO.Callbacks.receivedAnalogInputAsSupplyRatio(byte, short)
void readDigitalInput(byte pin)
pin
- Pin to readGPIO.Callbacks.receivedDigitalInput(byte, byte)
void setDigitalOutput(byte pin)
pin
- Pin to setvoid clearDigitalOutput(byte pin)
pin
- Pin to clearvoid setDigitalInput(byte pin, GPIO.PullMode mode)
pin
- Pin to setmode
- Pull mode to usevoid setPinChangeType(byte pin, GPIO.ChangeType type)
pin
- GPIO pin to monitortype
- Change type to notify onvoid enablePinChangeNotification(byte pin)
GPIO.Callbacks.pinChangeDetected(byte, byte)
callback functionpin
- GPIO pin numbervoid disablePinChangeNotification(byte pin)
pin
- GPIO pin number