helpfor studient
Dependents: STM32_F103-C8T6basecanblink_led
Fork of mbed-dev by
targets/TARGET_ARM_SSG/TARGET_BEETLE/PinNames.h@149:156823d33999, 2016-10-28 (annotated)
- Committer:
- <>
- Date:
- Fri Oct 28 11:17:30 2016 +0100
- Revision:
- 149:156823d33999
- Parent:
- targets/hal/TARGET_ARM_SSG/TARGET_BEETLE/PinNames.h@144:ef7eb2e8f9f7
This updates the lib to the mbed lib v128
NOTE: This release includes a restructuring of the file and directory locations and thus some
include paths in your code may need updating accordingly.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 144:ef7eb2e8f9f7 | 1 | /* mbed Microcontroller Library |
<> | 144:ef7eb2e8f9f7 | 2 | * Copyright (c) 2015 ARM Limited |
<> | 144:ef7eb2e8f9f7 | 3 | * |
<> | 144:ef7eb2e8f9f7 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
<> | 144:ef7eb2e8f9f7 | 5 | * you may not use this file except in compliance with the License. |
<> | 144:ef7eb2e8f9f7 | 6 | * You may obtain a copy of the License at |
<> | 144:ef7eb2e8f9f7 | 7 | * |
<> | 144:ef7eb2e8f9f7 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
<> | 144:ef7eb2e8f9f7 | 9 | * |
<> | 144:ef7eb2e8f9f7 | 10 | * Unless required by applicable law or agreed to in writing, software |
<> | 144:ef7eb2e8f9f7 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
<> | 144:ef7eb2e8f9f7 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<> | 144:ef7eb2e8f9f7 | 13 | * See the License for the specific language governing permissions and |
<> | 144:ef7eb2e8f9f7 | 14 | * limitations under the License. |
<> | 144:ef7eb2e8f9f7 | 15 | */ |
<> | 144:ef7eb2e8f9f7 | 16 | #ifndef MBED_PINNAMES_H |
<> | 144:ef7eb2e8f9f7 | 17 | #define MBED_PINNAMES_H |
<> | 144:ef7eb2e8f9f7 | 18 | |
<> | 144:ef7eb2e8f9f7 | 19 | #include "cmsis.h" |
<> | 144:ef7eb2e8f9f7 | 20 | |
<> | 144:ef7eb2e8f9f7 | 21 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 22 | extern "C" { |
<> | 144:ef7eb2e8f9f7 | 23 | #endif |
<> | 144:ef7eb2e8f9f7 | 24 | |
<> | 144:ef7eb2e8f9f7 | 25 | typedef enum { |
<> | 144:ef7eb2e8f9f7 | 26 | PIN_INPUT, |
<> | 144:ef7eb2e8f9f7 | 27 | PIN_OUTPUT |
<> | 144:ef7eb2e8f9f7 | 28 | } PinDirection; |
<> | 144:ef7eb2e8f9f7 | 29 | |
<> | 144:ef7eb2e8f9f7 | 30 | #define PORT_SHIFT 5 |
<> | 144:ef7eb2e8f9f7 | 31 | |
<> | 144:ef7eb2e8f9f7 | 32 | typedef enum { |
<> | 144:ef7eb2e8f9f7 | 33 | /* BEETLE Pin Names */ |
<> | 144:ef7eb2e8f9f7 | 34 | /* GPIO0 */ |
<> | 144:ef7eb2e8f9f7 | 35 | P0_0 = 0, |
<> | 144:ef7eb2e8f9f7 | 36 | P0_1 = 1, |
<> | 144:ef7eb2e8f9f7 | 37 | P0_2 = 2, |
<> | 144:ef7eb2e8f9f7 | 38 | P0_3 = 3, |
<> | 144:ef7eb2e8f9f7 | 39 | P0_4 = 4, |
<> | 144:ef7eb2e8f9f7 | 40 | P0_5 = 5, |
<> | 144:ef7eb2e8f9f7 | 41 | P0_6 = 6, |
<> | 144:ef7eb2e8f9f7 | 42 | P0_7 = 7, |
<> | 144:ef7eb2e8f9f7 | 43 | P0_8 = 8, |
<> | 144:ef7eb2e8f9f7 | 44 | P0_9 = 9, |
<> | 144:ef7eb2e8f9f7 | 45 | P0_10 = 10, |
<> | 144:ef7eb2e8f9f7 | 46 | P0_11 = 11, |
<> | 144:ef7eb2e8f9f7 | 47 | P0_12 = 12, |
<> | 144:ef7eb2e8f9f7 | 48 | P0_13 = 13, |
<> | 144:ef7eb2e8f9f7 | 49 | P0_14 = 14, |
<> | 144:ef7eb2e8f9f7 | 50 | P0_15 = 15, |
<> | 144:ef7eb2e8f9f7 | 51 | |
<> | 144:ef7eb2e8f9f7 | 52 | /* GPIO1 */ |
<> | 144:ef7eb2e8f9f7 | 53 | P1_0 = 16, |
<> | 144:ef7eb2e8f9f7 | 54 | P1_1 = 17, |
<> | 144:ef7eb2e8f9f7 | 55 | P1_2 = 18, |
<> | 144:ef7eb2e8f9f7 | 56 | P1_3 = 19, |
<> | 144:ef7eb2e8f9f7 | 57 | P1_4 = 20, |
<> | 144:ef7eb2e8f9f7 | 58 | P1_5 = 21, |
<> | 144:ef7eb2e8f9f7 | 59 | P1_6 = 22, |
<> | 144:ef7eb2e8f9f7 | 60 | P1_7 = 23, |
<> | 144:ef7eb2e8f9f7 | 61 | P1_8 = 24, |
<> | 144:ef7eb2e8f9f7 | 62 | P1_9 = 25, |
<> | 144:ef7eb2e8f9f7 | 63 | P1_10 = 26, |
<> | 144:ef7eb2e8f9f7 | 64 | P1_11 = 27, |
<> | 144:ef7eb2e8f9f7 | 65 | P1_12 = 28, |
<> | 144:ef7eb2e8f9f7 | 66 | P1_13 = 29, |
<> | 144:ef7eb2e8f9f7 | 67 | P1_14 = 30, |
<> | 144:ef7eb2e8f9f7 | 68 | P1_15 = 31, |
<> | 144:ef7eb2e8f9f7 | 69 | |
<> | 144:ef7eb2e8f9f7 | 70 | /* Arduino Connector Namings */ |
<> | 144:ef7eb2e8f9f7 | 71 | A0 = 600, |
<> | 144:ef7eb2e8f9f7 | 72 | A1 = 601, |
<> | 144:ef7eb2e8f9f7 | 73 | A2 = 602, |
<> | 144:ef7eb2e8f9f7 | 74 | A3 = 603, |
<> | 144:ef7eb2e8f9f7 | 75 | A4 = 604, |
<> | 144:ef7eb2e8f9f7 | 76 | A5 = 605, |
<> | 144:ef7eb2e8f9f7 | 77 | D0 = P0_0, |
<> | 144:ef7eb2e8f9f7 | 78 | D1 = P0_1, |
<> | 144:ef7eb2e8f9f7 | 79 | D2 = P0_2, |
<> | 144:ef7eb2e8f9f7 | 80 | D3 = P0_3, |
<> | 144:ef7eb2e8f9f7 | 81 | D4 = P0_4, |
<> | 144:ef7eb2e8f9f7 | 82 | D5 = P0_5, |
<> | 144:ef7eb2e8f9f7 | 83 | D6 = P0_6, |
<> | 144:ef7eb2e8f9f7 | 84 | D7 = P0_7, |
<> | 144:ef7eb2e8f9f7 | 85 | D8 = P0_8, |
<> | 144:ef7eb2e8f9f7 | 86 | D9 = P0_9, |
<> | 144:ef7eb2e8f9f7 | 87 | D10 = P0_10, |
<> | 144:ef7eb2e8f9f7 | 88 | D11 = P0_11, |
<> | 144:ef7eb2e8f9f7 | 89 | D12 = P0_12, |
<> | 144:ef7eb2e8f9f7 | 90 | D13 = P0_13, |
<> | 144:ef7eb2e8f9f7 | 91 | D14 = P0_14, |
<> | 144:ef7eb2e8f9f7 | 92 | D15 = P0_15, |
<> | 144:ef7eb2e8f9f7 | 93 | |
<> | 144:ef7eb2e8f9f7 | 94 | /* TRACE Ports */ |
<> | 144:ef7eb2e8f9f7 | 95 | TRACECLK = P0_2, |
<> | 144:ef7eb2e8f9f7 | 96 | TRACED0 = P0_6, |
<> | 144:ef7eb2e8f9f7 | 97 | TRACED1 = P0_7, |
<> | 144:ef7eb2e8f9f7 | 98 | TRACED2 = P0_8, |
<> | 144:ef7eb2e8f9f7 | 99 | TRACED3 = P0_9, |
<> | 144:ef7eb2e8f9f7 | 100 | |
<> | 144:ef7eb2e8f9f7 | 101 | /* Other BEETLE Pin Names */ |
<> | 144:ef7eb2e8f9f7 | 102 | |
<> | 144:ef7eb2e8f9f7 | 103 | //Shield SPI |
<> | 144:ef7eb2e8f9f7 | 104 | SHIELD_SPI_SCK = 320, |
<> | 144:ef7eb2e8f9f7 | 105 | SHIELD_SPI_MOSI = 321, |
<> | 144:ef7eb2e8f9f7 | 106 | SHIELD_SPI_MISO = 322, |
<> | 144:ef7eb2e8f9f7 | 107 | SHIELD_SPI_nCS = 323, |
<> | 144:ef7eb2e8f9f7 | 108 | |
<> | 144:ef7eb2e8f9f7 | 109 | //ADC SPI |
<> | 144:ef7eb2e8f9f7 | 110 | ADC_SPI_MOSI = 650, |
<> | 144:ef7eb2e8f9f7 | 111 | ADC_SPI_MISO = 651, |
<> | 144:ef7eb2e8f9f7 | 112 | ADC_SPI_SCK = 652, |
<> | 144:ef7eb2e8f9f7 | 113 | ADC_SPI_nCS = 653, |
<> | 144:ef7eb2e8f9f7 | 114 | |
<> | 144:ef7eb2e8f9f7 | 115 | //Uart |
<> | 144:ef7eb2e8f9f7 | 116 | UART_TX0 = 400, |
<> | 144:ef7eb2e8f9f7 | 117 | UART_RX0 = 401, |
<> | 144:ef7eb2e8f9f7 | 118 | UART_TX1 = 402, |
<> | 144:ef7eb2e8f9f7 | 119 | UART_RX1 = 403, |
<> | 144:ef7eb2e8f9f7 | 120 | |
<> | 144:ef7eb2e8f9f7 | 121 | //Shield I2C |
<> | 144:ef7eb2e8f9f7 | 122 | SHIELD_SDA = 504, |
<> | 144:ef7eb2e8f9f7 | 123 | SHIELD_SCL = 505, |
<> | 144:ef7eb2e8f9f7 | 124 | |
<> | 144:ef7eb2e8f9f7 | 125 | // Internal I2C for temperature and acceleromter sensor |
<> | 144:ef7eb2e8f9f7 | 126 | SENSOR_SDA = 506, |
<> | 144:ef7eb2e8f9f7 | 127 | SENSOR_SCL = 507, |
<> | 144:ef7eb2e8f9f7 | 128 | |
<> | 144:ef7eb2e8f9f7 | 129 | // Emulated LEDS |
<> | 144:ef7eb2e8f9f7 | 130 | /* |
<> | 144:ef7eb2e8f9f7 | 131 | * Beetle board is built to optimize power consumption therefore does not |
<> | 144:ef7eb2e8f9f7 | 132 | * provide on-board LEDs. The configuration below is provided only for |
<> | 144:ef7eb2e8f9f7 | 133 | * compatibility purposes with MBED test suite. |
<> | 144:ef7eb2e8f9f7 | 134 | * The LEDs [1:4] are emulated and trapped in our GPIO driver. |
<> | 144:ef7eb2e8f9f7 | 135 | * For more details on how to use a Led on an external PIN via GPIO |
<> | 144:ef7eb2e8f9f7 | 136 | * configuration please refer to the connected community page below: |
<> | 144:ef7eb2e8f9f7 | 137 | * https://community.arm.com/docs/DOC-11713 |
<> | 144:ef7eb2e8f9f7 | 138 | */ |
<> | 144:ef7eb2e8f9f7 | 139 | LED1 = 1001, |
<> | 144:ef7eb2e8f9f7 | 140 | LED2 = 1002, |
<> | 144:ef7eb2e8f9f7 | 141 | LED3 = 1003, |
<> | 144:ef7eb2e8f9f7 | 142 | LED4 = 1004, |
<> | 144:ef7eb2e8f9f7 | 143 | |
<> | 144:ef7eb2e8f9f7 | 144 | // Not connected |
<> | 144:ef7eb2e8f9f7 | 145 | NC = (int)0xFFFFFFFF, |
<> | 144:ef7eb2e8f9f7 | 146 | } PinName; |
<> | 144:ef7eb2e8f9f7 | 147 | |
<> | 144:ef7eb2e8f9f7 | 148 | typedef enum { |
<> | 144:ef7eb2e8f9f7 | 149 | PullUp = 2, |
<> | 144:ef7eb2e8f9f7 | 150 | PullDown = 1, |
<> | 144:ef7eb2e8f9f7 | 151 | PullNone = 0, |
<> | 144:ef7eb2e8f9f7 | 152 | Repeater = 3, |
<> | 144:ef7eb2e8f9f7 | 153 | OpenDrain = 4, |
<> | 144:ef7eb2e8f9f7 | 154 | PullDefault = PullDown |
<> | 144:ef7eb2e8f9f7 | 155 | } PinMode; |
<> | 144:ef7eb2e8f9f7 | 156 | |
<> | 144:ef7eb2e8f9f7 | 157 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 158 | } |
<> | 144:ef7eb2e8f9f7 | 159 | #endif |
<> | 144:ef7eb2e8f9f7 | 160 | |
<> | 144:ef7eb2e8f9f7 | 161 | #endif |