USB Serial application

Fork of USBSerial_HelloWorld by Samuel Mokrani

Committer:
Zaitsev
Date:
Tue Jan 10 20:42:26 2017 +0000
Revision:
10:41552d038a69
USB Serial bi-directional bridge

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Zaitsev 10:41552d038a69 1 /* mbed Microcontroller Library
Zaitsev 10:41552d038a69 2 *******************************************************************************
Zaitsev 10:41552d038a69 3 * Copyright (c) 2015 WIZnet Co.,Ltd. All rights reserved.
Zaitsev 10:41552d038a69 4 * All rights reserved.
Zaitsev 10:41552d038a69 5 *
Zaitsev 10:41552d038a69 6 * Redistribution and use in source and binary forms, with or without
Zaitsev 10:41552d038a69 7 * modification, are permitted provided that the following conditions are met:
Zaitsev 10:41552d038a69 8 *
Zaitsev 10:41552d038a69 9 * 1. Redistributions of source code must retain the above copyright notice,
Zaitsev 10:41552d038a69 10 * this list of conditions and the following disclaimer.
Zaitsev 10:41552d038a69 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
Zaitsev 10:41552d038a69 12 * this list of conditions and the following disclaimer in the documentation
Zaitsev 10:41552d038a69 13 * and/or other materials provided with the distribution.
Zaitsev 10:41552d038a69 14 * 3. Neither the name of ARM Limited nor the names of its contributors
Zaitsev 10:41552d038a69 15 * may be used to endorse or promote products derived from this software
Zaitsev 10:41552d038a69 16 * without specific prior written permission.
Zaitsev 10:41552d038a69 17 *
Zaitsev 10:41552d038a69 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Zaitsev 10:41552d038a69 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Zaitsev 10:41552d038a69 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Zaitsev 10:41552d038a69 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Zaitsev 10:41552d038a69 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Zaitsev 10:41552d038a69 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Zaitsev 10:41552d038a69 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Zaitsev 10:41552d038a69 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Zaitsev 10:41552d038a69 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Zaitsev 10:41552d038a69 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Zaitsev 10:41552d038a69 28 *******************************************************************************
Zaitsev 10:41552d038a69 29 */
Zaitsev 10:41552d038a69 30
Zaitsev 10:41552d038a69 31 #ifndef MBED_OBJECTS_H
Zaitsev 10:41552d038a69 32 #define MBED_OBJECTS_H
Zaitsev 10:41552d038a69 33
Zaitsev 10:41552d038a69 34 #include "cmsis.h"
Zaitsev 10:41552d038a69 35 #include "PortNames.h"
Zaitsev 10:41552d038a69 36 #include "PeripheralNames.h"
Zaitsev 10:41552d038a69 37 #include "PinNames.h"
Zaitsev 10:41552d038a69 38 #include "PortNames.h"
Zaitsev 10:41552d038a69 39
Zaitsev 10:41552d038a69 40 #ifdef __cplusplus
Zaitsev 10:41552d038a69 41 extern "C" {
Zaitsev 10:41552d038a69 42 #endif
Zaitsev 10:41552d038a69 43
Zaitsev 10:41552d038a69 44 struct gpio_irq_s {
Zaitsev 10:41552d038a69 45 IRQn_Type irq_n;
Zaitsev 10:41552d038a69 46 uint32_t event;
Zaitsev 10:41552d038a69 47 PinName pin;
Zaitsev 10:41552d038a69 48 uint32_t pin_index;
Zaitsev 10:41552d038a69 49 uint32_t pin_num;
Zaitsev 10:41552d038a69 50 uint32_t port_num;
Zaitsev 10:41552d038a69 51 uint32_t rise_null;
Zaitsev 10:41552d038a69 52 uint32_t fall_null;
Zaitsev 10:41552d038a69 53 };
Zaitsev 10:41552d038a69 54
Zaitsev 10:41552d038a69 55 struct port_s {
Zaitsev 10:41552d038a69 56 PortName port;
Zaitsev 10:41552d038a69 57 uint32_t mask;
Zaitsev 10:41552d038a69 58 PinDirection direction;
Zaitsev 10:41552d038a69 59 __IO uint32_t *reg_in;
Zaitsev 10:41552d038a69 60 __IO uint32_t *reg_out;
Zaitsev 10:41552d038a69 61 };
Zaitsev 10:41552d038a69 62
Zaitsev 10:41552d038a69 63 struct analogin_s {
Zaitsev 10:41552d038a69 64 ADCName adc;
Zaitsev 10:41552d038a69 65 PinName pin;
Zaitsev 10:41552d038a69 66 };
Zaitsev 10:41552d038a69 67
Zaitsev 10:41552d038a69 68 struct serial_s {
Zaitsev 10:41552d038a69 69 UARTName uart;
Zaitsev 10:41552d038a69 70 int index; // Used by irq
Zaitsev 10:41552d038a69 71 uint32_t baudrate;
Zaitsev 10:41552d038a69 72 uint32_t databits;
Zaitsev 10:41552d038a69 73 uint32_t stopbits;
Zaitsev 10:41552d038a69 74 uint32_t parity;
Zaitsev 10:41552d038a69 75 PinName pin_tx;
Zaitsev 10:41552d038a69 76 PinName pin_rx;
Zaitsev 10:41552d038a69 77 };
Zaitsev 10:41552d038a69 78
Zaitsev 10:41552d038a69 79 struct spi_s {
Zaitsev 10:41552d038a69 80 SSP_TypeDef *spi;
Zaitsev 10:41552d038a69 81 };
Zaitsev 10:41552d038a69 82
Zaitsev 10:41552d038a69 83 struct i2c_s {
Zaitsev 10:41552d038a69 84 I2CName I2Cx;
Zaitsev 10:41552d038a69 85 PinName sda;
Zaitsev 10:41552d038a69 86 PinName scl;
Zaitsev 10:41552d038a69 87 uint16_t ADDRESS;
Zaitsev 10:41552d038a69 88 uint16_t is_setAddress;
Zaitsev 10:41552d038a69 89 };
Zaitsev 10:41552d038a69 90
Zaitsev 10:41552d038a69 91 struct pwmout_s {
Zaitsev 10:41552d038a69 92 PWM_CHn_TypeDef * PWM_CHx;
Zaitsev 10:41552d038a69 93 PinName pin;
Zaitsev 10:41552d038a69 94 uint32_t period;
Zaitsev 10:41552d038a69 95 uint32_t pulse;
Zaitsev 10:41552d038a69 96 uint32_t PrescalerValue;
Zaitsev 10:41552d038a69 97 };
Zaitsev 10:41552d038a69 98
Zaitsev 10:41552d038a69 99 #include "gpio_object.h"
Zaitsev 10:41552d038a69 100
Zaitsev 10:41552d038a69 101 #ifdef __cplusplus
Zaitsev 10:41552d038a69 102 }
Zaitsev 10:41552d038a69 103 #endif
Zaitsev 10:41552d038a69 104
Zaitsev 10:41552d038a69 105 #endif