mbed library sources. Supersedes mbed-src. removed serial

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Thu Feb 02 17:01:33 2017 +0000
Revision:
157:ff67d9f36b67
This updates the lib to the mbed lib v135

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 157:ff67d9f36b67 1 /*******************************************************************************
<> 157:ff67d9f36b67 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
<> 157:ff67d9f36b67 3 *
<> 157:ff67d9f36b67 4 * Permission is hereby granted, free of charge, to any person obtaining a
<> 157:ff67d9f36b67 5 * copy of this software and associated documentation files (the "Software"),
<> 157:ff67d9f36b67 6 * to deal in the Software without restriction, including without limitation
<> 157:ff67d9f36b67 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
<> 157:ff67d9f36b67 8 * and/or sell copies of the Software, and to permit persons to whom the
<> 157:ff67d9f36b67 9 * Software is furnished to do so, subject to the following conditions:
<> 157:ff67d9f36b67 10 *
<> 157:ff67d9f36b67 11 * The above copyright notice and this permission notice shall be included
<> 157:ff67d9f36b67 12 * in all copies or substantial portions of the Software.
<> 157:ff67d9f36b67 13 *
<> 157:ff67d9f36b67 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
<> 157:ff67d9f36b67 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
<> 157:ff67d9f36b67 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
<> 157:ff67d9f36b67 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
<> 157:ff67d9f36b67 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
<> 157:ff67d9f36b67 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
<> 157:ff67d9f36b67 20 * OTHER DEALINGS IN THE SOFTWARE.
<> 157:ff67d9f36b67 21 *
<> 157:ff67d9f36b67 22 * Except as contained in this notice, the name of Maxim Integrated
<> 157:ff67d9f36b67 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
<> 157:ff67d9f36b67 24 * Products, Inc. Branding Policy.
<> 157:ff67d9f36b67 25 *
<> 157:ff67d9f36b67 26 * The mere transfer of this software does not imply any licenses
<> 157:ff67d9f36b67 27 * of trade secrets, proprietary technology, copyrights, patents,
<> 157:ff67d9f36b67 28 * trademarks, maskwork rights, or any other form of intellectual
<> 157:ff67d9f36b67 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
<> 157:ff67d9f36b67 30 * ownership rights.
<> 157:ff67d9f36b67 31 *******************************************************************************
<> 157:ff67d9f36b67 32 */
<> 157:ff67d9f36b67 33
<> 157:ff67d9f36b67 34 #ifndef MBED_OBJECTS_H
<> 157:ff67d9f36b67 35 #define MBED_OBJECTS_H
<> 157:ff67d9f36b67 36
<> 157:ff67d9f36b67 37 #include "cmsis.h"
<> 157:ff67d9f36b67 38 #include "PortNames.h"
<> 157:ff67d9f36b67 39 #include "PeripheralNames.h"
<> 157:ff67d9f36b67 40 #include "PinNames.h"
<> 157:ff67d9f36b67 41 #include "gpio_object.h"
<> 157:ff67d9f36b67 42 #include "gpio_regs.h"
<> 157:ff67d9f36b67 43 #include "uart_regs.h"
<> 157:ff67d9f36b67 44 #include "i2cm_regs.h"
<> 157:ff67d9f36b67 45 #include "spim_regs.h"
<> 157:ff67d9f36b67 46 #include "pt_regs.h"
<> 157:ff67d9f36b67 47 #include "adc_regs.h"
<> 157:ff67d9f36b67 48 #include "uart.h"
<> 157:ff67d9f36b67 49 #include "adc.h"
<> 157:ff67d9f36b67 50
<> 157:ff67d9f36b67 51 #ifdef __cplusplus
<> 157:ff67d9f36b67 52 extern "C" {
<> 157:ff67d9f36b67 53 #endif
<> 157:ff67d9f36b67 54
<> 157:ff67d9f36b67 55 struct port_s {
<> 157:ff67d9f36b67 56 PortName port;
<> 157:ff67d9f36b67 57 uint32_t mask;
<> 157:ff67d9f36b67 58 __IO uint32_t *reg_out;
<> 157:ff67d9f36b67 59 __I uint32_t *reg_in;
<> 157:ff67d9f36b67 60 PinMode mode;
<> 157:ff67d9f36b67 61 };
<> 157:ff67d9f36b67 62
<> 157:ff67d9f36b67 63 struct gpio_irq_s {
<> 157:ff67d9f36b67 64 uint8_t port;
<> 157:ff67d9f36b67 65 uint8_t pin;
<> 157:ff67d9f36b67 66 uint8_t rise_en;
<> 157:ff67d9f36b67 67 uint8_t fall_en;
<> 157:ff67d9f36b67 68 uint32_t id;
<> 157:ff67d9f36b67 69 };
<> 157:ff67d9f36b67 70
<> 157:ff67d9f36b67 71 struct serial_s {
<> 157:ff67d9f36b67 72 int index;
<> 157:ff67d9f36b67 73 mxc_uart_regs_t *uart;
<> 157:ff67d9f36b67 74 mxc_uart_fifo_regs_t *fifo;
<> 157:ff67d9f36b67 75 uint32_t id;
<> 157:ff67d9f36b67 76 uart_cfg_t cfg;
<> 157:ff67d9f36b67 77 sys_cfg_uart_t sys_cfg;
<> 157:ff67d9f36b67 78 PinName tx;
<> 157:ff67d9f36b67 79 PinName rx;
<> 157:ff67d9f36b67 80 };
<> 157:ff67d9f36b67 81
<> 157:ff67d9f36b67 82 struct i2c_s {
<> 157:ff67d9f36b67 83 mxc_i2cm_regs_t *i2c;
<> 157:ff67d9f36b67 84 mxc_i2cm_fifo_regs_t *fifo;
<> 157:ff67d9f36b67 85 int start_pending;
<> 157:ff67d9f36b67 86 sys_cfg_i2cm_t sys_cfg;
<> 157:ff67d9f36b67 87 };
<> 157:ff67d9f36b67 88
<> 157:ff67d9f36b67 89 struct spi_s {
<> 157:ff67d9f36b67 90 int index;
<> 157:ff67d9f36b67 91 mxc_spim_regs_t *spi;
<> 157:ff67d9f36b67 92 };
<> 157:ff67d9f36b67 93
<> 157:ff67d9f36b67 94 struct pwmout_s {
<> 157:ff67d9f36b67 95 mxc_pt_regs_t *pwm;
<> 157:ff67d9f36b67 96 int period;
<> 157:ff67d9f36b67 97 int pulse_width;
<> 157:ff67d9f36b67 98 };
<> 157:ff67d9f36b67 99
<> 157:ff67d9f36b67 100 struct analogin_s {
<> 157:ff67d9f36b67 101 mxc_adc_regs_t *adc;
<> 157:ff67d9f36b67 102 mxc_adc_chsel_t channel;
<> 157:ff67d9f36b67 103 };
<> 157:ff67d9f36b67 104
<> 157:ff67d9f36b67 105 typedef struct {
<> 157:ff67d9f36b67 106 volatile uint32_t *reg_req;
<> 157:ff67d9f36b67 107 volatile uint32_t *reg_ack;
<> 157:ff67d9f36b67 108 uint32_t req_val;
<> 157:ff67d9f36b67 109 uint32_t ack_mask;
<> 157:ff67d9f36b67 110 } pin_function_t;
<> 157:ff67d9f36b67 111
<> 157:ff67d9f36b67 112 #ifdef __cplusplus
<> 157:ff67d9f36b67 113 }
<> 157:ff67d9f36b67 114 #endif
<> 157:ff67d9f36b67 115
<> 157:ff67d9f36b67 116 #endif