Browse Source

ToneAlarmInterface: move to drivers/drv_tone_alarm

It belongs there since it's not a library providing the implementation, but
just declaring the interface.
sbg
Beat Küng 6 years ago
parent
commit
3bdfd8ce8d
  1. 2
      platforms/nuttx/src/px4/nxp/kinetis/tone_alarm/ToneAlarmInterface.cpp
  2. 2
      platforms/nuttx/src/px4/stm/stm32_common/tone_alarm/ToneAlarmInterfaceGPIO.cpp
  3. 2
      platforms/nuttx/src/px4/stm/stm32_common/tone_alarm/ToneAlarmInterfacePWM.cpp
  4. 20
      src/drivers/drv_tone_alarm.h
  5. 1
      src/drivers/tone_alarm/ToneAlarm.h
  6. 1
      src/lib/drivers/CMakeLists.txt
  7. 34
      src/lib/drivers/tone_alarm/CMakeLists.txt
  8. 54
      src/lib/drivers/tone_alarm/ToneAlarmInterface.h

2
platforms/nuttx/src/px4/nxp/kinetis/tone_alarm/ToneAlarmInterface.cpp

@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
#include "kinetis_tpm.h"
#include <drivers/device/device.h>
#include <lib/drivers/tone_alarm/ToneAlarmInterface.h>
#include <drivers/drv_tone_alarm.h>
#include <px4_defines.h>
#include <systemlib/px4_macros.h>

2
platforms/nuttx/src/px4/stm/stm32_common/tone_alarm/ToneAlarmInterfaceGPIO.cpp

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
*
****************************************************************************/
#include <lib/drivers/tone_alarm/ToneAlarmInterface.h>
#include <drivers/drv_tone_alarm.h>
#include <px4_defines.h>
#include <board_config.h>

2
platforms/nuttx/src/px4/stm/stm32_common/tone_alarm/ToneAlarmInterfacePWM.cpp

@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
****************************************************************************/
#include <drivers/device/device.h>
#include <lib/drivers/tone_alarm/ToneAlarmInterface.h>
#include <drivers/drv_tone_alarm.h>
#include <px4_defines.h>
#include <cmath>

20
src/drivers/drv_tone_alarm.h

@ -91,3 +91,23 @@ enum { @@ -91,3 +91,23 @@ enum {
TONE_HOME_SET,
TONE_NUMBER_OF_TUNES
};
namespace ToneAlarmInterface
{
/**
* @brief Activates/configures the hardware registers.
*/
void init();
/**
* @brief Starts playing the note.
*/
void start_note(unsigned frequency);
/**
* @brief Stops playing the current note and makes the player 'safe'.
*/
void stop_note();
} // ToneAlarmInterface

1
src/drivers/tone_alarm/ToneAlarm.h

@ -43,7 +43,6 @@ @@ -43,7 +43,6 @@
#include <circuit_breaker/circuit_breaker.h>
#include <drivers/device/device.h>
#include <drivers/drv_tone_alarm.h>
#include <lib/drivers/tone_alarm/ToneAlarmInterface.h>
#include <lib/tunes/tunes.h>
#include <px4_defines.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>

1
src/lib/drivers/CMakeLists.txt

@ -41,4 +41,3 @@ add_subdirectory(linux_gpio) @@ -41,4 +41,3 @@ add_subdirectory(linux_gpio)
add_subdirectory(magnetometer)
add_subdirectory(rangefinder)
add_subdirectory(smbus)
add_subdirectory(tone_alarm)

34
src/lib/drivers/tone_alarm/CMakeLists.txt

@ -1,34 +0,0 @@ @@ -1,34 +0,0 @@
############################################################################
#
# Copyright (c) 2015-2019 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
# ToneAlarmInterface Library - Intentionally Blank

54
src/lib/drivers/tone_alarm/ToneAlarmInterface.h

@ -1,54 +0,0 @@ @@ -1,54 +0,0 @@
/****************************************************************************
*
* Copyright (C) 2013-2019 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/**
* @file ToneAlarmInterface.cpp
*/
namespace ToneAlarmInterface
{
/**
* @brief Activates/configures the hardware registers.
*/
void init();
/**
* @brief Starts playing the note.
*/
void start_note(unsigned frequency);
/**
* @brief Stops playing the current note and makes the player 'safe'.
*/
void stop_note();
}; // ToneAlarmInterface
Loading…
Cancel
Save