-
Notifications
You must be signed in to change notification settings - Fork 2
GPIO
projectopenvcik edited this page Aug 20, 2015
·
2 revisions
###Description GPIO Interface - This interface allows manipulation of OpenVCI Kit's GPIO pins.
GPIO
enum Type{DIGITAL_IN = 0, DIGITAL_IN_PULLUP, DIGITAL_OUT}
Type - Pin mode types
-
DIGITAL_IN
- digital input mode -
DIGITAL_IN_PULLUP
- digital input with pullup -
DIGITAL_OUT
- digital output mode
GPIO()
Constructor - initializes the pins and other variables
void setType(byte pin, Type type)
Allows setting of the type i.e. INPUT or OUTPUT of an individual GPIO pin.
Arguments:
- pin (Type:
byte
) - the GPIO pin number - type(Type:
Type
) - type to be set for the pins
void setType(byte from, byte to, Type type)
Allows setting of the type i.e. INPUT or OUTPUT of a range of GPIO pins.
Arguments
- from (Type:
byte
) - starting GPIO pin number - to (Type:
byte
) - ending GPIO pin number - type(Type:
Type
) - type to be set for the pins
void writeDigital(byte from, byte to, boolean value)
Set/Reset a range of GPIO pins in digital mode.
Arguments:
- from (Type:
byte
) - starting GPIO pin number - to (Type:
byte
) - ending GPIO pin number - value(Type:
boolean
) - High / Low
void writeDigital(byte pin, boolean value)
Set/Reset an individual GPIO in digital mode.
Arguments:
- pin (Type:
byte
) - the GPIO pin number - value (Type:
boolean
) - High / low
void writePWM(byte from, byte to, byte value)
Set/Reset a range of GPIO pins in PWM mode.
Arguments:
- from (Type:
byte
) - starting GPIO pin number - to (Type:
byte
) - ending GPIO pin number - value(Type:
byte
) - PWM Value (0-255)
void writePWM(byte pin, boolean value)
Set/Reset an individual GPIO in PWM mode.
Arguments:
- pin (Type:
byte
) - the GPIO pin number - value (Type:
byte
) - PWM Value (0-255)
- Hardware setup
- Software setup
- Understanding the Framework
- Some specific Types
- Sensor data and command formats
- Your first OpenVCIK application
- How to write more sophisticated OpenVCIK applications
- Some use cases
- OpenVCIK Services
- Sub modules
- OpenVCIK Firmware