Rover API Documentation
rover_gpio.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 FH Dortmund and others
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Description:
9  * Rover Gpio API - Interfaces for Rover general purpose I/O application development - Header file
10  *
11  * Contributors:
12  * M.Ozcelikors <mozcelikors@gmail.com>, created API 17.11.2017
13  *
14  */
15 
16 #ifndef API_ROVER_GPIO_HPP_
17 #define API_ROVER_GPIO_HPP_
18 
19 namespace rover
20 {
24  class RoverGpio
25  {
26  public:
27 
28  /* Pin Modes */
32  static const int INPUT_ = 0;
33 
37  static const int OUTPUT_ = 1;
38 
42  static const int PWM_OUTPUT_ = 2;
43 
47  static const int GPIO_CLOCK_ = 3;
48 
52  static const int SOFT_PWM_OUTPUT_ = 4;
53 
57  static const int SOFT_TONE_OUTPUT_ = 5;
58 
62  static const int PWM_TONE_OUTPUT_ = 6;
63 
64  /* Voltage levels */
68  static const int LO = 0;
69 
73  static const int HI = 1;
74 
79  explicit RoverGpio();
80 
87  void wPiDigitalWrite (const int pin, const int value);
88 
94  int wPiDigitalRead (const int pin);
95 
102  void wPiPinMode (const int pin, const int set_val);
103 
109  void wPiSoftToneCreate (const int pin);
110 
117  void wPiSoftToneWrite (const int pin, const int tone);
118 
124  void wPiDelay (const unsigned int period_ms);
125  };
126 }
127 
128 
129 
130 #endif /* API_ROVER_GPIO_HPP_ */
static const int OUTPUT_
Static definition for OUTPUT pin mode for wPiPinMode function.
Definition: rover_gpio.hpp:37
void wPiDelay(const unsigned int period_ms)
Delay function. Blocks some time in milliseconds.
Definition: rover_gpio.cpp:64
int wPiDigitalRead(const int pin)
Wrapper function to wiringPi&#39;s digitalRead function.
Definition: rover_gpio.cpp:36
static const int LO
Static definition for digital voltage level : LOW.
Definition: rover_gpio.hpp:68
static const int SOFT_PWM_OUTPUT_
Static definition for SOFT_PWM_OUTPUT pin mode for wPiPinMode function.
Definition: rover_gpio.hpp:52
static const int PWM_TONE_OUTPUT_
Static definition for PWM_TONE_OUTPUT pin mode for wPiPinMode function.
Definition: rover_gpio.hpp:62
void wPiSoftToneWrite(const int pin, const int tone)
Wrapper function to wiringPi&#39;s softToneWrite function. Sets up a pin to have PWM soft tone output...
Definition: rover_gpio.cpp:57
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
static const int GPIO_CLOCK_
Static definition for GPIO_CLOCK pin mode for wPiPinMode function.
Definition: rover_gpio.hpp:47
void wPiPinMode(const int pin, const int set_val)
Wrapper function to wiringPi&#39;s pinMode function.
Definition: rover_gpio.cpp:43
static const int HI
Static definition for digital voltage level : HIGH.
Definition: rover_gpio.hpp:73
RoverGpio class provides the member functions related to basic GPIO operations. This class wraps wiri...
Definition: rover_gpio.hpp:24
RoverGpio()
Constructor function for the RoverGpio class.
Definition: rover_gpio.cpp:24
static const int SOFT_TONE_OUTPUT_
Static definition for SOFT_TONE_OUTPUT pin mode for wPiPinMode function.
Definition: rover_gpio.hpp:57
static const int INPUT_
Static definition for INPUT pin mode for wPiPinMode function.
Definition: rover_gpio.hpp:32
static const int PWM_OUTPUT_
Static definition for PWM_OUTPUT pin mode for wPiPinMode function.
Definition: rover_gpio.hpp:42
void wPiSoftToneCreate(const int pin)
Wrapper function to wiringPi&#39;s softToneCreate function. Sets up a pin to have PWM soft tone output...
Definition: rover_gpio.cpp:50
void wPiDigitalWrite(const int pin, const int value)
Wrapper function to wiringPi&#39;s digitalWrite function.
Definition: rover_gpio.cpp:29