Rover API Documentation
rover_buzzer.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  * RoverBuzzer API - Interfaces for Rover buzzer application development
10  * Header file
11  *
12  * Contributors:
13  * M.Ozcelikors <mozcelikors@gmail.com>, created C++API 05.12.2017
14  *
15  */
16 
17 #ifndef ROVERAPI_ROVER_BUZZER_HPP_
18 #define ROVERAPI_ROVER_BUZZER_HPP_
19 
20 #include <roverapi/rover_gpio.hpp>
21 
22 namespace rover
23 {
27  class RoverBuzzer : public RoverGpio
28  {
29  private:
30  /* Pins */
34  static const int DEFAULT_BUZZER_PIN = 28; //BCM-20, wiringpi 28
35 
40 
41  /* Variable members */
46 
51 
52  public:
53 
57  RoverBuzzer();
58 
63  void initialize (void);
64 
70  void setBuzzerFrequency (const int buzzer_freq);
71 
76  int getBuzzerFrequency (void);
77 
82  void setBuzzerOn (void);
83 
88  void setBuzzerOff (void);
89 
95  void setBuzzerPin (const int pin);
96 
102  void setBuzzerTone (const int buzzer_freq);
103 
108  void shutdownTone (void);
109  };
110 }
111 
112 
113 #endif /* ROVERAPI_ROVER_BUZZER_HPP_ */
void initialize(void)
Initializes the RoverBuzzer that is instantiated.
Definition: rover_buzzer.cpp:32
int BUZZER_PIN
Buzzer pin in wiringPi format.
Definition: rover_buzzer.hpp:39
void setBuzzerOn(void)
Plays the buzzer with the default frequency.
Definition: rover_buzzer.cpp:52
void setBuzzerFrequency(const int buzzer_freq)
Sets the default buzzer frequency in Hz. Values between 0-1000 Hz are conventionally used for the buz...
Definition: rover_buzzer.cpp:42
int BUZZER_FREQUENCY
Default buzzer frequency used by setBuzzerOn function.
Definition: rover_buzzer.hpp:45
void shutdownTone(void)
Plays the shutdown tone.
Definition: rover_buzzer.cpp:76
void setBuzzerPin(const int pin)
Overrides the default buzzer pin in wiringPi format.
Definition: rover_buzzer.cpp:102
int ROVERBUZZER_INIT_
Flag to hold if RoverBuzzer is initialized.
Definition: rover_buzzer.hpp:50
RoverBuzzer class provides the member functions related to embedded buzzer on the rover...
Definition: rover_buzzer.hpp:27
void setBuzzerTone(const int buzzer_freq)
Plays the buzzer with custom buzzer frequency.
Definition: rover_buzzer.cpp:90
int getBuzzerFrequency(void)
Retrieves the default buzzer frequency in Hz.
Definition: rover_buzzer.cpp:47
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
static const int DEFAULT_BUZZER_PIN
Embedded buzzer pin on rover in wiringPi format.
Definition: rover_buzzer.hpp:34
RoverBuzzer()
RoverBuzzer classs constructor.
Definition: rover_buzzer.cpp:24
RoverGpio class provides the member functions related to basic GPIO operations. This class wraps wiri...
Definition: rover_gpio.hpp:24
void setBuzzerOff(void)
Turns off the buzzer.
Definition: rover_buzzer.cpp:64