mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Mon Sep 28 13:00:10 2015 +0100
Revision:
631:ff681937ffd8
Synchronized with git revision 1be56c8134a3ed6004f149a84f658de45dda6a5c

Full URL: https://github.com/mbedmicro/mbed/commit/1be56c8134a3ed6004f149a84f658de45dda6a5c/

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 631:ff681937ffd8 1 /* mbed Microcontroller Library
mbed_official 631:ff681937ffd8 2 *******************************************************************************
mbed_official 631:ff681937ffd8 3 * Copyright (c) 2015 WIZnet Co.,Ltd. All rights reserved.
mbed_official 631:ff681937ffd8 4 * All rights reserved.
mbed_official 631:ff681937ffd8 5 *
mbed_official 631:ff681937ffd8 6 * Redistribution and use in source and binary forms, with or without
mbed_official 631:ff681937ffd8 7 * modification, are permitted provided that the following conditions are met:
mbed_official 631:ff681937ffd8 8 *
mbed_official 631:ff681937ffd8 9 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 631:ff681937ffd8 10 * this list of conditions and the following disclaimer.
mbed_official 631:ff681937ffd8 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 631:ff681937ffd8 12 * this list of conditions and the following disclaimer in the documentation
mbed_official 631:ff681937ffd8 13 * and/or other materials provided with the distribution.
mbed_official 631:ff681937ffd8 14 * 3. Neither the name of ARM Limited nor the names of its contributors
mbed_official 631:ff681937ffd8 15 * may be used to endorse or promote products derived from this software
mbed_official 631:ff681937ffd8 16 * without specific prior written permission.
mbed_official 631:ff681937ffd8 17 *
mbed_official 631:ff681937ffd8 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 631:ff681937ffd8 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 631:ff681937ffd8 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 631:ff681937ffd8 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 631:ff681937ffd8 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 631:ff681937ffd8 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 631:ff681937ffd8 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 631:ff681937ffd8 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 631:ff681937ffd8 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 631:ff681937ffd8 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 631:ff681937ffd8 28 *******************************************************************************
mbed_official 631:ff681937ffd8 29 */
mbed_official 631:ff681937ffd8 30
mbed_official 631:ff681937ffd8 31 #ifndef MBED_PINNAMES_H
mbed_official 631:ff681937ffd8 32 #define MBED_PINNAMES_H
mbed_official 631:ff681937ffd8 33
mbed_official 631:ff681937ffd8 34 #include "cmsis.h"
mbed_official 631:ff681937ffd8 35
mbed_official 631:ff681937ffd8 36 #ifdef __cplusplus
mbed_official 631:ff681937ffd8 37 extern "C" {
mbed_official 631:ff681937ffd8 38 #endif
mbed_official 631:ff681937ffd8 39
mbed_official 631:ff681937ffd8 40
mbed_official 631:ff681937ffd8 41 // See W7500x_hal_gpio.h for values of MODE, PUPD and AFNUM
mbed_official 631:ff681937ffd8 42 #define WIZ_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((MODE) << 8) | ((PUPD) << 4) | ((AFNUM) << 0)))
mbed_official 631:ff681937ffd8 43 #define WIZ_PIN_PUPD(X) (((X) >> 4) & 0x0F)
mbed_official 631:ff681937ffd8 44 #define WIZ_PIN_AFNUM(X) (((X) >> 0) & 0x0F)
mbed_official 631:ff681937ffd8 45 #define WIZ_PIN_MODE(X) (((X) >> 8) & 0x0F)
mbed_official 631:ff681937ffd8 46 #define WIZ_MODE_INPUT (0)
mbed_official 631:ff681937ffd8 47 #define WIZ_MODE_OUTPUT (1)
mbed_official 631:ff681937ffd8 48 #define WIZ_MODE_AF (2)
mbed_official 631:ff681937ffd8 49
mbed_official 631:ff681937ffd8 50 #define WIZ_GPIO_NOPULL (0) /*!< No Pull-up or Pull-down activation */
mbed_official 631:ff681937ffd8 51 #define WIZ_GPIO_PULLDOWN (1) /*!< Pull-down activation */
mbed_official 631:ff681937ffd8 52 #define WIZ_GPIO_PULLUP (2) /*!< Pull-up activation */
mbed_official 631:ff681937ffd8 53 #define WIZ_GPIO_OPEN_DRAIN (3) /*!< Open Drain activation */
mbed_official 631:ff681937ffd8 54
mbed_official 631:ff681937ffd8 55
mbed_official 631:ff681937ffd8 56 #define WIZ_PORT(X) (((uint32_t)(X) >> 4) & 0xF) // port number (0=A, 1=B, 2=C, 3=D)
mbed_official 631:ff681937ffd8 57 #define WIZ_PIN_NUM(X) ((uint32_t)(X) & 0xF) // pin number
mbed_official 631:ff681937ffd8 58 #define WIZ_PIN_INDEX(X) (1 << ((uint32_t)(X) & 0xF)) // pin index : flag bit
mbed_official 631:ff681937ffd8 59
mbed_official 631:ff681937ffd8 60
mbed_official 631:ff681937ffd8 61 typedef enum {
mbed_official 631:ff681937ffd8 62 PIN_INPUT,
mbed_official 631:ff681937ffd8 63 PIN_OUTPUT
mbed_official 631:ff681937ffd8 64 } PinDirection;
mbed_official 631:ff681937ffd8 65
mbed_official 631:ff681937ffd8 66
mbed_official 631:ff681937ffd8 67 typedef enum {
mbed_official 631:ff681937ffd8 68 // W7500x PORT[5:4] + PIN[3:0])
mbed_official 631:ff681937ffd8 69 PA_0 = 0x000,
mbed_official 631:ff681937ffd8 70 PA_1 = 0x001,
mbed_official 631:ff681937ffd8 71 PA_2 = 0x002,
mbed_official 631:ff681937ffd8 72 PA_3 = 0x003,
mbed_official 631:ff681937ffd8 73 PA_4 = 0x004,
mbed_official 631:ff681937ffd8 74 PA_5 = 0x005,
mbed_official 631:ff681937ffd8 75 PA_6 = 0x006,
mbed_official 631:ff681937ffd8 76 PA_7 = 0x007,
mbed_official 631:ff681937ffd8 77 PA_8 = 0x008,
mbed_official 631:ff681937ffd8 78 PA_9 = 0x009,
mbed_official 631:ff681937ffd8 79 PA_10 = 0x00A,
mbed_official 631:ff681937ffd8 80 PA_11 = 0x00B,
mbed_official 631:ff681937ffd8 81 PA_12 = 0x00C,
mbed_official 631:ff681937ffd8 82 PA_13 = 0x00D,
mbed_official 631:ff681937ffd8 83 PA_14 = 0x00E,
mbed_official 631:ff681937ffd8 84 PA_15 = 0x00F,
mbed_official 631:ff681937ffd8 85
mbed_official 631:ff681937ffd8 86 PB_0 = 0x010,
mbed_official 631:ff681937ffd8 87 PB_1 = 0x011,
mbed_official 631:ff681937ffd8 88 PB_2 = 0x012,
mbed_official 631:ff681937ffd8 89 PB_3 = 0x013,
mbed_official 631:ff681937ffd8 90 PB_4 = 0x014,
mbed_official 631:ff681937ffd8 91 PB_5 = 0x015,
mbed_official 631:ff681937ffd8 92 PB_6 = 0x016,
mbed_official 631:ff681937ffd8 93 PB_7 = 0x017,
mbed_official 631:ff681937ffd8 94 PB_8 = 0x018,
mbed_official 631:ff681937ffd8 95 PB_9 = 0x019,
mbed_official 631:ff681937ffd8 96 PB_10 = 0x01A,
mbed_official 631:ff681937ffd8 97 PB_11 = 0x01B,
mbed_official 631:ff681937ffd8 98 PB_12 = 0x01C,
mbed_official 631:ff681937ffd8 99 PB_13 = 0x01D,
mbed_official 631:ff681937ffd8 100 PB_14 = 0x01E,
mbed_official 631:ff681937ffd8 101 PB_15 = 0x01F,
mbed_official 631:ff681937ffd8 102
mbed_official 631:ff681937ffd8 103 PC_0 = 0x020,
mbed_official 631:ff681937ffd8 104 PC_1 = 0x021,
mbed_official 631:ff681937ffd8 105 PC_2 = 0x022,
mbed_official 631:ff681937ffd8 106 PC_3 = 0x023,
mbed_official 631:ff681937ffd8 107 PC_4 = 0x024,
mbed_official 631:ff681937ffd8 108 PC_5 = 0x025,
mbed_official 631:ff681937ffd8 109 PC_6 = 0x026,
mbed_official 631:ff681937ffd8 110 PC_7 = 0x027,
mbed_official 631:ff681937ffd8 111 PC_8 = 0x028,
mbed_official 631:ff681937ffd8 112 PC_9 = 0x029,
mbed_official 631:ff681937ffd8 113
mbed_official 631:ff681937ffd8 114 PC_10 = 0x02A,
mbed_official 631:ff681937ffd8 115 PC_11 = 0x02B,
mbed_official 631:ff681937ffd8 116 PC_12 = 0x02C,
mbed_official 631:ff681937ffd8 117 PC_13 = 0x02D,
mbed_official 631:ff681937ffd8 118 PC_14 = 0x02E,
mbed_official 631:ff681937ffd8 119 PC_15 = 0x02F,
mbed_official 631:ff681937ffd8 120
mbed_official 631:ff681937ffd8 121 PD_0 = 0x030,
mbed_official 631:ff681937ffd8 122 PD_1 = 0x031,
mbed_official 631:ff681937ffd8 123 PD_2 = 0x032,
mbed_official 631:ff681937ffd8 124 PD_3 = 0x033,
mbed_official 631:ff681937ffd8 125 PD_4 = 0x034,
mbed_official 631:ff681937ffd8 126
mbed_official 631:ff681937ffd8 127 PA_00 = PA_0,
mbed_official 631:ff681937ffd8 128 PA_01 = PA_1,
mbed_official 631:ff681937ffd8 129 PA_02 = PA_2,
mbed_official 631:ff681937ffd8 130 PA_03 = PA_3,
mbed_official 631:ff681937ffd8 131 PA_04 = PA_4,
mbed_official 631:ff681937ffd8 132 PA_05 = PA_5,
mbed_official 631:ff681937ffd8 133 PA_06 = PA_6,
mbed_official 631:ff681937ffd8 134 PA_07 = PA_7,
mbed_official 631:ff681937ffd8 135 PA_08 = PA_8,
mbed_official 631:ff681937ffd8 136 PA_09 = PA_9,
mbed_official 631:ff681937ffd8 137
mbed_official 631:ff681937ffd8 138 PB_00 = PB_0,
mbed_official 631:ff681937ffd8 139 PB_01 = PB_1,
mbed_official 631:ff681937ffd8 140 PB_02 = PB_2,
mbed_official 631:ff681937ffd8 141 PB_03 = PB_3,
mbed_official 631:ff681937ffd8 142 PB_04 = PB_4,
mbed_official 631:ff681937ffd8 143 PB_05 = PB_5,
mbed_official 631:ff681937ffd8 144 PB_06 = PB_6,
mbed_official 631:ff681937ffd8 145 PB_07 = PB_7,
mbed_official 631:ff681937ffd8 146 PB_08 = PB_8,
mbed_official 631:ff681937ffd8 147 PB_09 = PB_9,
mbed_official 631:ff681937ffd8 148
mbed_official 631:ff681937ffd8 149 PC_00 = PC_0,
mbed_official 631:ff681937ffd8 150 PC_01 = PC_1,
mbed_official 631:ff681937ffd8 151 PC_02 = PC_2,
mbed_official 631:ff681937ffd8 152 PC_03 = PC_3,
mbed_official 631:ff681937ffd8 153 PC_04 = PC_4,
mbed_official 631:ff681937ffd8 154 PC_05 = PC_5,
mbed_official 631:ff681937ffd8 155 PC_06 = PC_6,
mbed_official 631:ff681937ffd8 156 PC_07 = PC_7,
mbed_official 631:ff681937ffd8 157 PC_08 = PC_8,
mbed_official 631:ff681937ffd8 158 PC_09 = PC_9,
mbed_official 631:ff681937ffd8 159
mbed_official 631:ff681937ffd8 160 PD_00 = PD_0,
mbed_official 631:ff681937ffd8 161 PD_01 = PD_1,
mbed_official 631:ff681937ffd8 162 PD_02 = PD_2,
mbed_official 631:ff681937ffd8 163 PD_03 = PD_3,
mbed_official 631:ff681937ffd8 164 PD_04 = PD_4,
mbed_official 631:ff681937ffd8 165
mbed_official 631:ff681937ffd8 166 // Arduino connector namings
mbed_official 631:ff681937ffd8 167 A0 = PC_15, // AIN0
mbed_official 631:ff681937ffd8 168 A1 = PC_14, // AIN1
mbed_official 631:ff681937ffd8 169 A2 = PC_13, // AIN2
mbed_official 631:ff681937ffd8 170 A3 = PC_12, // AIN3
mbed_official 631:ff681937ffd8 171 A4 = PC_9, // AIN4
mbed_official 631:ff681937ffd8 172 A5 = PC_8, // AIN5
mbed_official 631:ff681937ffd8 173
mbed_official 631:ff681937ffd8 174 D0 = PA_14,
mbed_official 631:ff681937ffd8 175 D1 = PA_13,
mbed_official 631:ff681937ffd8 176 D2 = PC_3,
mbed_official 631:ff681937ffd8 177 D3 = PC_2,
mbed_official 631:ff681937ffd8 178 D4 = PA_2,
mbed_official 631:ff681937ffd8 179 D5 = PA_1,
mbed_official 631:ff681937ffd8 180 D6 = PA_0,
mbed_official 631:ff681937ffd8 181 D7 = PA_12,
mbed_official 631:ff681937ffd8 182 D8 = PA_11,
mbed_official 631:ff681937ffd8 183 D9 = PC_1,
mbed_official 631:ff681937ffd8 184 D10 = PA_5,
mbed_official 631:ff681937ffd8 185 D11 = PA_8,
mbed_official 631:ff681937ffd8 186 D12 = PA_7,
mbed_official 631:ff681937ffd8 187 D13 = PA_6,
mbed_official 631:ff681937ffd8 188 D14 = PA_10,
mbed_official 631:ff681937ffd8 189 D15 = PA_9,
mbed_official 631:ff681937ffd8 190
mbed_official 631:ff681937ffd8 191 // Generic signals namings
mbed_official 631:ff681937ffd8 192 LED_RED = PC_0,
mbed_official 631:ff681937ffd8 193 LED_GREEN = PC_4,
mbed_official 631:ff681937ffd8 194 LED_BLUE = PC_5,
mbed_official 631:ff681937ffd8 195
mbed_official 631:ff681937ffd8 196 LED1 = LED_RED,
mbed_official 631:ff681937ffd8 197 LED2 = LED_GREEN,
mbed_official 631:ff681937ffd8 198 LED3 = LED_BLUE,
mbed_official 631:ff681937ffd8 199 LED4 = LED_BLUE,
mbed_official 631:ff681937ffd8 200
mbed_official 631:ff681937ffd8 201 LEDR = LED_RED,
mbed_official 631:ff681937ffd8 202 LEDG = LED_GREEN,
mbed_official 631:ff681937ffd8 203 LEDB = LED_BLUE,
mbed_official 631:ff681937ffd8 204
mbed_official 631:ff681937ffd8 205 USBTX = PC_10,
mbed_official 631:ff681937ffd8 206 USBRX = PC_11,
mbed_official 631:ff681937ffd8 207
mbed_official 631:ff681937ffd8 208 //Use SPI1
mbed_official 631:ff681937ffd8 209 SD_SEL = PB_0, // SPI1_CS
mbed_official 631:ff681937ffd8 210 SD_CLK = PB_1, // SPI1_CLK
mbed_official 631:ff681937ffd8 211 SD_MISO = PB_2, // MOSI1
mbed_official 631:ff681937ffd8 212 SD_MOSI = PB_3, // MISO1
mbed_official 631:ff681937ffd8 213
mbed_official 631:ff681937ffd8 214 // Not connected
mbed_official 631:ff681937ffd8 215 NC = (int)0xFFFFFFFF
mbed_official 631:ff681937ffd8 216 } PinName;
mbed_official 631:ff681937ffd8 217
mbed_official 631:ff681937ffd8 218 typedef enum {
mbed_official 631:ff681937ffd8 219 PullNone = 0,
mbed_official 631:ff681937ffd8 220 PullDown = 1,
mbed_official 631:ff681937ffd8 221 PullUp = 2,
mbed_official 631:ff681937ffd8 222 PullDefault = PullNone
mbed_official 631:ff681937ffd8 223 } PinMode;
mbed_official 631:ff681937ffd8 224
mbed_official 631:ff681937ffd8 225
mbed_official 631:ff681937ffd8 226 #ifdef __cplusplus
mbed_official 631:ff681937ffd8 227 }
mbed_official 631:ff681937ffd8 228 #endif
mbed_official 631:ff681937ffd8 229
mbed_official 631:ff681937ffd8 230 #endif