max32630fthr quad spi , unexpected spi behavior
FTHR_USB_serial/mbed-os/drivers/Serial.cpp@0:a35c40f49345, 2018-03-13 (annotated)
- Committer:
- boonshen
- Date:
- Tue Mar 13 21:12:00 2018 +0000
- Revision:
- 0:a35c40f49345
MAX32630FTHR QuadSPI test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
boonshen | 0:a35c40f49345 | 1 | /* mbed Microcontroller Library |
boonshen | 0:a35c40f49345 | 2 | * Copyright (c) 2006-2013 ARM Limited |
boonshen | 0:a35c40f49345 | 3 | * |
boonshen | 0:a35c40f49345 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
boonshen | 0:a35c40f49345 | 5 | * you may not use this file except in compliance with the License. |
boonshen | 0:a35c40f49345 | 6 | * You may obtain a copy of the License at |
boonshen | 0:a35c40f49345 | 7 | * |
boonshen | 0:a35c40f49345 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
boonshen | 0:a35c40f49345 | 9 | * |
boonshen | 0:a35c40f49345 | 10 | * Unless required by applicable law or agreed to in writing, software |
boonshen | 0:a35c40f49345 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
boonshen | 0:a35c40f49345 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
boonshen | 0:a35c40f49345 | 13 | * See the License for the specific language governing permissions and |
boonshen | 0:a35c40f49345 | 14 | * limitations under the License. |
boonshen | 0:a35c40f49345 | 15 | */ |
boonshen | 0:a35c40f49345 | 16 | #include "drivers/Serial.h" |
boonshen | 0:a35c40f49345 | 17 | #include "platform/mbed_wait_api.h" |
boonshen | 0:a35c40f49345 | 18 | |
boonshen | 0:a35c40f49345 | 19 | #if DEVICE_SERIAL |
boonshen | 0:a35c40f49345 | 20 | |
boonshen | 0:a35c40f49345 | 21 | namespace mbed { |
boonshen | 0:a35c40f49345 | 22 | |
boonshen | 0:a35c40f49345 | 23 | Serial::Serial(PinName tx, PinName rx, const char *name, int baud) : SerialBase(tx, rx, baud), Stream(name) { |
boonshen | 0:a35c40f49345 | 24 | } |
boonshen | 0:a35c40f49345 | 25 | |
boonshen | 0:a35c40f49345 | 26 | Serial::Serial(PinName tx, PinName rx, int baud): SerialBase(tx, rx, baud), Stream(NULL) { |
boonshen | 0:a35c40f49345 | 27 | } |
boonshen | 0:a35c40f49345 | 28 | |
boonshen | 0:a35c40f49345 | 29 | int Serial::_getc() { |
boonshen | 0:a35c40f49345 | 30 | // Mutex is already held |
boonshen | 0:a35c40f49345 | 31 | return _base_getc(); |
boonshen | 0:a35c40f49345 | 32 | } |
boonshen | 0:a35c40f49345 | 33 | |
boonshen | 0:a35c40f49345 | 34 | int Serial::_putc(int c) { |
boonshen | 0:a35c40f49345 | 35 | // Mutex is already held |
boonshen | 0:a35c40f49345 | 36 | return _base_putc(c); |
boonshen | 0:a35c40f49345 | 37 | } |
boonshen | 0:a35c40f49345 | 38 | |
boonshen | 0:a35c40f49345 | 39 | void Serial::lock() { |
boonshen | 0:a35c40f49345 | 40 | _mutex.lock(); |
boonshen | 0:a35c40f49345 | 41 | } |
boonshen | 0:a35c40f49345 | 42 | |
boonshen | 0:a35c40f49345 | 43 | void Serial::unlock() { |
boonshen | 0:a35c40f49345 | 44 | _mutex.unlock(); |
boonshen | 0:a35c40f49345 | 45 | } |
boonshen | 0:a35c40f49345 | 46 | |
boonshen | 0:a35c40f49345 | 47 | } // namespace mbed |
boonshen | 0:a35c40f49345 | 48 | |
boonshen | 0:a35c40f49345 | 49 | #endif |