mbed(SerialHalfDuplex入り)

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Wed Mar 19 18:28:32 2014 +0000
Revision:
81:7d30d6019079
Parent:
79:0c05e21ae27e
Release 81 of the mbed library

Main changes:

- Updates and fixes for many targets
- LPC1768: serial interface code fixes
- nRF51822 targets now output a .hex file
- More exporters
- More flexible GPIO API

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 79:0c05e21ae27e 1 /* mbed Microcontroller Library
emilmont 79:0c05e21ae27e 2 * Copyright (c) 2006-2014 ARM Limited
emilmont 79:0c05e21ae27e 3 *
emilmont 79:0c05e21ae27e 4 * Licensed under the Apache License, Version 2.0 (the "License");
emilmont 79:0c05e21ae27e 5 * you may not use this file except in compliance with the License.
emilmont 79:0c05e21ae27e 6 * You may obtain a copy of the License at
emilmont 79:0c05e21ae27e 7 *
emilmont 79:0c05e21ae27e 8 * http://www.apache.org/licenses/LICENSE-2.0
emilmont 79:0c05e21ae27e 9 *
emilmont 79:0c05e21ae27e 10 * Unless required by applicable law or agreed to in writing, software
emilmont 79:0c05e21ae27e 11 * distributed under the License is distributed on an "AS IS" BASIS,
emilmont 79:0c05e21ae27e 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
emilmont 79:0c05e21ae27e 13 * See the License for the specific language governing permissions and
emilmont 79:0c05e21ae27e 14 * limitations under the License.
emilmont 79:0c05e21ae27e 15 */
emilmont 79:0c05e21ae27e 16 #ifndef MBED_PINNAMES_H
emilmont 79:0c05e21ae27e 17 #define MBED_PINNAMES_H
emilmont 79:0c05e21ae27e 18
emilmont 79:0c05e21ae27e 19 #include "cmsis.h"
emilmont 79:0c05e21ae27e 20
emilmont 79:0c05e21ae27e 21 #ifdef __cplusplus
emilmont 79:0c05e21ae27e 22 extern "C" {
emilmont 79:0c05e21ae27e 23 #endif
emilmont 79:0c05e21ae27e 24
emilmont 79:0c05e21ae27e 25 typedef enum {
emilmont 79:0c05e21ae27e 26 PIN_INPUT,
emilmont 79:0c05e21ae27e 27 PIN_OUTPUT
emilmont 79:0c05e21ae27e 28 } PinDirection;
emilmont 79:0c05e21ae27e 29
emilmont 79:0c05e21ae27e 30 typedef enum {
emilmont 79:0c05e21ae27e 31 // LPC Pin Names
emilmont 79:0c05e21ae27e 32 P0_0 = 0,
emilmont 79:0c05e21ae27e 33 P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15, P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23, P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31,
emilmont 79:0c05e21ae27e 34 P1_0, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15, P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23, P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31,
emilmont 79:0c05e21ae27e 35 P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, P2_8, P2_9, P2_10, P2_11, P2_12,
emilmont 79:0c05e21ae27e 36
emilmont 79:0c05e21ae27e 37 LED_RED = P0_25,
emilmont 79:0c05e21ae27e 38 LED_GREEN = P0_3,
emilmont 79:0c05e21ae27e 39 LED_BLUE = P1_1,
emilmont 79:0c05e21ae27e 40
emilmont 79:0c05e21ae27e 41 // mbed original LED naming
emilmont 79:0c05e21ae27e 42 LED1 = LED_BLUE,
emilmont 79:0c05e21ae27e 43 LED2 = LED_GREEN,
emilmont 79:0c05e21ae27e 44 LED3 = LED_RED,
emilmont 79:0c05e21ae27e 45 LED4 = LED_RED,
emilmont 79:0c05e21ae27e 46
emilmont 79:0c05e21ae27e 47 // Serial to USB pins
emilmont 79:0c05e21ae27e 48 USBTX = P0_18,
emilmont 79:0c05e21ae27e 49 USBRX = P0_13,
emilmont 79:0c05e21ae27e 50
emilmont 79:0c05e21ae27e 51 // Arduino Shield Receptacles Names
emilmont 79:0c05e21ae27e 52 D0 = P0_13,
emilmont 79:0c05e21ae27e 53 D1 = P0_18,
emilmont 79:0c05e21ae27e 54 D2 = P0_29,
emilmont 79:0c05e21ae27e 55 D3 = P0_9,
emilmont 79:0c05e21ae27e 56 D4 = P0_10,
emilmont 79:0c05e21ae27e 57 D5 = P0_16, // same port as D13
emilmont 79:0c05e21ae27e 58 D6 = P1_3,
emilmont 79:0c05e21ae27e 59 D7 = P0_0,
emilmont 79:0c05e21ae27e 60 D8 = P0_24,
emilmont 79:0c05e21ae27e 61 D9 = P1_0,
emilmont 79:0c05e21ae27e 62 D10= P0_27,
emilmont 79:0c05e21ae27e 63 D11= P0_28,
emilmont 79:0c05e21ae27e 64 D12= P0_12,
emilmont 79:0c05e21ae27e 65 D13= P0_16, // same port as D5
emilmont 79:0c05e21ae27e 66 A0 = P0_8,
emilmont 79:0c05e21ae27e 67 A1 = P0_7,
emilmont 79:0c05e21ae27e 68 A2 = P0_6,
emilmont 79:0c05e21ae27e 69 A3 = P0_5,
emilmont 79:0c05e21ae27e 70 A4 = P0_23, // same port as SDA
emilmont 79:0c05e21ae27e 71 A5 = P0_22, // same port as SCL
emilmont 79:0c05e21ae27e 72 SDA= P0_23, // same port as A4
emilmont 79:0c05e21ae27e 73 SCL= P0_22, // same port as A5
emilmont 79:0c05e21ae27e 74
emilmont 79:0c05e21ae27e 75 // Not connected
emilmont 79:0c05e21ae27e 76 NC = (int)0xFFFFFFFF,
emilmont 79:0c05e21ae27e 77 } PinName;
emilmont 79:0c05e21ae27e 78
emilmont 79:0c05e21ae27e 79 typedef enum {
emilmont 79:0c05e21ae27e 80 PullUp = 2,
emilmont 79:0c05e21ae27e 81 PullDown = 1,
emilmont 79:0c05e21ae27e 82 PullNone = 0,
emilmont 79:0c05e21ae27e 83 Repeater = 3,
bogdanm 81:7d30d6019079 84 OpenDrain = 4,
bogdanm 81:7d30d6019079 85 PullDefault = PullDown
emilmont 79:0c05e21ae27e 86 } PinMode;
emilmont 79:0c05e21ae27e 87
emilmont 79:0c05e21ae27e 88 #define STDIO_UART_TX USBTX
emilmont 79:0c05e21ae27e 89 #define STDIO_UART_RX USBRX
emilmont 79:0c05e21ae27e 90
emilmont 79:0c05e21ae27e 91 typedef struct {
emilmont 79:0c05e21ae27e 92 unsigned char n;
emilmont 79:0c05e21ae27e 93 unsigned char offset;
emilmont 79:0c05e21ae27e 94 } SWM_Map;
emilmont 79:0c05e21ae27e 95
emilmont 79:0c05e21ae27e 96 #ifdef __cplusplus
emilmont 79:0c05e21ae27e 97 }
emilmont 79:0c05e21ae27e 98 #endif
emilmont 79:0c05e21ae27e 99
emilmont 79:0c05e21ae27e 100 #endif