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