Emilio Monti / mbed-KL25Z

Dependents:   FRDM_RGBLED

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PeripheralNames.h Source File

PeripheralNames.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2006-2013 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #ifndef MBED_PERIPHERALNAMES_H
00017 #define MBED_PERIPHERALNAMES_H
00018 
00019 #include "cmsis.h"
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 typedef enum {
00026     UART_0 = (int)UART0_BASE,
00027     UART_1 = (int)UART1_BASE,
00028     UART_2 = (int)UART2_BASE
00029 } UARTName;
00030 #define STDIO_UART_TX     USBTX
00031 #define STDIO_UART_RX     USBRX
00032 #define STDIO_UART        UART_0
00033 
00034 typedef enum {
00035     I2C_0 = (int)I2C0_BASE,
00036     I2C_1 = (int)I2C1_BASE,
00037 } I2CName;
00038 
00039 #define TPM_SHIFT   8
00040 typedef enum {
00041     PWM_1  = (0 << TPM_SHIFT) | (0),  // TPM0 CH0
00042     PWM_2  = (0 << TPM_SHIFT) | (1),  // TPM0 CH1
00043     PWM_3  = (0 << TPM_SHIFT) | (2),  // TPM0 CH2
00044     PWM_4  = (0 << TPM_SHIFT) | (3),  // TPM0 CH3
00045     PWM_5  = (0 << TPM_SHIFT) | (4),  // TPM0 CH4
00046     PWM_6  = (0 << TPM_SHIFT) | (5),  // TPM0 CH5
00047 
00048     PWM_7  = (1 << TPM_SHIFT) | (0),  // TPM1 CH0
00049     PWM_8  = (1 << TPM_SHIFT) | (1),  // TPM1 CH1
00050 
00051     PWM_9  = (2 << TPM_SHIFT) | (0),  // TPM2 CH0
00052     PWM_10 = (2 << TPM_SHIFT) | (1)   // TPM2 CH1
00053 } PWMName;
00054 
00055 typedef enum {
00056     ADC0_SE0  =  0,
00057     ADC0_SE3  =  3,
00058     ADC0_SE4b =  4,
00059     ADC0_SE5b =  5,
00060     ADC0_SE6b =  6,
00061     ADC0_SE7b =  7,
00062     ADC0_SE8  =  8,
00063     ADC0_SE9  =  9,
00064     ADC0_SE11 = 11,
00065     ADC0_SE12 = 12,
00066     ADC0_SE13 = 13,
00067     ADC0_SE14 = 14,
00068     ADC0_SE15 = 15,
00069     ADC0_SE23 = 23
00070 } ADCName;
00071 
00072 typedef enum {
00073     DAC_0 = 0
00074 } DACName;
00075 
00076 
00077 typedef enum {
00078     SPI_0 = (int)SPI0_BASE,
00079     SPI_1 = (int)SPI1_BASE,
00080 } SPIName;
00081 
00082 #ifdef __cplusplus
00083 }
00084 #endif
00085 
00086 #endif