Public Member Functions | Private Attributes
GpioDriver Class Reference

Driver to use a GPIO on a supported serial device. More...

#include <gpio_driver.h>

Inheritance diagram for GpioDriver:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool get (gpio_input_mode mode)
 Performs a digital read on the GPIO Pin returning the read value in value.
uint8_t getDeviceAddress (void)
 GpioDriver (bosch_hardware_interface *hw, uint8_t pin)
 Constructor.
bool initialize ()
 Initializes the driver and the connected hardware.
bool set (bool value)
 Set a GPIO Pin to HIGH or LOW. It will always configure the pin as an output first.
 ~GpioDriver ()

Private Attributes

uint8_t _pin

Detailed Description

Driver to use a GPIO on a supported serial device.

This class lets the user access the GPIO pins of any supported hardware It is possible to configure the pin as Output, floating Input, Input with Pullup or Input with Pulldown Depending on the hardware used some of these options might not be available Once the GPIO is configured it can be set to HIGH or LOW if output or can be read if configured as an input

Definition at line 59 of file gpio_driver.h.


Constructor & Destructor Documentation

GpioDriver::GpioDriver ( bosch_hardware_interface hw,
uint8_t  pin 
)

Constructor.

Parameters:
hwhardware interface to use
pinGPIO pin number on the hardware device

Definition at line 41 of file gpio_driver.cpp.

Definition at line 46 of file gpio_driver.cpp.


Member Function Documentation

Performs a digital read on the GPIO Pin returning the read value in value.

Parameters:
modeconfigures the input pin to be either floating, add a pullup or a pulldown
Returns:
Read value at given pin. 1 if selected Pin is HIGH and 0 if it is LOW

Definition at line 81 of file gpio_driver.cpp.

uint8_t GpioDriver::getDeviceAddress ( void  ) [virtual]

Implements bosch_drivers_common::sensor_driver.

Definition at line 50 of file gpio_driver.cpp.

Initializes the driver and the connected hardware.

Returns:
a boolean indicating success

Definition at line 56 of file gpio_driver.cpp.

bool GpioDriver::set ( bool  value)

Set a GPIO Pin to HIGH or LOW. It will always configure the pin as an output first.

Parameters:
value0 will set the GPIO pin to LOW and 1 will set it to HIGH
Returns:
true if GPIO output was successful or false if not

Definition at line 67 of file gpio_driver.cpp.


Member Data Documentation

uint8_t GpioDriver::_pin [private]

Definition at line 97 of file gpio_driver.h.


The documentation for this class was generated from the following files:


gpio_driver
Author(s): Kai Franke
autogenerated on Sat Dec 28 2013 16:50:06