mbed-os

Fork of mbed-os by erkin yucel

Committer:
xuaner
Date:
Thu Jul 20 14:26:57 2017 +0000
Revision:
1:3deb71413561
Parent:
0:f269e3021894
mbed_os

Who changed what in which revision?

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