/* * Authors (alphabetical order) * - Andre Bernet * - Andreas Weitl * - Bertrand Songis * - Bryan J. Rentoul (Gruvin) * - Cameron Weeks * - Erez Raviv * - Gabriel Birkus * - Jean-Pierre Parisy * - Karl Szmutny * - Michael Blandford * - Michal Hlavinka * - Pat Mackenzie * - Philip Moss * - Rob Thomson * - Romolo Manfredini * - Thomas Husterer * * opentx is based on code named * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * er9x by Erez Raviv: http://code.google.com/p/er9x/, * and the original (and ongoing) project by * Thomas Husterer, th9x: http://code.google.com/p/th9x/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef audio_driver_h #define audio_driver_h void audioInit( void ) ; void audioEnd( void ) ; void dacStart(); void dacStop(); extern void setSampleRate(uint32_t frequency); #define VOLUME_LEVEL_MAX 23 #define VOLUME_LEVEL_DEF 12 static const int8_t volumeScale[VOLUME_LEVEL_MAX+1] = { 0, 1, 2, 3, 5, 9, 13, 17, 22, 27, 33, 40, 64, 82, 96, 105, 112, 117, 120, 122, 124, 125, 126, 127 } ; #if !defined(SIMU) #define setVolume(v) I2C_set_volume(volumeScale[min(v, VOLUME_LEVEL_MAX)]) #else #define setVolume(v) #endif #endif