Output the audio signal with filtering by graphic equalizer in the *.wav file on the SD card using onboard CODEC. SD カードの *.wav ファイルのオーディオ信号をグラフィック・イコライザを通して,ボードに搭載されているCODEC で出力する.
Dependencies: F746_GUI F746_SAI_IO SD_PlayerSkeleton FrequencyResponseDrawer
mbed_src_STM32F7/api/Ethernet.h@16:cbb726ac20d8, 2016-10-02 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Sun Oct 02 06:33:59 2016 +0000
- Revision:
- 16:cbb726ac20d8
17
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 16:cbb726ac20d8 | 1 | /* mbed Microcontroller Library |
MikamiUitOpen | 16:cbb726ac20d8 | 2 | * Copyright (c) 2006-2013 ARM Limited |
MikamiUitOpen | 16:cbb726ac20d8 | 3 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
MikamiUitOpen | 16:cbb726ac20d8 | 5 | * you may not use this file except in compliance with the License. |
MikamiUitOpen | 16:cbb726ac20d8 | 6 | * You may obtain a copy of the License at |
MikamiUitOpen | 16:cbb726ac20d8 | 7 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
MikamiUitOpen | 16:cbb726ac20d8 | 9 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 10 | * Unless required by applicable law or agreed to in writing, software |
MikamiUitOpen | 16:cbb726ac20d8 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
MikamiUitOpen | 16:cbb726ac20d8 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
MikamiUitOpen | 16:cbb726ac20d8 | 13 | * See the License for the specific language governing permissions and |
MikamiUitOpen | 16:cbb726ac20d8 | 14 | * limitations under the License. |
MikamiUitOpen | 16:cbb726ac20d8 | 15 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 16 | #ifndef MBED_ETHERNET_H |
MikamiUitOpen | 16:cbb726ac20d8 | 17 | #define MBED_ETHERNET_H |
MikamiUitOpen | 16:cbb726ac20d8 | 18 | |
MikamiUitOpen | 16:cbb726ac20d8 | 19 | #include "platform.h" |
MikamiUitOpen | 16:cbb726ac20d8 | 20 | |
MikamiUitOpen | 16:cbb726ac20d8 | 21 | #if DEVICE_ETHERNET |
MikamiUitOpen | 16:cbb726ac20d8 | 22 | |
MikamiUitOpen | 16:cbb726ac20d8 | 23 | namespace mbed { |
MikamiUitOpen | 16:cbb726ac20d8 | 24 | |
MikamiUitOpen | 16:cbb726ac20d8 | 25 | /** An ethernet interface, to use with the ethernet pins. |
MikamiUitOpen | 16:cbb726ac20d8 | 26 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 27 | * Example: |
MikamiUitOpen | 16:cbb726ac20d8 | 28 | * @code |
MikamiUitOpen | 16:cbb726ac20d8 | 29 | * // Read destination and source from every ethernet packet |
MikamiUitOpen | 16:cbb726ac20d8 | 30 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 31 | * #include "mbed.h" |
MikamiUitOpen | 16:cbb726ac20d8 | 32 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 33 | * Ethernet eth; |
MikamiUitOpen | 16:cbb726ac20d8 | 34 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 35 | * int main() { |
MikamiUitOpen | 16:cbb726ac20d8 | 36 | * char buf[0x600]; |
MikamiUitOpen | 16:cbb726ac20d8 | 37 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 38 | * while(1) { |
MikamiUitOpen | 16:cbb726ac20d8 | 39 | * int size = eth.receive(); |
MikamiUitOpen | 16:cbb726ac20d8 | 40 | * if(size > 0) { |
MikamiUitOpen | 16:cbb726ac20d8 | 41 | * eth.read(buf, size); |
MikamiUitOpen | 16:cbb726ac20d8 | 42 | * printf("Destination: %02X:%02X:%02X:%02X:%02X:%02X\n", |
MikamiUitOpen | 16:cbb726ac20d8 | 43 | * buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); |
MikamiUitOpen | 16:cbb726ac20d8 | 44 | * printf("Source: %02X:%02X:%02X:%02X:%02X:%02X\n", |
MikamiUitOpen | 16:cbb726ac20d8 | 45 | * buf[6], buf[7], buf[8], buf[9], buf[10], buf[11]); |
MikamiUitOpen | 16:cbb726ac20d8 | 46 | * } |
MikamiUitOpen | 16:cbb726ac20d8 | 47 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 48 | * wait(1); |
MikamiUitOpen | 16:cbb726ac20d8 | 49 | * } |
MikamiUitOpen | 16:cbb726ac20d8 | 50 | * } |
MikamiUitOpen | 16:cbb726ac20d8 | 51 | * @endcode |
MikamiUitOpen | 16:cbb726ac20d8 | 52 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 53 | class Ethernet { |
MikamiUitOpen | 16:cbb726ac20d8 | 54 | |
MikamiUitOpen | 16:cbb726ac20d8 | 55 | public: |
MikamiUitOpen | 16:cbb726ac20d8 | 56 | |
MikamiUitOpen | 16:cbb726ac20d8 | 57 | /** Initialise the ethernet interface. |
MikamiUitOpen | 16:cbb726ac20d8 | 58 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 59 | Ethernet(); |
MikamiUitOpen | 16:cbb726ac20d8 | 60 | |
MikamiUitOpen | 16:cbb726ac20d8 | 61 | /** Powers the hardware down. |
MikamiUitOpen | 16:cbb726ac20d8 | 62 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 63 | virtual ~Ethernet(); |
MikamiUitOpen | 16:cbb726ac20d8 | 64 | |
MikamiUitOpen | 16:cbb726ac20d8 | 65 | enum Mode { |
MikamiUitOpen | 16:cbb726ac20d8 | 66 | AutoNegotiate, |
MikamiUitOpen | 16:cbb726ac20d8 | 67 | HalfDuplex10, |
MikamiUitOpen | 16:cbb726ac20d8 | 68 | FullDuplex10, |
MikamiUitOpen | 16:cbb726ac20d8 | 69 | HalfDuplex100, |
MikamiUitOpen | 16:cbb726ac20d8 | 70 | FullDuplex100 |
MikamiUitOpen | 16:cbb726ac20d8 | 71 | }; |
MikamiUitOpen | 16:cbb726ac20d8 | 72 | |
MikamiUitOpen | 16:cbb726ac20d8 | 73 | /** Writes into an outgoing ethernet packet. |
MikamiUitOpen | 16:cbb726ac20d8 | 74 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 75 | * It will append size bytes of data to the previously written bytes. |
MikamiUitOpen | 16:cbb726ac20d8 | 76 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 77 | * @param data An array to write. |
MikamiUitOpen | 16:cbb726ac20d8 | 78 | * @param size The size of data. |
MikamiUitOpen | 16:cbb726ac20d8 | 79 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 80 | * @returns |
MikamiUitOpen | 16:cbb726ac20d8 | 81 | * The number of written bytes. |
MikamiUitOpen | 16:cbb726ac20d8 | 82 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 83 | int write(const char *data, int size); |
MikamiUitOpen | 16:cbb726ac20d8 | 84 | |
MikamiUitOpen | 16:cbb726ac20d8 | 85 | /** Send an outgoing ethernet packet. |
MikamiUitOpen | 16:cbb726ac20d8 | 86 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 87 | * After filling in the data in an ethernet packet it must be send. |
MikamiUitOpen | 16:cbb726ac20d8 | 88 | * Send will provide a new packet to write to. |
MikamiUitOpen | 16:cbb726ac20d8 | 89 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 90 | * @returns |
MikamiUitOpen | 16:cbb726ac20d8 | 91 | * 0 if the sending was failed, |
MikamiUitOpen | 16:cbb726ac20d8 | 92 | * or the size of the packet successfully sent. |
MikamiUitOpen | 16:cbb726ac20d8 | 93 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 94 | int send(); |
MikamiUitOpen | 16:cbb726ac20d8 | 95 | |
MikamiUitOpen | 16:cbb726ac20d8 | 96 | /** Recevies an arrived ethernet packet. |
MikamiUitOpen | 16:cbb726ac20d8 | 97 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 98 | * Receiving an ethernet packet will drop the last received ethernet packet |
MikamiUitOpen | 16:cbb726ac20d8 | 99 | * and make a new ethernet packet ready to read. |
MikamiUitOpen | 16:cbb726ac20d8 | 100 | * If no ethernet packet is arrived it will return 0. |
MikamiUitOpen | 16:cbb726ac20d8 | 101 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 102 | * @returns |
MikamiUitOpen | 16:cbb726ac20d8 | 103 | * 0 if no ethernet packet is arrived, |
MikamiUitOpen | 16:cbb726ac20d8 | 104 | * or the size of the arrived packet. |
MikamiUitOpen | 16:cbb726ac20d8 | 105 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 106 | int receive(); |
MikamiUitOpen | 16:cbb726ac20d8 | 107 | |
MikamiUitOpen | 16:cbb726ac20d8 | 108 | /** Read from an recevied ethernet packet. |
MikamiUitOpen | 16:cbb726ac20d8 | 109 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 110 | * After receive returnd a number bigger than 0it is |
MikamiUitOpen | 16:cbb726ac20d8 | 111 | * possible to read bytes from this packet. |
MikamiUitOpen | 16:cbb726ac20d8 | 112 | * Read will write up to size bytes into data. |
MikamiUitOpen | 16:cbb726ac20d8 | 113 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 114 | * It is possible to use read multible times. |
MikamiUitOpen | 16:cbb726ac20d8 | 115 | * Each time read will start reading after the last read byte before. |
MikamiUitOpen | 16:cbb726ac20d8 | 116 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 117 | * @returns |
MikamiUitOpen | 16:cbb726ac20d8 | 118 | * The number of byte read. |
MikamiUitOpen | 16:cbb726ac20d8 | 119 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 120 | int read(char *data, int size); |
MikamiUitOpen | 16:cbb726ac20d8 | 121 | |
MikamiUitOpen | 16:cbb726ac20d8 | 122 | /** Gives the ethernet address of the mbed. |
MikamiUitOpen | 16:cbb726ac20d8 | 123 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 124 | * @param mac Must be a pointer to a 6 byte char array to copy the ethernet address in. |
MikamiUitOpen | 16:cbb726ac20d8 | 125 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 126 | void address(char *mac); |
MikamiUitOpen | 16:cbb726ac20d8 | 127 | |
MikamiUitOpen | 16:cbb726ac20d8 | 128 | /** Returns if an ethernet link is pressent or not. It takes a wile after Ethernet initializion to show up. |
MikamiUitOpen | 16:cbb726ac20d8 | 129 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 130 | * @returns |
MikamiUitOpen | 16:cbb726ac20d8 | 131 | * 0 if no ethernet link is pressent, |
MikamiUitOpen | 16:cbb726ac20d8 | 132 | * 1 if an ethernet link is pressent. |
MikamiUitOpen | 16:cbb726ac20d8 | 133 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 134 | * Example: |
MikamiUitOpen | 16:cbb726ac20d8 | 135 | * @code |
MikamiUitOpen | 16:cbb726ac20d8 | 136 | * // Using the Ethernet link function |
MikamiUitOpen | 16:cbb726ac20d8 | 137 | * #include "mbed.h" |
MikamiUitOpen | 16:cbb726ac20d8 | 138 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 139 | * Ethernet eth; |
MikamiUitOpen | 16:cbb726ac20d8 | 140 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 141 | * int main() { |
MikamiUitOpen | 16:cbb726ac20d8 | 142 | * wait(1); // Needed after startup. |
MikamiUitOpen | 16:cbb726ac20d8 | 143 | * if (eth.link()) { |
MikamiUitOpen | 16:cbb726ac20d8 | 144 | * printf("online\n"); |
MikamiUitOpen | 16:cbb726ac20d8 | 145 | * } else { |
MikamiUitOpen | 16:cbb726ac20d8 | 146 | * printf("offline\n"); |
MikamiUitOpen | 16:cbb726ac20d8 | 147 | * } |
MikamiUitOpen | 16:cbb726ac20d8 | 148 | * } |
MikamiUitOpen | 16:cbb726ac20d8 | 149 | * @endcode |
MikamiUitOpen | 16:cbb726ac20d8 | 150 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 151 | int link(); |
MikamiUitOpen | 16:cbb726ac20d8 | 152 | |
MikamiUitOpen | 16:cbb726ac20d8 | 153 | /** Sets the speed and duplex parameters of an ethernet link |
MikamiUitOpen | 16:cbb726ac20d8 | 154 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 155 | * - AutoNegotiate Auto negotiate speed and duplex |
MikamiUitOpen | 16:cbb726ac20d8 | 156 | * - HalfDuplex10 10 Mbit, half duplex |
MikamiUitOpen | 16:cbb726ac20d8 | 157 | * - FullDuplex10 10 Mbit, full duplex |
MikamiUitOpen | 16:cbb726ac20d8 | 158 | * - HalfDuplex100 100 Mbit, half duplex |
MikamiUitOpen | 16:cbb726ac20d8 | 159 | * - FullDuplex100 100 Mbit, full duplex |
MikamiUitOpen | 16:cbb726ac20d8 | 160 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 161 | * @param mode the speed and duplex mode to set the link to: |
MikamiUitOpen | 16:cbb726ac20d8 | 162 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 163 | void set_link(Mode mode); |
MikamiUitOpen | 16:cbb726ac20d8 | 164 | }; |
MikamiUitOpen | 16:cbb726ac20d8 | 165 | |
MikamiUitOpen | 16:cbb726ac20d8 | 166 | } // namespace mbed |
MikamiUitOpen | 16:cbb726ac20d8 | 167 | |
MikamiUitOpen | 16:cbb726ac20d8 | 168 | #endif |
MikamiUitOpen | 16:cbb726ac20d8 | 169 | |
MikamiUitOpen | 16:cbb726ac20d8 | 170 | #endif |