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
mbed_src_STM32F7/api/Stream.h@10:56f2f01df983, 2017-04-10 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Mon Apr 10 13:44:13 2017 +0000
- Revision:
- 10:56f2f01df983
- Parent:
- 6:38f7dce055d0
11
Who changed what in which revision?
User | Revision | Line number | New 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 | #ifndef MBED_STREAM_H |
MikamiUitOpen | 6:38f7dce055d0 | 17 | #define MBED_STREAM_H |
MikamiUitOpen | 6:38f7dce055d0 | 18 | |
MikamiUitOpen | 6:38f7dce055d0 | 19 | #include "platform.h" |
MikamiUitOpen | 6:38f7dce055d0 | 20 | #include "FileLike.h" |
MikamiUitOpen | 6:38f7dce055d0 | 21 | #include <cstdarg> |
MikamiUitOpen | 6:38f7dce055d0 | 22 | |
MikamiUitOpen | 6:38f7dce055d0 | 23 | namespace mbed { |
MikamiUitOpen | 6:38f7dce055d0 | 24 | |
MikamiUitOpen | 6:38f7dce055d0 | 25 | extern void mbed_set_unbuffered_stream(FILE *_file); |
MikamiUitOpen | 6:38f7dce055d0 | 26 | extern int mbed_getc(FILE *_file); |
MikamiUitOpen | 6:38f7dce055d0 | 27 | extern char* mbed_gets(char *s, int size, FILE *_file); |
MikamiUitOpen | 6:38f7dce055d0 | 28 | |
MikamiUitOpen | 6:38f7dce055d0 | 29 | class Stream : public FileLike { |
MikamiUitOpen | 6:38f7dce055d0 | 30 | |
MikamiUitOpen | 6:38f7dce055d0 | 31 | public: |
MikamiUitOpen | 6:38f7dce055d0 | 32 | Stream(const char *name=NULL); |
MikamiUitOpen | 6:38f7dce055d0 | 33 | virtual ~Stream(); |
MikamiUitOpen | 6:38f7dce055d0 | 34 | |
MikamiUitOpen | 6:38f7dce055d0 | 35 | int putc(int c); |
MikamiUitOpen | 6:38f7dce055d0 | 36 | int puts(const char *s); |
MikamiUitOpen | 6:38f7dce055d0 | 37 | int getc(); |
MikamiUitOpen | 6:38f7dce055d0 | 38 | char *gets(char *s, int size); |
MikamiUitOpen | 6:38f7dce055d0 | 39 | int printf(const char* format, ...); |
MikamiUitOpen | 6:38f7dce055d0 | 40 | int scanf(const char* format, ...); |
MikamiUitOpen | 6:38f7dce055d0 | 41 | int vprintf(const char* format, std::va_list args); |
MikamiUitOpen | 6:38f7dce055d0 | 42 | int vscanf(const char* format, std::va_list args); |
MikamiUitOpen | 6:38f7dce055d0 | 43 | |
MikamiUitOpen | 6:38f7dce055d0 | 44 | operator std::FILE*() {return _file;} |
MikamiUitOpen | 6:38f7dce055d0 | 45 | |
MikamiUitOpen | 6:38f7dce055d0 | 46 | protected: |
MikamiUitOpen | 6:38f7dce055d0 | 47 | virtual int close(); |
MikamiUitOpen | 6:38f7dce055d0 | 48 | virtual ssize_t write(const void* buffer, size_t length); |
MikamiUitOpen | 6:38f7dce055d0 | 49 | virtual ssize_t read(void* buffer, size_t length); |
MikamiUitOpen | 6:38f7dce055d0 | 50 | virtual off_t lseek(off_t offset, int whence); |
MikamiUitOpen | 6:38f7dce055d0 | 51 | virtual int isatty(); |
MikamiUitOpen | 6:38f7dce055d0 | 52 | virtual int fsync(); |
MikamiUitOpen | 6:38f7dce055d0 | 53 | virtual off_t flen(); |
MikamiUitOpen | 6:38f7dce055d0 | 54 | |
MikamiUitOpen | 6:38f7dce055d0 | 55 | virtual int _putc(int c) = 0; |
MikamiUitOpen | 6:38f7dce055d0 | 56 | virtual int _getc() = 0; |
MikamiUitOpen | 6:38f7dce055d0 | 57 | |
MikamiUitOpen | 6:38f7dce055d0 | 58 | std::FILE *_file; |
MikamiUitOpen | 6:38f7dce055d0 | 59 | |
MikamiUitOpen | 6:38f7dce055d0 | 60 | /* disallow copy constructor and assignment operators */ |
MikamiUitOpen | 6:38f7dce055d0 | 61 | private: |
MikamiUitOpen | 6:38f7dce055d0 | 62 | Stream(const Stream&); |
MikamiUitOpen | 6:38f7dce055d0 | 63 | Stream & operator = (const Stream&); |
MikamiUitOpen | 6:38f7dce055d0 | 64 | }; |
MikamiUitOpen | 6:38f7dce055d0 | 65 | |
MikamiUitOpen | 6:38f7dce055d0 | 66 | } // namespace mbed |
MikamiUitOpen | 6:38f7dce055d0 | 67 | |
MikamiUitOpen | 6:38f7dce055d0 | 68 | #endif |