mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Wed May 27 08:07:35 2015 +0100
Revision:
100:cbbeb26dbd92
Parent:
97:433970e64889
Child:
120:7c328cabac7e
Release 100 of the mbed library

Changes:
- new target: DISCOF334C8
- API: Ticker/Timer bugfix with constness
- Silabs: RTC, PWM, Serial clocks bufixes
- Renesas: i2c bugfix
- Maxim: 326000 - pin definitions for v2, spi freq fix

Who changed what in which revision?

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