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

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Feb 20 20:53:29 2019 +0000
Revision:
172:65be27845400
Parent:
171:3a7713b1edbc
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Anna Bridge 142:4eea097334d6 1 /***************************************************************************//**
Anna Bridge 142:4eea097334d6 2 * @file PinNames.h
Anna Bridge 142:4eea097334d6 3 *******************************************************************************
Anna Bridge 142:4eea097334d6 4 * @section License
Anna Bridge 142:4eea097334d6 5 * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
Anna Bridge 142:4eea097334d6 6 *******************************************************************************
Anna Bridge 142:4eea097334d6 7 *
Anna Bridge 142:4eea097334d6 8 * SPDX-License-Identifier: Apache-2.0
Anna Bridge 142:4eea097334d6 9 *
Anna Bridge 142:4eea097334d6 10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
Anna Bridge 142:4eea097334d6 11 * not use this file except in compliance with the License.
Anna Bridge 142:4eea097334d6 12 * You may obtain a copy of the License at
Anna Bridge 142:4eea097334d6 13 *
Anna Bridge 142:4eea097334d6 14 * http://www.apache.org/licenses/LICENSE-2.0
Anna Bridge 142:4eea097334d6 15 *
Anna Bridge 142:4eea097334d6 16 * Unless required by applicable law or agreed to in writing, software
Anna Bridge 142:4eea097334d6 17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Anna Bridge 142:4eea097334d6 18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Anna Bridge 142:4eea097334d6 19 * See the License for the specific language governing permissions and
Anna Bridge 142:4eea097334d6 20 * limitations under the License.
Anna Bridge 142:4eea097334d6 21 *
Anna Bridge 142:4eea097334d6 22 ******************************************************************************/
Anna Bridge 142:4eea097334d6 23 #ifndef MBED_COMMONPINNAMES_H
Anna Bridge 142:4eea097334d6 24 #define MBED_COMMONPINNAMES_H
Anna Bridge 142:4eea097334d6 25
Anna Bridge 142:4eea097334d6 26 #include "em_gpio.h"
Anna Bridge 142:4eea097334d6 27
Anna Bridge 142:4eea097334d6 28 /* EFM32 Pin Names
Anna Bridge 142:4eea097334d6 29 * First 4 bits represent pin number, the remaining
Anna Bridge 142:4eea097334d6 30 * bits represent port number (A = 0, B = 1, ...)
Anna Bridge 142:4eea097334d6 31 */
Anna Bridge 142:4eea097334d6 32 #define EFM32_STANDARD_PIN_DEFINITIONS \
Anna Bridge 142:4eea097334d6 33 PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, \
Anna Bridge 142:4eea097334d6 34 PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, \
Anna Bridge 142:4eea097334d6 35 PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, \
Anna Bridge 142:4eea097334d6 36 PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, \
Anna Bridge 142:4eea097334d6 37 PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, \
Anna Bridge 142:4eea097334d6 38 PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, \
Anna Bridge 142:4eea097334d6 39 PG0 = 6 << 4, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, \
Anna Bridge 142:4eea097334d6 40 PH0 = 7 << 4, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, \
Anna Bridge 142:4eea097334d6 41 PI0 = 8 << 4, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, \
Anna Bridge 142:4eea097334d6 42 PJ0 = 9 << 4, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, \
Anna Bridge 142:4eea097334d6 43 PK0 = 10 << 4, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, PK15, \
Anna Bridge 160:5571c4ff569f 44 NC = (unsigned int) 0xFFFFFFFFUL
Anna Bridge 142:4eea097334d6 45
Anna Bridge 142:4eea097334d6 46 #ifdef __cplusplus
Anna Bridge 142:4eea097334d6 47 extern "C" {
Anna Bridge 142:4eea097334d6 48 #endif
Anna Bridge 142:4eea097334d6 49
Anna Bridge 142:4eea097334d6 50 typedef enum {
Anna Bridge 142:4eea097334d6 51 PIN_INPUT = 0,
Anna Bridge 142:4eea097334d6 52 PIN_OUTPUT = 1
Anna Bridge 142:4eea097334d6 53 } PinDirection;
Anna Bridge 142:4eea097334d6 54
Anna Bridge 142:4eea097334d6 55 /* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */
Anna Bridge 142:4eea097334d6 56 typedef enum {
Anna Bridge 142:4eea097334d6 57 /* EFM32 pin modes */
Anna Bridge 142:4eea097334d6 58 Disabled = gpioModeDisabled,
Anna Bridge 142:4eea097334d6 59 DisabledPullUp = gpioModeDisabled | 0x10,
Anna Bridge 142:4eea097334d6 60 Input = gpioModeInput,
Anna Bridge 142:4eea097334d6 61 InputFilter = gpioModeInput | 0x10,
Anna Bridge 142:4eea097334d6 62 InputPullDown = gpioModeInputPull,
Anna Bridge 142:4eea097334d6 63 InputPullUp = gpioModeInputPull | 0x10,
Anna Bridge 142:4eea097334d6 64 InputPullFilterDown = gpioModeInputPullFilter,
Anna Bridge 142:4eea097334d6 65 InputPullFilterUp = gpioModeInputPullFilter | 0x10,
Anna Bridge 142:4eea097334d6 66 PushPull = gpioModePushPull,
Anna Bridge 142:4eea097334d6 67 #if defined( _GPIO_P_MODEL_MODE0_PUSHPULLDRIVE )
Anna Bridge 142:4eea097334d6 68 PushPullDrive = gpioModePushPullDrive,
Anna Bridge 142:4eea097334d6 69 #endif
Anna Bridge 142:4eea097334d6 70 WiredOr = gpioModeWiredOr,
Anna Bridge 142:4eea097334d6 71 WiredOrPullDown = gpioModeWiredOrPullDown,
Anna Bridge 142:4eea097334d6 72 WiredAnd = gpioModeWiredAnd,
Anna Bridge 142:4eea097334d6 73 WiredAndFilter = gpioModeWiredAndFilter,
Anna Bridge 142:4eea097334d6 74 WiredAndPullUp = gpioModeWiredAndPullUp,
Anna Bridge 142:4eea097334d6 75 WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter,
Anna Bridge 142:4eea097334d6 76 #if defined( _GPIO_P_MODEL_MODE0_WIREDANDDRIVE )
Anna Bridge 142:4eea097334d6 77 WiredAndDrive = gpioModeWiredAndDrive,
Anna Bridge 142:4eea097334d6 78 WiredAndDriveFilter = gpioModeWiredAndDriveFilter,
Anna Bridge 142:4eea097334d6 79 WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp,
Anna Bridge 142:4eea097334d6 80 WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter,
Anna Bridge 142:4eea097334d6 81 #endif
Anna Bridge 142:4eea097334d6 82
Anna Bridge 142:4eea097334d6 83 /* mbed modes:
Anna Bridge 142:4eea097334d6 84 * PullUp, PullDown, PullNone, OpenDrain
Anna Bridge 142:4eea097334d6 85 *
Anna Bridge 142:4eea097334d6 86 * mbed default digital input mode:
Anna Bridge 142:4eea097334d6 87 * PullDefault
Anna Bridge 142:4eea097334d6 88 *
Anna Bridge 142:4eea097334d6 89 * mbed default digital output mode:
Anna Bridge 142:4eea097334d6 90 * PullNone
Anna Bridge 142:4eea097334d6 91 */
Anna Bridge 142:4eea097334d6 92 PullUp = InputPullUp,
Anna Bridge 142:4eea097334d6 93 PullDown = InputPullDown,
Anna Bridge 142:4eea097334d6 94 OpenDrain = WiredAnd,
Anna Bridge 142:4eea097334d6 95 PullNone = PushPull,
Anna Bridge 142:4eea097334d6 96 PullDefault = PushPull
Anna Bridge 142:4eea097334d6 97 } PinMode;
Anna Bridge 142:4eea097334d6 98
Anna Bridge 142:4eea097334d6 99 #ifdef __cplusplus
Anna Bridge 142:4eea097334d6 100 }
Anna Bridge 142:4eea097334d6 101 #endif
Anna Bridge 142:4eea097334d6 102
Anna Bridge 142:4eea097334d6 103 #endif