mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Fri Aug 12 13:04:35 2016 +0200
Revision:
123:b0220dba8be7
Parent:
122:f9eeca106725
Child:
127:25aea2a3f4e3
Release 123 of the mbed library

Changes:
- new targets: nucleo_f207zg, beetle, nrf51_dk, hexiwear,
nuvoton nuc472, vk rz a1h
- ST - fix timer interrupt handler, sleep api fix
- NXP - lpc15xx us ticker fix
- Nordic - analogin fixes, LF clock init addition, enable i2c async

Who changed what in which revision?

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