The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Feb 20 20:53:29 2019 +0000
Revision:
172:65be27845400
Parent:
171:3a7713b1edbc
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 101:7cff1c4259d7 1 /* mbed Microcontroller Library
Kojto 101:7cff1c4259d7 2 *******************************************************************************
Kojto 101:7cff1c4259d7 3 * Copyright (c) 2014, STMicroelectronics
Kojto 101:7cff1c4259d7 4 * All rights reserved.
Kojto 101:7cff1c4259d7 5 *
Kojto 101:7cff1c4259d7 6 * Redistribution and use in source and binary forms, with or without
Kojto 101:7cff1c4259d7 7 * modification, are permitted provided that the following conditions are met:
Kojto 101:7cff1c4259d7 8 *
Kojto 101:7cff1c4259d7 9 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 101:7cff1c4259d7 10 * this list of conditions and the following disclaimer.
Kojto 101:7cff1c4259d7 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 101:7cff1c4259d7 12 * this list of conditions and the following disclaimer in the documentation
Kojto 101:7cff1c4259d7 13 * and/or other materials provided with the distribution.
Kojto 101:7cff1c4259d7 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 101:7cff1c4259d7 15 * may be used to endorse or promote products derived from this software
Kojto 101:7cff1c4259d7 16 * without specific prior written permission.
Kojto 101:7cff1c4259d7 17 *
Kojto 101:7cff1c4259d7 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 101:7cff1c4259d7 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 101:7cff1c4259d7 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 101:7cff1c4259d7 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 101:7cff1c4259d7 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 101:7cff1c4259d7 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 101:7cff1c4259d7 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 101:7cff1c4259d7 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 101:7cff1c4259d7 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 101:7cff1c4259d7 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 101:7cff1c4259d7 28 *******************************************************************************
Kojto 101:7cff1c4259d7 29 */
Kojto 101:7cff1c4259d7 30 #ifndef MBED_PERIPHERALNAMES_H
Kojto 101:7cff1c4259d7 31 #define MBED_PERIPHERALNAMES_H
Kojto 101:7cff1c4259d7 32
Kojto 101:7cff1c4259d7 33 #include "cmsis.h"
Kojto 101:7cff1c4259d7 34
Kojto 101:7cff1c4259d7 35 #ifdef __cplusplus
Kojto 101:7cff1c4259d7 36 extern "C" {
Kojto 101:7cff1c4259d7 37 #endif
Kojto 101:7cff1c4259d7 38
Kojto 101:7cff1c4259d7 39 typedef enum {
Kojto 101:7cff1c4259d7 40 ADC_1 = (int)ADC1_BASE
Kojto 101:7cff1c4259d7 41 } ADCName;
Kojto 101:7cff1c4259d7 42
Kojto 101:7cff1c4259d7 43 typedef enum {
Kojto 101:7cff1c4259d7 44 UART_1 = (int)USART1_BASE,
Kojto 101:7cff1c4259d7 45 UART_2 = (int)USART2_BASE,
Kojto 101:7cff1c4259d7 46 UART_6 = (int)USART6_BASE
Kojto 101:7cff1c4259d7 47 } UARTName;
Kojto 101:7cff1c4259d7 48
Kojto 101:7cff1c4259d7 49 #define STDIO_UART_TX PB_6
Kojto 101:7cff1c4259d7 50 #define STDIO_UART_RX PB_7
Kojto 101:7cff1c4259d7 51 #define STDIO_UART UART_1
Kojto 101:7cff1c4259d7 52
Kojto 101:7cff1c4259d7 53 typedef enum {
Kojto 101:7cff1c4259d7 54 SPI_1 = (int)SPI1_BASE,
Kojto 101:7cff1c4259d7 55 SPI_2 = (int)SPI2_BASE,
Kojto 101:7cff1c4259d7 56 SPI_3 = (int)SPI3_BASE,
Kojto 101:7cff1c4259d7 57 SPI_4 = (int)SPI4_BASE,
Kojto 101:7cff1c4259d7 58 SPI_5 = (int)SPI5_BASE
Kojto 101:7cff1c4259d7 59 } SPIName;
Kojto 101:7cff1c4259d7 60
Kojto 101:7cff1c4259d7 61 typedef enum {
Kojto 101:7cff1c4259d7 62 I2C_1 = (int)I2C1_BASE,
Kojto 101:7cff1c4259d7 63 I2C_2 = (int)I2C2_BASE,
Kojto 101:7cff1c4259d7 64 I2C_3 = (int)I2C3_BASE
Kojto 101:7cff1c4259d7 65 } I2CName;
Kojto 101:7cff1c4259d7 66
Kojto 101:7cff1c4259d7 67 typedef enum {
Kojto 101:7cff1c4259d7 68 PWM_1 = (int)TIM1_BASE,
Kojto 101:7cff1c4259d7 69 PWM_2 = (int)TIM2_BASE,
Kojto 101:7cff1c4259d7 70 PWM_3 = (int)TIM3_BASE,
Kojto 101:7cff1c4259d7 71 PWM_4 = (int)TIM4_BASE,
Kojto 101:7cff1c4259d7 72 PWM_5 = (int)TIM5_BASE,
Kojto 101:7cff1c4259d7 73 PWM_9 = (int)TIM9_BASE,
Kojto 101:7cff1c4259d7 74 PWM_10 = (int)TIM10_BASE,
Kojto 101:7cff1c4259d7 75 PWM_11 = (int)TIM11_BASE
Kojto 101:7cff1c4259d7 76 } PWMName;
Kojto 101:7cff1c4259d7 77
Kojto 101:7cff1c4259d7 78 #ifdef __cplusplus
Kojto 101:7cff1c4259d7 79 }
Kojto 101:7cff1c4259d7 80 #endif
Kojto 101:7cff1c4259d7 81
Kojto 101:7cff1c4259d7 82 #endif