00001 /* noise output via piezo speaker */ 00002 /* Copyright (C) 2011 Holger Dietze 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) version 3. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License along 00015 * with this program; if not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef NOISE_H 00019 #define NOISE_H 00020 00028 void xpal_noise_init (void); 00029 00034 void xpal_output_noise (uint16_t duration, uint8_t value, 00035 volatile uint8_t *pdone); 00036 00037 inline void xpal_output_noise_ms (uint16_t duration, uint8_t value, 00038 volatile uint8_t *pdone) 00039 { 00040 xpal_output_noise ((uint32_t)duration*(F_CPU/256)/1000, value, pdone); 00041 } 00042 00043 #endif