Final version.

Dependencies:   F746_GUI F746_SAI_IO UIT_FFT_Real

Fork of F746_Spectrogram by 不韋 呂

Committer:
mladjo1993
Date:
Wed Aug 30 07:47:58 2017 +0000
Revision:
9:444e58089d09
Parent:
4:c1beacfc42c7
Final version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MikamiUitOpen 4:c1beacfc42c7 1 /* mbed Microcontroller Library
MikamiUitOpen 4:c1beacfc42c7 2 * Copyright (c) 2006-2013 ARM Limited
MikamiUitOpen 4:c1beacfc42c7 3 *
MikamiUitOpen 4:c1beacfc42c7 4 * Licensed under the Apache License, Version 2.0 (the "License");
MikamiUitOpen 4:c1beacfc42c7 5 * you may not use this file except in compliance with the License.
MikamiUitOpen 4:c1beacfc42c7 6 * You may obtain a copy of the License at
MikamiUitOpen 4:c1beacfc42c7 7 *
MikamiUitOpen 4:c1beacfc42c7 8 * http://www.apache.org/licenses/LICENSE-2.0
MikamiUitOpen 4:c1beacfc42c7 9 *
MikamiUitOpen 4:c1beacfc42c7 10 * Unless required by applicable law or agreed to in writing, software
MikamiUitOpen 4:c1beacfc42c7 11 * distributed under the License is distributed on an "AS IS" BASIS,
MikamiUitOpen 4:c1beacfc42c7 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
MikamiUitOpen 4:c1beacfc42c7 13 * See the License for the specific language governing permissions and
MikamiUitOpen 4:c1beacfc42c7 14 * limitations under the License.
MikamiUitOpen 4:c1beacfc42c7 15 */
MikamiUitOpen 4:c1beacfc42c7 16 #ifndef MBED_RAW_SERIAL_H
MikamiUitOpen 4:c1beacfc42c7 17 #define MBED_RAW_SERIAL_H
MikamiUitOpen 4:c1beacfc42c7 18
MikamiUitOpen 4:c1beacfc42c7 19 #include "platform.h"
MikamiUitOpen 4:c1beacfc42c7 20
MikamiUitOpen 4:c1beacfc42c7 21 #if DEVICE_SERIAL
MikamiUitOpen 4:c1beacfc42c7 22
MikamiUitOpen 4:c1beacfc42c7 23 #include "SerialBase.h"
MikamiUitOpen 4:c1beacfc42c7 24 #include "serial_api.h"
MikamiUitOpen 4:c1beacfc42c7 25
MikamiUitOpen 4:c1beacfc42c7 26 namespace mbed {
MikamiUitOpen 4:c1beacfc42c7 27
MikamiUitOpen 4:c1beacfc42c7 28 /** A serial port (UART) for communication with other serial devices
MikamiUitOpen 4:c1beacfc42c7 29 * This is a variation of the Serial class that doesn't use streams,
MikamiUitOpen 4:c1beacfc42c7 30 * thus making it safe to use in interrupt handlers with the RTOS.
MikamiUitOpen 4:c1beacfc42c7 31 *
MikamiUitOpen 4:c1beacfc42c7 32 * Can be used for Full Duplex communication, or Simplex by specifying
MikamiUitOpen 4:c1beacfc42c7 33 * one pin as NC (Not Connected)
MikamiUitOpen 4:c1beacfc42c7 34 *
MikamiUitOpen 4:c1beacfc42c7 35 * Example:
MikamiUitOpen 4:c1beacfc42c7 36 * @code
MikamiUitOpen 4:c1beacfc42c7 37 * // Send a char to the PC
MikamiUitOpen 4:c1beacfc42c7 38 *
MikamiUitOpen 4:c1beacfc42c7 39 * #include "mbed.h"
MikamiUitOpen 4:c1beacfc42c7 40 *
MikamiUitOpen 4:c1beacfc42c7 41 * RawSerial pc(USBTX, USBRX);
MikamiUitOpen 4:c1beacfc42c7 42 *
MikamiUitOpen 4:c1beacfc42c7 43 * int main() {
MikamiUitOpen 4:c1beacfc42c7 44 * pc.putc('A');
MikamiUitOpen 4:c1beacfc42c7 45 * }
MikamiUitOpen 4:c1beacfc42c7 46 * @endcode
MikamiUitOpen 4:c1beacfc42c7 47 */
MikamiUitOpen 4:c1beacfc42c7 48 class RawSerial: public SerialBase {
MikamiUitOpen 4:c1beacfc42c7 49
MikamiUitOpen 4:c1beacfc42c7 50 public:
MikamiUitOpen 4:c1beacfc42c7 51 /** Create a RawSerial port, connected to the specified transmit and receive pins
MikamiUitOpen 4:c1beacfc42c7 52 *
MikamiUitOpen 4:c1beacfc42c7 53 * @param tx Transmit pin
MikamiUitOpen 4:c1beacfc42c7 54 * @param rx Receive pin
MikamiUitOpen 4:c1beacfc42c7 55 *
MikamiUitOpen 4:c1beacfc42c7 56 * @note
MikamiUitOpen 4:c1beacfc42c7 57 * Either tx or rx may be specified as NC if unused
MikamiUitOpen 4:c1beacfc42c7 58 */
MikamiUitOpen 4:c1beacfc42c7 59 RawSerial(PinName tx, PinName rx);
MikamiUitOpen 4:c1beacfc42c7 60
MikamiUitOpen 4:c1beacfc42c7 61 /** Write a char to the serial port
MikamiUitOpen 4:c1beacfc42c7 62 *
MikamiUitOpen 4:c1beacfc42c7 63 * @param c The char to write
MikamiUitOpen 4:c1beacfc42c7 64 *
MikamiUitOpen 4:c1beacfc42c7 65 * @returns The written char or -1 if an error occured
MikamiUitOpen 4:c1beacfc42c7 66 */
MikamiUitOpen 4:c1beacfc42c7 67 int putc(int c);
MikamiUitOpen 4:c1beacfc42c7 68
MikamiUitOpen 4:c1beacfc42c7 69 /** Read a char from the serial port
MikamiUitOpen 4:c1beacfc42c7 70 *
MikamiUitOpen 4:c1beacfc42c7 71 * @returns The char read from the serial port
MikamiUitOpen 4:c1beacfc42c7 72 */
MikamiUitOpen 4:c1beacfc42c7 73 int getc();
MikamiUitOpen 4:c1beacfc42c7 74
MikamiUitOpen 4:c1beacfc42c7 75 /** Write a string to the serial port
MikamiUitOpen 4:c1beacfc42c7 76 *
MikamiUitOpen 4:c1beacfc42c7 77 * @param str The string to write
MikamiUitOpen 4:c1beacfc42c7 78 *
MikamiUitOpen 4:c1beacfc42c7 79 * @returns 0 if the write succeeds, EOF for error
MikamiUitOpen 4:c1beacfc42c7 80 */
MikamiUitOpen 4:c1beacfc42c7 81 int puts(const char *str);
MikamiUitOpen 4:c1beacfc42c7 82
MikamiUitOpen 4:c1beacfc42c7 83 int printf(const char *format, ...);
MikamiUitOpen 4:c1beacfc42c7 84 };
MikamiUitOpen 4:c1beacfc42c7 85
MikamiUitOpen 4:c1beacfc42c7 86 } // namespace mbed
MikamiUitOpen 4:c1beacfc42c7 87
MikamiUitOpen 4:c1beacfc42c7 88 #endif
MikamiUitOpen 4:c1beacfc42c7 89
MikamiUitOpen 4:c1beacfc42c7 90 #endif