test

Committer:
elijahsj
Date:
Mon Nov 09 00:33:19 2020 -0500
Revision:
2:4364577b5ad8
Parent:
1:8a094db1347f
copied mbed library

Who changed what in which revision?

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