Audio singal input and output example for DISCO-F746. Input: MEMS mic, Output: CN10 OUT, Acoustic effect: echo and frequency shift. DISCO-F746 によるオーディオ信号入出力.入力:MEMS マイク,出力:CN10 OUT,音響効果:エコー,周波数変換.

Dependencies:   F746_GUI F746_SAI_IO

Committer:
MikamiUitOpen
Date:
Sun Oct 02 10:44:58 2016 +0000
Revision:
6:38f7dce055d0
7

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MikamiUitOpen 6:38f7dce055d0 1 /* mbed Microcontroller Library
MikamiUitOpen 6:38f7dce055d0 2 * Copyright (c) 2006-2013 ARM Limited
MikamiUitOpen 6:38f7dce055d0 3 *
MikamiUitOpen 6:38f7dce055d0 4 * Licensed under the Apache License, Version 2.0 (the "License");
MikamiUitOpen 6:38f7dce055d0 5 * you may not use this file except in compliance with the License.
MikamiUitOpen 6:38f7dce055d0 6 * You may obtain a copy of the License at
MikamiUitOpen 6:38f7dce055d0 7 *
MikamiUitOpen 6:38f7dce055d0 8 * http://www.apache.org/licenses/LICENSE-2.0
MikamiUitOpen 6:38f7dce055d0 9 *
MikamiUitOpen 6:38f7dce055d0 10 * Unless required by applicable law or agreed to in writing, software
MikamiUitOpen 6:38f7dce055d0 11 * distributed under the License is distributed on an "AS IS" BASIS,
MikamiUitOpen 6:38f7dce055d0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
MikamiUitOpen 6:38f7dce055d0 13 * See the License for the specific language governing permissions and
MikamiUitOpen 6:38f7dce055d0 14 * limitations under the License.
MikamiUitOpen 6:38f7dce055d0 15 */
MikamiUitOpen 6:38f7dce055d0 16
MikamiUitOpen 6:38f7dce055d0 17 #include <time.h>
MikamiUitOpen 6:38f7dce055d0 18
MikamiUitOpen 6:38f7dce055d0 19 #ifdef __cplusplus
MikamiUitOpen 6:38f7dce055d0 20 extern "C" {
MikamiUitOpen 6:38f7dce055d0 21 #endif
MikamiUitOpen 6:38f7dce055d0 22
MikamiUitOpen 6:38f7dce055d0 23 /** Implementation of the C time.h functions
MikamiUitOpen 6:38f7dce055d0 24 *
MikamiUitOpen 6:38f7dce055d0 25 * Provides mechanisms to set and read the current time, based
MikamiUitOpen 6:38f7dce055d0 26 * on the microcontroller Real-Time Clock (RTC), plus some
MikamiUitOpen 6:38f7dce055d0 27 * standard C manipulation and formating functions.
MikamiUitOpen 6:38f7dce055d0 28 *
MikamiUitOpen 6:38f7dce055d0 29 * Example:
MikamiUitOpen 6:38f7dce055d0 30 * @code
MikamiUitOpen 6:38f7dce055d0 31 * #include "mbed.h"
MikamiUitOpen 6:38f7dce055d0 32 *
MikamiUitOpen 6:38f7dce055d0 33 * int main() {
MikamiUitOpen 6:38f7dce055d0 34 * set_time(1256729737); // Set RTC time to Wed, 28 Oct 2009 11:35:37
MikamiUitOpen 6:38f7dce055d0 35 *
MikamiUitOpen 6:38f7dce055d0 36 * while(1) {
MikamiUitOpen 6:38f7dce055d0 37 * time_t seconds = time(NULL);
MikamiUitOpen 6:38f7dce055d0 38 *
MikamiUitOpen 6:38f7dce055d0 39 * printf("Time as seconds since January 1, 1970 = %d\n", seconds);
MikamiUitOpen 6:38f7dce055d0 40 *
MikamiUitOpen 6:38f7dce055d0 41 * printf("Time as a basic string = %s", ctime(&seconds));
MikamiUitOpen 6:38f7dce055d0 42 *
MikamiUitOpen 6:38f7dce055d0 43 * char buffer[32];
MikamiUitOpen 6:38f7dce055d0 44 * strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds));
MikamiUitOpen 6:38f7dce055d0 45 * printf("Time as a custom formatted string = %s", buffer);
MikamiUitOpen 6:38f7dce055d0 46 *
MikamiUitOpen 6:38f7dce055d0 47 * wait(1);
MikamiUitOpen 6:38f7dce055d0 48 * }
MikamiUitOpen 6:38f7dce055d0 49 * }
MikamiUitOpen 6:38f7dce055d0 50 * @endcode
MikamiUitOpen 6:38f7dce055d0 51 */
MikamiUitOpen 6:38f7dce055d0 52
MikamiUitOpen 6:38f7dce055d0 53 /** Set the current time
MikamiUitOpen 6:38f7dce055d0 54 *
MikamiUitOpen 6:38f7dce055d0 55 * Initialises and sets the time of the microcontroller Real-Time Clock (RTC)
MikamiUitOpen 6:38f7dce055d0 56 * to the time represented by the number of seconds since January 1, 1970
MikamiUitOpen 6:38f7dce055d0 57 * (the UNIX timestamp).
MikamiUitOpen 6:38f7dce055d0 58 *
MikamiUitOpen 6:38f7dce055d0 59 * @param t Number of seconds since January 1, 1970 (the UNIX timestamp)
MikamiUitOpen 6:38f7dce055d0 60 *
MikamiUitOpen 6:38f7dce055d0 61 * Example:
MikamiUitOpen 6:38f7dce055d0 62 * @code
MikamiUitOpen 6:38f7dce055d0 63 * #include "mbed.h"
MikamiUitOpen 6:38f7dce055d0 64 *
MikamiUitOpen 6:38f7dce055d0 65 * int main() {
MikamiUitOpen 6:38f7dce055d0 66 * set_time(1256729737); // Set time to Wed, 28 Oct 2009 11:35:37
MikamiUitOpen 6:38f7dce055d0 67 * }
MikamiUitOpen 6:38f7dce055d0 68 * @endcode
MikamiUitOpen 6:38f7dce055d0 69 */
MikamiUitOpen 6:38f7dce055d0 70 void set_time(time_t t);
MikamiUitOpen 6:38f7dce055d0 71
MikamiUitOpen 6:38f7dce055d0 72 /** Attach an external RTC to be used for the C time functions
MikamiUitOpen 6:38f7dce055d0 73 *
MikamiUitOpen 6:38f7dce055d0 74 * Do not call this function from an interrupt while an RTC read/write operation may be occurring
MikamiUitOpen 6:38f7dce055d0 75 *
MikamiUitOpen 6:38f7dce055d0 76 * @param read_rtc pointer to function which returns current UNIX timestamp
MikamiUitOpen 6:38f7dce055d0 77 * @param write_rtc pointer to function which sets current UNIX timestamp, can be NULL
MikamiUitOpen 6:38f7dce055d0 78 * @param init_rtc pointer to funtion which initializes RTC, can be NULL
MikamiUitOpen 6:38f7dce055d0 79 * @param isenabled_rtc pointer to function wich returns if the rtc is enabled, can be NULL
MikamiUitOpen 6:38f7dce055d0 80 */
MikamiUitOpen 6:38f7dce055d0 81 void attach_rtc(time_t (*read_rtc)(void), void (*write_rtc)(time_t), void (*init_rtc)(void), int (*isenabled_rtc)(void));
MikamiUitOpen 6:38f7dce055d0 82
MikamiUitOpen 6:38f7dce055d0 83 #ifdef __cplusplus
MikamiUitOpen 6:38f7dce055d0 84 }
MikamiUitOpen 6:38f7dce055d0 85 #endif