mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Committer:
funshine
Date:
Sat Apr 08 17:03:55 2017 +0000
Revision:
162:16168a1438f3
Parent:
150:02e0a0aed4ec
add code to handle serial port rx error in uart_irq()

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 150:02e0a0aed4ec 1 /* mbed Microcontroller Library
<> 150:02e0a0aed4ec 2 * Copyright (c) 2016 u-blox
<> 150:02e0a0aed4ec 3 *
<> 150:02e0a0aed4ec 4 * Licensed under the Apache License, Version 2.0 (the "License");
<> 150:02e0a0aed4ec 5 * you may not use this file except in compliance with the License.
<> 150:02e0a0aed4ec 6 * You may obtain a copy of the License at
<> 150:02e0a0aed4ec 7 *
<> 150:02e0a0aed4ec 8 * http://www.apache.org/licenses/LICENSE-2.0
<> 150:02e0a0aed4ec 9 *
<> 150:02e0a0aed4ec 10 * Unless required by applicable law or agreed to in writing, software
<> 150:02e0a0aed4ec 11 * distributed under the License is distributed on an "AS IS" BASIS,
<> 150:02e0a0aed4ec 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<> 150:02e0a0aed4ec 13 * See the License for the specific language governing permissions and
<> 150:02e0a0aed4ec 14 * limitations under the License.
<> 150:02e0a0aed4ec 15 */
<> 150:02e0a0aed4ec 16
<> 150:02e0a0aed4ec 17 #ifndef MBED_OBJECTS_H
<> 150:02e0a0aed4ec 18 #define MBED_OBJECTS_H
<> 150:02e0a0aed4ec 19
<> 150:02e0a0aed4ec 20 #include "cmsis.h"
<> 150:02e0a0aed4ec 21 #include "PortNames.h"
<> 150:02e0a0aed4ec 22 #include "PeripheralNames.h"
<> 150:02e0a0aed4ec 23 #include "PinNames.h"
<> 150:02e0a0aed4ec 24 #include "stdbool.h"
<> 150:02e0a0aed4ec 25
<> 150:02e0a0aed4ec 26 #ifdef __cplusplus
<> 150:02e0a0aed4ec 27 extern "C" {
<> 150:02e0a0aed4ec 28 #endif
<> 150:02e0a0aed4ec 29
<> 150:02e0a0aed4ec 30 typedef enum {
<> 150:02e0a0aed4ec 31 IRQ_NOT_SET,
<> 150:02e0a0aed4ec 32 IRQ_ON,
<> 150:02e0a0aed4ec 33 IRQ_OFF
<> 150:02e0a0aed4ec 34 } irq_setting_t;
<> 150:02e0a0aed4ec 35
<> 150:02e0a0aed4ec 36 struct port_s {
<> 150:02e0a0aed4ec 37 __IO uint32_t *reg_dir;
<> 150:02e0a0aed4ec 38 __IO uint32_t *reg_out;
<> 150:02e0a0aed4ec 39 __IO uint32_t *reg_val;
<> 150:02e0a0aed4ec 40 __IO uint32_t *reg_drv;
<> 150:02e0a0aed4ec 41 PortName port;
<> 150:02e0a0aed4ec 42 uint32_t mask;
<> 150:02e0a0aed4ec 43 };
<> 150:02e0a0aed4ec 44
<> 150:02e0a0aed4ec 45 struct gpio_irq_s {
<> 150:02e0a0aed4ec 46 /* Don't bother with having a port number here as there's only one */
<> 150:02e0a0aed4ec 47 uint32_t ch; /* Corresponds to the interrupt pin */
<> 150:02e0a0aed4ec 48 };
<> 150:02e0a0aed4ec 49
<> 150:02e0a0aed4ec 50 struct serial_s {
<> 150:02e0a0aed4ec 51 SerialConfig config;
<> 150:02e0a0aed4ec 52 PinName rx_pin;
<> 150:02e0a0aed4ec 53 PinName tx_pin;
<> 150:02e0a0aed4ec 54 volatile uart_ctrl_t *reg_base;
<> 150:02e0a0aed4ec 55 uint8_t index;
<> 150:02e0a0aed4ec 56 uint32_t baud_rate;
<> 150:02e0a0aed4ec 57 bool format_set; /* If true then the struct that follows is populated */
<> 150:02e0a0aed4ec 58 struct {
<> 150:02e0a0aed4ec 59 uint8_t stop_bits;
<> 150:02e0a0aed4ec 60 uint8_t data_bits;
<> 150:02e0a0aed4ec 61 uint8_t parity;
<> 150:02e0a0aed4ec 62 } format;
<> 150:02e0a0aed4ec 63 irq_setting_t irq_rx_setting;
<> 150:02e0a0aed4ec 64 irq_setting_t irq_tx_setting;
<> 150:02e0a0aed4ec 65 };
<> 150:02e0a0aed4ec 66
<> 150:02e0a0aed4ec 67 #include "gpio_object.h"
<> 150:02e0a0aed4ec 68
<> 150:02e0a0aed4ec 69 #ifdef __cplusplus
<> 150:02e0a0aed4ec 70 }
<> 150:02e0a0aed4ec 71 #endif
<> 150:02e0a0aed4ec 72
<> 150:02e0a0aed4ec 73 #endif