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:
Kojto
Date:
Wed Jul 19 16:46:19 2017 +0100
Revision:
147:a97add6d7e64
Parent:
82:6473597d706e
Release 147 of the mbed library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 82:6473597d706e 1 /* mbed Microcontroller Library
bogdanm 82:6473597d706e 2 * Copyright (c) 2006-2013 ARM Limited
bogdanm 82:6473597d706e 3 *
bogdanm 82:6473597d706e 4 * Licensed under the Apache License, Version 2.0 (the "License");
bogdanm 82:6473597d706e 5 * you may not use this file except in compliance with the License.
bogdanm 82:6473597d706e 6 * You may obtain a copy of the License at
bogdanm 82:6473597d706e 7 *
bogdanm 82:6473597d706e 8 * http://www.apache.org/licenses/LICENSE-2.0
bogdanm 82:6473597d706e 9 *
bogdanm 82:6473597d706e 10 * Unless required by applicable law or agreed to in writing, software
bogdanm 82:6473597d706e 11 * distributed under the License is distributed on an "AS IS" BASIS,
bogdanm 82:6473597d706e 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
bogdanm 82:6473597d706e 13 * See the License for the specific language governing permissions and
bogdanm 82:6473597d706e 14 * limitations under the License.
bogdanm 82:6473597d706e 15 */
bogdanm 82:6473597d706e 16 #ifndef MBED_PERIPHERALNAMES_H
bogdanm 82:6473597d706e 17 #define MBED_PERIPHERALNAMES_H
bogdanm 82:6473597d706e 18
bogdanm 82:6473597d706e 19 #include "cmsis.h"
bogdanm 82:6473597d706e 20
bogdanm 82:6473597d706e 21 #ifdef __cplusplus
bogdanm 82:6473597d706e 22 extern "C" {
bogdanm 82:6473597d706e 23 #endif
bogdanm 82:6473597d706e 24
bogdanm 82:6473597d706e 25 typedef enum {
bogdanm 82:6473597d706e 26 OSC32KCLK = 0,
bogdanm 82:6473597d706e 27 RTC_CLKIN = 2
bogdanm 82:6473597d706e 28 } RTCName;
bogdanm 82:6473597d706e 29
bogdanm 82:6473597d706e 30 typedef enum {
bogdanm 82:6473597d706e 31 UART_0 = (int)UART0_BASE
bogdanm 82:6473597d706e 32 } UARTName;
bogdanm 82:6473597d706e 33
bogdanm 82:6473597d706e 34 #define STDIO_UART_TX USBTX
bogdanm 82:6473597d706e 35 #define STDIO_UART_RX USBRX
bogdanm 82:6473597d706e 36 #define STDIO_UART UART_0
bogdanm 82:6473597d706e 37
bogdanm 82:6473597d706e 38 typedef enum {
bogdanm 82:6473597d706e 39 I2C_0 = (int)I2C0_BASE,
bogdanm 82:6473597d706e 40 I2C_1 = -1
bogdanm 82:6473597d706e 41 } I2CName;
bogdanm 82:6473597d706e 42
bogdanm 82:6473597d706e 43 typedef enum {
bogdanm 82:6473597d706e 44 ADC0_SE0 = 0,
bogdanm 82:6473597d706e 45 ADC0_SE1 = 1,
bogdanm 82:6473597d706e 46 ADC0_SE2 = 2,
bogdanm 82:6473597d706e 47 ADC0_SE3 = 3,
bogdanm 82:6473597d706e 48 ADC0_SE4 = 4,
bogdanm 82:6473597d706e 49 ADC0_SE5 = 5,
bogdanm 82:6473597d706e 50 ADC0_SE6 = 6,
bogdanm 82:6473597d706e 51 ADC0_SE7 = 7,
bogdanm 82:6473597d706e 52 ADC0_SE8 = 8,
bogdanm 82:6473597d706e 53 ADC0_SE9 = 9,
bogdanm 82:6473597d706e 54 ADC0_SE10 = 10,
bogdanm 82:6473597d706e 55 ADC0_SE11 = 11,
bogdanm 82:6473597d706e 56 ADC0_SE12 = 12,
bogdanm 82:6473597d706e 57 ADC0_SE13 = 13
bogdanm 82:6473597d706e 58 } ADCName;
bogdanm 82:6473597d706e 59
bogdanm 82:6473597d706e 60 typedef enum {
bogdanm 82:6473597d706e 61 DAC_0 = 0
bogdanm 82:6473597d706e 62 } DACName;
bogdanm 82:6473597d706e 63
bogdanm 82:6473597d706e 64 typedef enum {
bogdanm 82:6473597d706e 65 SPI_0 = (int)SPI0_BASE
bogdanm 82:6473597d706e 66 } SPIName;
bogdanm 82:6473597d706e 67
bogdanm 82:6473597d706e 68 #define TPM_SHIFT 8
bogdanm 82:6473597d706e 69 typedef enum {
bogdanm 82:6473597d706e 70 PWM_1 = (0 << TPM_SHIFT) | (0), // TPM0 CH0
bogdanm 82:6473597d706e 71 PWM_2 = (0 << TPM_SHIFT) | (1), // TPM0 CH1
bogdanm 82:6473597d706e 72 PWM_3 = (0 << TPM_SHIFT) | (2), // TPM0 CH2
bogdanm 82:6473597d706e 73 PWM_4 = (0 << TPM_SHIFT) | (3), // TPM0 CH3
bogdanm 82:6473597d706e 74 PWM_5 = (0 << TPM_SHIFT) | (4), // TPM0 CH4
bogdanm 82:6473597d706e 75 PWM_6 = (0 << TPM_SHIFT) | (5), // TPM0 CH5
bogdanm 82:6473597d706e 76
bogdanm 82:6473597d706e 77 PWM_7 = (1 << TPM_SHIFT) | (0), // TPM1 CH0
bogdanm 82:6473597d706e 78 PWM_8 = (1 << TPM_SHIFT) | (1), // TPM1 CH1
bogdanm 82:6473597d706e 79 } PWMName;
bogdanm 82:6473597d706e 80
bogdanm 82:6473597d706e 81 #ifdef __cplusplus
bogdanm 82:6473597d706e 82 }
bogdanm 82:6473597d706e 83 #endif
bogdanm 82:6473597d706e 84
bogdanm 82:6473597d706e 85 #endif