ads1115 only
Fork of mbed by
TARGET_NUCLEO_F103RB/PinNames.h@73:1efda918f0ba, 2013-12-09 (annotated)
- Committer:
- bogdanm
- Date:
- Mon Dec 09 18:43:03 2013 +0200
- Revision:
- 73:1efda918f0ba
- Child:
- 74:a842253909c9
Release 73 of the mbed library
Main changes:
- added support for KL46Z and NUCLEO_F103RB
- STM32 USB device support
- various bug fixes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 73:1efda918f0ba | 1 | /* mbed Microcontroller Library |
bogdanm | 73:1efda918f0ba | 2 | * Copyright (c) 2006-2013 ARM Limited |
bogdanm | 73:1efda918f0ba | 3 | * |
bogdanm | 73:1efda918f0ba | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
bogdanm | 73:1efda918f0ba | 5 | * you may not use this file except in compliance with the License. |
bogdanm | 73:1efda918f0ba | 6 | * You may obtain a copy of the License at |
bogdanm | 73:1efda918f0ba | 7 | * |
bogdanm | 73:1efda918f0ba | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
bogdanm | 73:1efda918f0ba | 9 | * |
bogdanm | 73:1efda918f0ba | 10 | * Unless required by applicable law or agreed to in writing, software |
bogdanm | 73:1efda918f0ba | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
bogdanm | 73:1efda918f0ba | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
bogdanm | 73:1efda918f0ba | 13 | * See the License for the specific language governing permissions and |
bogdanm | 73:1efda918f0ba | 14 | * limitations under the License. |
bogdanm | 73:1efda918f0ba | 15 | */ |
bogdanm | 73:1efda918f0ba | 16 | #ifndef MBED_PINNAMES_H |
bogdanm | 73:1efda918f0ba | 17 | #define MBED_PINNAMES_H |
bogdanm | 73:1efda918f0ba | 18 | |
bogdanm | 73:1efda918f0ba | 19 | #include "cmsis.h" |
bogdanm | 73:1efda918f0ba | 20 | |
bogdanm | 73:1efda918f0ba | 21 | #ifdef __cplusplus |
bogdanm | 73:1efda918f0ba | 22 | extern "C" { |
bogdanm | 73:1efda918f0ba | 23 | #endif |
bogdanm | 73:1efda918f0ba | 24 | |
bogdanm | 73:1efda918f0ba | 25 | // MODE (see GPIOMode_TypeDef structure) |
bogdanm | 73:1efda918f0ba | 26 | // AFNUM (see AF_mapping constant table) |
bogdanm | 73:1efda918f0ba | 27 | #define STM_PIN_DATA(MODE, AFNUM) (((MODE) << 8) | (AFNUM)) |
bogdanm | 73:1efda918f0ba | 28 | #define STM_PIN_MODE(X) ((X) >> 8) |
bogdanm | 73:1efda918f0ba | 29 | #define STM_PIN_AFNUM(X) ((X) & 0xFF) |
bogdanm | 73:1efda918f0ba | 30 | |
bogdanm | 73:1efda918f0ba | 31 | typedef enum { |
bogdanm | 73:1efda918f0ba | 32 | PIN_INPUT, |
bogdanm | 73:1efda918f0ba | 33 | PIN_OUTPUT |
bogdanm | 73:1efda918f0ba | 34 | } PinDirection; |
bogdanm | 73:1efda918f0ba | 35 | |
bogdanm | 73:1efda918f0ba | 36 | typedef enum { |
bogdanm | 73:1efda918f0ba | 37 | |
bogdanm | 73:1efda918f0ba | 38 | // high nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F) |
bogdanm | 73:1efda918f0ba | 39 | // low nibble = pin number |
bogdanm | 73:1efda918f0ba | 40 | PA_0 = 0x00, |
bogdanm | 73:1efda918f0ba | 41 | PA_1 = 0x01, |
bogdanm | 73:1efda918f0ba | 42 | PA_2 = 0x02, |
bogdanm | 73:1efda918f0ba | 43 | PA_3 = 0x03, |
bogdanm | 73:1efda918f0ba | 44 | PA_4 = 0x04, |
bogdanm | 73:1efda918f0ba | 45 | PA_5 = 0x05, |
bogdanm | 73:1efda918f0ba | 46 | PA_6 = 0x06, |
bogdanm | 73:1efda918f0ba | 47 | PA_7 = 0x07, |
bogdanm | 73:1efda918f0ba | 48 | PA_8 = 0x08, |
bogdanm | 73:1efda918f0ba | 49 | PA_9 = 0x09, |
bogdanm | 73:1efda918f0ba | 50 | PA_10 = 0x0A, |
bogdanm | 73:1efda918f0ba | 51 | PA_11 = 0x0B, |
bogdanm | 73:1efda918f0ba | 52 | PA_12 = 0x0C, |
bogdanm | 73:1efda918f0ba | 53 | PA_13 = 0x0D, |
bogdanm | 73:1efda918f0ba | 54 | PA_14 = 0x0E, |
bogdanm | 73:1efda918f0ba | 55 | PA_15 = 0x0F, |
bogdanm | 73:1efda918f0ba | 56 | |
bogdanm | 73:1efda918f0ba | 57 | PB_0 = 0x10, |
bogdanm | 73:1efda918f0ba | 58 | PB_1 = 0x11, |
bogdanm | 73:1efda918f0ba | 59 | PB_2 = 0x12, |
bogdanm | 73:1efda918f0ba | 60 | PB_3 = 0x13, |
bogdanm | 73:1efda918f0ba | 61 | PB_4 = 0x14, |
bogdanm | 73:1efda918f0ba | 62 | PB_5 = 0x15, |
bogdanm | 73:1efda918f0ba | 63 | PB_6 = 0x16, |
bogdanm | 73:1efda918f0ba | 64 | PB_7 = 0x17, |
bogdanm | 73:1efda918f0ba | 65 | PB_8 = 0x18, |
bogdanm | 73:1efda918f0ba | 66 | PB_9 = 0x19, |
bogdanm | 73:1efda918f0ba | 67 | PB_10 = 0x1A, |
bogdanm | 73:1efda918f0ba | 68 | PB_11 = 0x1B, |
bogdanm | 73:1efda918f0ba | 69 | PB_12 = 0x1C, |
bogdanm | 73:1efda918f0ba | 70 | PB_13 = 0x1D, |
bogdanm | 73:1efda918f0ba | 71 | PB_14 = 0x1E, |
bogdanm | 73:1efda918f0ba | 72 | PB_15 = 0x1F, |
bogdanm | 73:1efda918f0ba | 73 | |
bogdanm | 73:1efda918f0ba | 74 | PC_0 = 0x20, |
bogdanm | 73:1efda918f0ba | 75 | PC_1 = 0x21, |
bogdanm | 73:1efda918f0ba | 76 | PC_2 = 0x22, |
bogdanm | 73:1efda918f0ba | 77 | PC_3 = 0x23, |
bogdanm | 73:1efda918f0ba | 78 | PC_4 = 0x24, |
bogdanm | 73:1efda918f0ba | 79 | PC_5 = 0x25, |
bogdanm | 73:1efda918f0ba | 80 | PC_6 = 0x26, |
bogdanm | 73:1efda918f0ba | 81 | PC_7 = 0x27, |
bogdanm | 73:1efda918f0ba | 82 | PC_8 = 0x28, |
bogdanm | 73:1efda918f0ba | 83 | PC_9 = 0x29, |
bogdanm | 73:1efda918f0ba | 84 | PC_10 = 0x2A, |
bogdanm | 73:1efda918f0ba | 85 | PC_11 = 0x2B, |
bogdanm | 73:1efda918f0ba | 86 | PC_12 = 0x2C, |
bogdanm | 73:1efda918f0ba | 87 | PC_13 = 0x2D, |
bogdanm | 73:1efda918f0ba | 88 | PC_14 = 0x2E, |
bogdanm | 73:1efda918f0ba | 89 | PC_15 = 0x2F, |
bogdanm | 73:1efda918f0ba | 90 | |
bogdanm | 73:1efda918f0ba | 91 | PD_0 = 0x30, |
bogdanm | 73:1efda918f0ba | 92 | PD_1 = 0x31, |
bogdanm | 73:1efda918f0ba | 93 | PD_2 = 0x32, |
bogdanm | 73:1efda918f0ba | 94 | PD_3 = 0x33, |
bogdanm | 73:1efda918f0ba | 95 | PD_4 = 0x34, |
bogdanm | 73:1efda918f0ba | 96 | PD_5 = 0x35, |
bogdanm | 73:1efda918f0ba | 97 | PD_6 = 0x36, |
bogdanm | 73:1efda918f0ba | 98 | PD_7 = 0x37, |
bogdanm | 73:1efda918f0ba | 99 | PD_8 = 0x38, |
bogdanm | 73:1efda918f0ba | 100 | PD_9 = 0x39, |
bogdanm | 73:1efda918f0ba | 101 | PD_10 = 0x3A, |
bogdanm | 73:1efda918f0ba | 102 | PD_11 = 0x3B, |
bogdanm | 73:1efda918f0ba | 103 | PD_12 = 0x3C, |
bogdanm | 73:1efda918f0ba | 104 | PD_13 = 0x3D, |
bogdanm | 73:1efda918f0ba | 105 | PD_14 = 0x3E, |
bogdanm | 73:1efda918f0ba | 106 | PD_15 = 0x3F, |
bogdanm | 73:1efda918f0ba | 107 | |
bogdanm | 73:1efda918f0ba | 108 | PE_0 = 0x40, |
bogdanm | 73:1efda918f0ba | 109 | PE_1 = 0x41, |
bogdanm | 73:1efda918f0ba | 110 | PE_2 = 0x42, |
bogdanm | 73:1efda918f0ba | 111 | PE_3 = 0x43, |
bogdanm | 73:1efda918f0ba | 112 | PE_4 = 0x44, |
bogdanm | 73:1efda918f0ba | 113 | PE_5 = 0x45, |
bogdanm | 73:1efda918f0ba | 114 | PE_6 = 0x46, |
bogdanm | 73:1efda918f0ba | 115 | PE_7 = 0x47, |
bogdanm | 73:1efda918f0ba | 116 | PE_8 = 0x48, |
bogdanm | 73:1efda918f0ba | 117 | PE_9 = 0x49, |
bogdanm | 73:1efda918f0ba | 118 | PE_10 = 0x4A, |
bogdanm | 73:1efda918f0ba | 119 | PE_11 = 0x4B, |
bogdanm | 73:1efda918f0ba | 120 | PE_12 = 0x4C, |
bogdanm | 73:1efda918f0ba | 121 | PE_13 = 0x4D, |
bogdanm | 73:1efda918f0ba | 122 | PE_14 = 0x4E, |
bogdanm | 73:1efda918f0ba | 123 | PE_15 = 0x4F, |
bogdanm | 73:1efda918f0ba | 124 | |
bogdanm | 73:1efda918f0ba | 125 | //-------------------- |
bogdanm | 73:1efda918f0ba | 126 | // NUCLEO_F103RB board |
bogdanm | 73:1efda918f0ba | 127 | //-------------------- |
bogdanm | 73:1efda918f0ba | 128 | |
bogdanm | 73:1efda918f0ba | 129 | // Arduino connectors |
bogdanm | 73:1efda918f0ba | 130 | A0 = PA_0, |
bogdanm | 73:1efda918f0ba | 131 | A1 = PA_1, |
bogdanm | 73:1efda918f0ba | 132 | A2 = PA_4, |
bogdanm | 73:1efda918f0ba | 133 | A3 = PB_0, |
bogdanm | 73:1efda918f0ba | 134 | A4 = PC_1, |
bogdanm | 73:1efda918f0ba | 135 | A5 = PC_0, |
bogdanm | 73:1efda918f0ba | 136 | D0 = PA_3, |
bogdanm | 73:1efda918f0ba | 137 | D1 = PA_2, |
bogdanm | 73:1efda918f0ba | 138 | D2 = PA_10, |
bogdanm | 73:1efda918f0ba | 139 | D3 = PB_3, |
bogdanm | 73:1efda918f0ba | 140 | D4 = PB_5, |
bogdanm | 73:1efda918f0ba | 141 | D5 = PB_4, |
bogdanm | 73:1efda918f0ba | 142 | D6 = PB_10, |
bogdanm | 73:1efda918f0ba | 143 | D7 = PA_8, |
bogdanm | 73:1efda918f0ba | 144 | D8 = PA_9, |
bogdanm | 73:1efda918f0ba | 145 | D9 = PC_7, |
bogdanm | 73:1efda918f0ba | 146 | D10 = PB_6, |
bogdanm | 73:1efda918f0ba | 147 | D11 = PA_7, |
bogdanm | 73:1efda918f0ba | 148 | D12 = PA_6, |
bogdanm | 73:1efda918f0ba | 149 | D13 = PA_5, |
bogdanm | 73:1efda918f0ba | 150 | D14 = PB_9, |
bogdanm | 73:1efda918f0ba | 151 | D15 = PB_8, |
bogdanm | 73:1efda918f0ba | 152 | |
bogdanm | 73:1efda918f0ba | 153 | USER_BUTTON = PC_13, |
bogdanm | 73:1efda918f0ba | 154 | UART_TX = PA_2, |
bogdanm | 73:1efda918f0ba | 155 | UART_RX = PA_3, |
bogdanm | 73:1efda918f0ba | 156 | |
bogdanm | 73:1efda918f0ba | 157 | // mbed mandatory namings |
bogdanm | 73:1efda918f0ba | 158 | LED1 = PA_5, |
bogdanm | 73:1efda918f0ba | 159 | LED2 = PA_5, |
bogdanm | 73:1efda918f0ba | 160 | LED3 = PA_5, |
bogdanm | 73:1efda918f0ba | 161 | LED4 = PA_5, |
bogdanm | 73:1efda918f0ba | 162 | |
bogdanm | 73:1efda918f0ba | 163 | // Not connected |
bogdanm | 73:1efda918f0ba | 164 | NC = (int)0xFFFFFFFF |
bogdanm | 73:1efda918f0ba | 165 | } PinName; |
bogdanm | 73:1efda918f0ba | 166 | |
bogdanm | 73:1efda918f0ba | 167 | typedef enum { |
bogdanm | 73:1efda918f0ba | 168 | PullNone = 0, |
bogdanm | 73:1efda918f0ba | 169 | PullUp = 1, |
bogdanm | 73:1efda918f0ba | 170 | PullDown = 2, |
bogdanm | 73:1efda918f0ba | 171 | OpenDrain = 3 |
bogdanm | 73:1efda918f0ba | 172 | } PinMode; |
bogdanm | 73:1efda918f0ba | 173 | |
bogdanm | 73:1efda918f0ba | 174 | #ifdef __cplusplus |
bogdanm | 73:1efda918f0ba | 175 | } |
bogdanm | 73:1efda918f0ba | 176 | #endif |
bogdanm | 73:1efda918f0ba | 177 | |
bogdanm | 73:1efda918f0ba | 178 | #endif |