mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Fri Feb 16 16:09:33 2018 +0000
Revision:
181:57724642e740
Parent:
172:7d866c31b3c5
mbed-dev library. Release version 159.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 172:7d866c31b3c5 1 /* mbed Microcontroller Library
AnnaBridge 172:7d866c31b3c5 2 * (C)Copyright TOSHIBA ELECTRONIC DEVICES & STORAGE CORPORATION 2017 All rights reserved
AnnaBridge 172:7d866c31b3c5 3 *
AnnaBridge 172:7d866c31b3c5 4 * Licensed under the Apache License, Version 2.0 (the "License");
AnnaBridge 172:7d866c31b3c5 5 * you may not use this file except in compliance with the License.
AnnaBridge 172:7d866c31b3c5 6 * You may obtain a copy of the License at
AnnaBridge 172:7d866c31b3c5 7 *
AnnaBridge 172:7d866c31b3c5 8 * http://www.apache.org/licenses/LICENSE-2.0
AnnaBridge 172:7d866c31b3c5 9 *
AnnaBridge 172:7d866c31b3c5 10 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 172:7d866c31b3c5 11 * distributed under the License is distributed on an "AS IS" BASIS,
AnnaBridge 172:7d866c31b3c5 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 172:7d866c31b3c5 13 * See the License for the specific language governing permissions and
AnnaBridge 172:7d866c31b3c5 14 * limitations under the License.
AnnaBridge 172:7d866c31b3c5 15 */
AnnaBridge 172:7d866c31b3c5 16 #ifndef MBED_PINNAMES_H
AnnaBridge 172:7d866c31b3c5 17 #define MBED_PINNAMES_H
AnnaBridge 172:7d866c31b3c5 18
AnnaBridge 172:7d866c31b3c5 19 #include "cmsis.h"
AnnaBridge 172:7d866c31b3c5 20
AnnaBridge 172:7d866c31b3c5 21 #ifdef __cplusplus
AnnaBridge 172:7d866c31b3c5 22 extern "C" {
AnnaBridge 172:7d866c31b3c5 23 #endif
AnnaBridge 172:7d866c31b3c5 24
AnnaBridge 172:7d866c31b3c5 25 #define PIN_PORT(X) (((uint32_t)(X) >> 3) & 0xF)
AnnaBridge 172:7d866c31b3c5 26 #define PIN_POS(X) ((uint32_t)(X) & 0x7)
AnnaBridge 172:7d866c31b3c5 27
AnnaBridge 172:7d866c31b3c5 28 // Pin data, bit 31..16: Pin Function, bit 15..0: Pin Direction
AnnaBridge 172:7d866c31b3c5 29 #define PIN_DATA(FUNC, DIR) (int)(((FUNC) << 16) | ((DIR) << 0))
AnnaBridge 172:7d866c31b3c5 30 #define PIN_FUNC(X) (((X) & 0xffff0000) >> 16)
AnnaBridge 172:7d866c31b3c5 31 #define PIN_DIR(X) ((X) & 0xffff)
AnnaBridge 172:7d866c31b3c5 32
AnnaBridge 172:7d866c31b3c5 33 typedef enum {
AnnaBridge 172:7d866c31b3c5 34 PIN_INPUT,
AnnaBridge 172:7d866c31b3c5 35 PIN_OUTPUT,
AnnaBridge 172:7d866c31b3c5 36 PIN_INOUT
AnnaBridge 172:7d866c31b3c5 37 } PinDirection;
AnnaBridge 172:7d866c31b3c5 38
AnnaBridge 172:7d866c31b3c5 39 typedef enum {
AnnaBridge 172:7d866c31b3c5 40 // TMPM066 Pin Names
AnnaBridge 172:7d866c31b3c5 41 PA0 = 0 << 3, PA1, PA2, PA3, PA4, PA5, PA6, PA7,
AnnaBridge 172:7d866c31b3c5 42 PB0 = 1 << 3, PB1, PB2, PB3,
AnnaBridge 172:7d866c31b3c5 43 PC0 = 2 << 3, PC1, PC2, PC3, PC4, PC5,
AnnaBridge 172:7d866c31b3c5 44 PD0 = 3 << 3, PD1, PD2, PD3, PD4, PD5,
AnnaBridge 172:7d866c31b3c5 45 PE0 = 4 << 3, PE1, PE2, PE3, PE4, PE5,
AnnaBridge 172:7d866c31b3c5 46 PF0 = 5 << 3, PF1, PF2, PF3, PF4, PF5, PF6, PF7,
AnnaBridge 172:7d866c31b3c5 47 PG0 = 6 << 3, PG1,
AnnaBridge 172:7d866c31b3c5 48 PH0 = 7 << 3, PH1, PH2, PH3,
AnnaBridge 172:7d866c31b3c5 49 PJ0 = 8 << 3, PJ1, PJ2, PJ3,
AnnaBridge 172:7d866c31b3c5 50
AnnaBridge 172:7d866c31b3c5 51 // Other mbed Pin Names
AnnaBridge 172:7d866c31b3c5 52 LED1 = PB0,
AnnaBridge 172:7d866c31b3c5 53 LED2 = PB1,
AnnaBridge 172:7d866c31b3c5 54 LED3 = LED1,
AnnaBridge 172:7d866c31b3c5 55 LED4 = LED2,
AnnaBridge 172:7d866c31b3c5 56
AnnaBridge 172:7d866c31b3c5 57 // External data bus Pin Names
AnnaBridge 172:7d866c31b3c5 58 D0 = PE1,
AnnaBridge 172:7d866c31b3c5 59 D1 = PE2,
AnnaBridge 172:7d866c31b3c5 60 D2 = PE0,
AnnaBridge 172:7d866c31b3c5 61 D3 = PD1,
AnnaBridge 172:7d866c31b3c5 62 D4 = PJ1,
AnnaBridge 172:7d866c31b3c5 63 D5 = PD2,
AnnaBridge 172:7d866c31b3c5 64 D6 = PD3,
AnnaBridge 172:7d866c31b3c5 65 D7 = PJ2,
AnnaBridge 172:7d866c31b3c5 66 D8 = PJ3,
AnnaBridge 172:7d866c31b3c5 67 D9 = PF4,
AnnaBridge 172:7d866c31b3c5 68 D10 = PF0,
AnnaBridge 172:7d866c31b3c5 69 D11 = PF1,
AnnaBridge 172:7d866c31b3c5 70 D12 = PF2,
AnnaBridge 172:7d866c31b3c5 71 D13 = PF3,
AnnaBridge 172:7d866c31b3c5 72 D14 = PC1,
AnnaBridge 172:7d866c31b3c5 73 D15 = PC0,
AnnaBridge 172:7d866c31b3c5 74
AnnaBridge 172:7d866c31b3c5 75 // Analogue out pins
AnnaBridge 172:7d866c31b3c5 76 A0 = PA2,
AnnaBridge 172:7d866c31b3c5 77 A1 = PA3,
AnnaBridge 172:7d866c31b3c5 78 A2 = PA4,
AnnaBridge 172:7d866c31b3c5 79 A3 = PA5,
AnnaBridge 172:7d866c31b3c5 80 A4 = PA6,
AnnaBridge 172:7d866c31b3c5 81 A5 = PA7,
AnnaBridge 172:7d866c31b3c5 82
AnnaBridge 172:7d866c31b3c5 83 // DAP_UART
AnnaBridge 172:7d866c31b3c5 84 USBTX = PC2,
AnnaBridge 172:7d866c31b3c5 85 USBRX = PC3,
AnnaBridge 172:7d866c31b3c5 86 MBEDIF_TXD = USBTX,
AnnaBridge 172:7d866c31b3c5 87 MBEDIF_RXD = USBRX,
AnnaBridge 172:7d866c31b3c5 88
AnnaBridge 172:7d866c31b3c5 89 // Switches
AnnaBridge 172:7d866c31b3c5 90 SW1 = PB2,
AnnaBridge 172:7d866c31b3c5 91 SW2 = PB3,
AnnaBridge 172:7d866c31b3c5 92
AnnaBridge 172:7d866c31b3c5 93 // I2C pins
AnnaBridge 172:7d866c31b3c5 94 SDA = PC1,
AnnaBridge 172:7d866c31b3c5 95 SCL = PC0,
AnnaBridge 172:7d866c31b3c5 96 I2C_SDA = SDA,
AnnaBridge 172:7d866c31b3c5 97 I2C_SCL = SCL,
AnnaBridge 172:7d866c31b3c5 98
AnnaBridge 172:7d866c31b3c5 99 // Not connected
AnnaBridge 172:7d866c31b3c5 100 NC = (int)0xFFFFFFFF,
AnnaBridge 172:7d866c31b3c5 101 } PinName;
AnnaBridge 172:7d866c31b3c5 102
AnnaBridge 172:7d866c31b3c5 103 typedef enum {
AnnaBridge 172:7d866c31b3c5 104 PullUp = 0,
AnnaBridge 172:7d866c31b3c5 105 PullDown,
AnnaBridge 172:7d866c31b3c5 106 PullNone,
AnnaBridge 172:7d866c31b3c5 107 OpenDrain,
AnnaBridge 172:7d866c31b3c5 108 PullDefault = PullDown
AnnaBridge 172:7d866c31b3c5 109 } PinMode;
AnnaBridge 172:7d866c31b3c5 110
AnnaBridge 172:7d866c31b3c5 111 #ifdef __cplusplus
AnnaBridge 172:7d866c31b3c5 112 }
AnnaBridge 172:7d866c31b3c5 113 #endif
AnnaBridge 172:7d866c31b3c5 114
AnnaBridge 172:7d866c31b3c5 115 #endif