BA / SerialCom

Fork of OmniWheels by Gustav Atmel

Committer:
gustavatmel
Date:
Tue May 01 15:47:08 2018 +0000
Revision:
1:9c5af431a1f1
sdf

Who changed what in which revision?

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