Mark Chen / NU480_UART_9BIT
Committer:
mark.chen@ebn.com.tw
Date:
Wed Aug 21 16:27:30 2019 +0800
Revision:
6:64f5dad70ee2
Parent:
2:bcc987331b8a
Child:
7:af4ceb878eee
Uplaod code 2019/08/21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mark.chen@ebn.com.tw 2:bcc987331b8a 1 /* mbed Microcontroller Library
mark.chen@ebn.com.tw 2:bcc987331b8a 2 * Copyright (c) 2015-2016 Nuvoton
mark.chen@ebn.com.tw 2:bcc987331b8a 3 *
mark.chen@ebn.com.tw 2:bcc987331b8a 4 * Licensed under the Apache License, Version 2.0 (the "License");
mark.chen@ebn.com.tw 2:bcc987331b8a 5 * you may not use this file except in compliance with the License.
mark.chen@ebn.com.tw 2:bcc987331b8a 6 * You may obtain a copy of the License at
mark.chen@ebn.com.tw 2:bcc987331b8a 7 *
mark.chen@ebn.com.tw 2:bcc987331b8a 8 * http://www.apache.org/licenses/LICENSE-2.0
mark.chen@ebn.com.tw 2:bcc987331b8a 9 *
mark.chen@ebn.com.tw 2:bcc987331b8a 10 * Unless required by applicable law or agreed to in writing, software
mark.chen@ebn.com.tw 2:bcc987331b8a 11 * distributed under the License is distributed on an "AS IS" BASIS,
mark.chen@ebn.com.tw 2:bcc987331b8a 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mark.chen@ebn.com.tw 2:bcc987331b8a 13 * See the License for the specific language governing permissions and
mark.chen@ebn.com.tw 2:bcc987331b8a 14 * limitations under the License.
mark.chen@ebn.com.tw 2:bcc987331b8a 15 */
mark.chen@ebn.com.tw 2:bcc987331b8a 16
mark.chen@ebn.com.tw 2:bcc987331b8a 17
mark.chen@ebn.com.tw 2:bcc987331b8a 18 #include "serial_api.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 19
mark.chen@ebn.com.tw 2:bcc987331b8a 20
mark.chen@ebn.com.tw 2:bcc987331b8a 21 #include "cmsis.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 22 #include "mbed_error.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 23 #include "mbed_assert.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 24 #include "PeripheralPins.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 25 #include "nu_modutil.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 26 #include "nu_bitutil.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 27 #include <string.h>
mark.chen@ebn.com.tw 2:bcc987331b8a 28 #include <stdbool.h>
mark.chen@ebn.com.tw 2:bcc987331b8a 29
mark.chen@ebn.com.tw 2:bcc987331b8a 30 #if DEVICE_SERIAL_ASYNCH
mark.chen@ebn.com.tw 2:bcc987331b8a 31 #include "dma_api.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 32 #include "dma.h"
mark.chen@ebn.com.tw 2:bcc987331b8a 33
mark.chen@ebn.com.tw 2:bcc987331b8a 34 #define UART_PARITY_BY_UART_DATTBIT9 (0x11ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to keep parity bit as '0' \hideinitializer */
mark.chen@ebn.com.tw 2:bcc987331b8a 35
mark.chen@ebn.com.tw 2:bcc987331b8a 36
mark.chen@ebn.com.tw 2:bcc987331b8a 37 #ifdef __cplusplus
mark.chen@ebn.com.tw 2:bcc987331b8a 38 extern "C" {
mark.chen@ebn.com.tw 2:bcc987331b8a 39 #endif
mark.chen@ebn.com.tw 2:bcc987331b8a 40
mark.chen@ebn.com.tw 2:bcc987331b8a 41 void serial_format_9bit(serial_t *obj, int data_bits, SerialParity parity, int stop_bits);
mark.chen@ebn.com.tw 6:64f5dad70ee2 42 int serial_tx_asynch9bit(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint);
mark.chen@ebn.com.tw 6:64f5dad70ee2 43 void serial_rx_asynch9bit(serial_t *obj, void *rx, size_t rx_length, uint8_t rx_width, uint32_t handler, uint32_t event, uint8_t char_match, DMAUsage hint);
mark.chen@ebn.com.tw 6:64f5dad70ee2 44
mark.chen@ebn.com.tw 6:64f5dad70ee2 45
mark.chen@ebn.com.tw 6:64f5dad70ee2 46
mark.chen@ebn.com.tw 2:bcc987331b8a 47
mark.chen@ebn.com.tw 2:bcc987331b8a 48
mark.chen@ebn.com.tw 2:bcc987331b8a 49
mark.chen@ebn.com.tw 2:bcc987331b8a 50
mark.chen@ebn.com.tw 2:bcc987331b8a 51 #ifdef __cplusplus
mark.chen@ebn.com.tw 2:bcc987331b8a 52 }
mark.chen@ebn.com.tw 2:bcc987331b8a 53 #endif
mark.chen@ebn.com.tw 2:bcc987331b8a 54
mark.chen@ebn.com.tw 2:bcc987331b8a 55
mark.chen@ebn.com.tw 2:bcc987331b8a 56 #endif