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 Jul 20 09:00:09 2015 +0100
Revision:
593:78ee8643776a
Parent:
525:c320967f86b9
Child:
627:4fa1328d9c60
Synchronized with git revision a68b724d07788e6389ea4d52c622aad767953758

Full URL: https://github.com/mbedmicro/mbed/commit/a68b724d07788e6389ea4d52c622aad767953758/

[Silicon Labs] Bring EFM32 HAL up to date

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 525:c320967f86b9 1 /* mbed Microcontroller Library
mbed_official 525:c320967f86b9 2 * Copyright (c) 2006-2013 ARM Limited
mbed_official 525:c320967f86b9 3 *
mbed_official 525:c320967f86b9 4 * Licensed under the Apache License, Version 2.0 (the "License");
mbed_official 525:c320967f86b9 5 * you may not use this file except in compliance with the License.
mbed_official 525:c320967f86b9 6 * You may obtain a copy of the License at
mbed_official 525:c320967f86b9 7 *
mbed_official 525:c320967f86b9 8 * http://www.apache.org/licenses/LICENSE-2.0
mbed_official 525:c320967f86b9 9 *
mbed_official 525:c320967f86b9 10 * Unless required by applicable law or agreed to in writing, software
mbed_official 525:c320967f86b9 11 * distributed under the License is distributed on an "AS IS" BASIS,
mbed_official 525:c320967f86b9 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbed_official 525:c320967f86b9 13 * See the License for the specific language governing permissions and
mbed_official 525:c320967f86b9 14 * limitations under the License.
mbed_official 525:c320967f86b9 15 */
mbed_official 525:c320967f86b9 16 #ifndef MBED_PINNAMES_H
mbed_official 525:c320967f86b9 17 #define MBED_PINNAMES_H
mbed_official 525:c320967f86b9 18
mbed_official 525:c320967f86b9 19 #include "cmsis.h"
mbed_official 525:c320967f86b9 20 #include "em_gpio.h"
mbed_official 525:c320967f86b9 21
mbed_official 525:c320967f86b9 22 #ifdef __cplusplus
mbed_official 525:c320967f86b9 23 extern "C" {
mbed_official 525:c320967f86b9 24 #endif
mbed_official 525:c320967f86b9 25
mbed_official 525:c320967f86b9 26 typedef enum {
mbed_official 525:c320967f86b9 27 PIN_INPUT = 0,
mbed_official 525:c320967f86b9 28 PIN_OUTPUT = 1
mbed_official 525:c320967f86b9 29 } PinDirection;
mbed_official 525:c320967f86b9 30
mbed_official 525:c320967f86b9 31 typedef enum {
mbed_official 525:c320967f86b9 32 /* EFM32 Pin Names
mbed_official 525:c320967f86b9 33 * First 4 bits represent pin number, the remaining
mbed_official 525:c320967f86b9 34 * bits represent port number (A = 0, B = 1, ...)
mbed_official 525:c320967f86b9 35 */
mbed_official 525:c320967f86b9 36 PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15,
mbed_official 525:c320967f86b9 37 PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15,
mbed_official 525:c320967f86b9 38 PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15,
mbed_official 525:c320967f86b9 39 PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15,
mbed_official 525:c320967f86b9 40 PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15,
mbed_official 525:c320967f86b9 41 PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15,
mbed_official 525:c320967f86b9 42
mbed_official 525:c320967f86b9 43 /* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */
mbed_official 525:c320967f86b9 44 LED0 = PF4,
mbed_official 525:c320967f86b9 45 LED1 = PF5,
mbed_official 525:c320967f86b9 46 LED2 = LED0,
mbed_official 525:c320967f86b9 47 LED3 = LED0,
mbed_official 525:c320967f86b9 48 LED4 = LED1,
mbed_official 525:c320967f86b9 49
mbed_official 525:c320967f86b9 50 /* Push Buttons */
mbed_official 525:c320967f86b9 51 SW0 = PC9,
mbed_official 525:c320967f86b9 52 SW1 = PC10,
mbed_official 525:c320967f86b9 53 BTN0 = SW0,
mbed_official 525:c320967f86b9 54 BTN1 = SW1,
mbed_official 525:c320967f86b9 55
mbed_official 525:c320967f86b9 56 /* Serial */
mbed_official 525:c320967f86b9 57 SERIAL_TX = PE10,
mbed_official 525:c320967f86b9 58 SERIAL_RX = PE11,
mbed_official 525:c320967f86b9 59 USBTX = PF2,
mbed_official 525:c320967f86b9 60 USBRX = PA0,
mbed_official 525:c320967f86b9 61 EFM_BC_EN = PA9,
mbed_official 525:c320967f86b9 62
mbed_official 525:c320967f86b9 63 /* Not connected */
mbed_official 525:c320967f86b9 64 NC = (int) 0xFFFFFFFF
mbed_official 525:c320967f86b9 65 } PinName;
mbed_official 525:c320967f86b9 66
mbed_official 525:c320967f86b9 67
mbed_official 525:c320967f86b9 68 /* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */
mbed_official 525:c320967f86b9 69 typedef enum {
mbed_official 525:c320967f86b9 70 /* EFM32 pin modes */
mbed_official 525:c320967f86b9 71 Disabled = gpioModeDisabled,
mbed_official 525:c320967f86b9 72 DisabledPullUp = gpioModeDisabled | 0x10,
mbed_official 525:c320967f86b9 73 Input = gpioModeInput,
mbed_official 525:c320967f86b9 74 InputFilter = gpioModeInput | 0x10,
mbed_official 525:c320967f86b9 75 InputPullDown = gpioModeInputPull,
mbed_official 525:c320967f86b9 76 InputPullUp = gpioModeInputPull | 0x10,
mbed_official 525:c320967f86b9 77 InputPullFilterDown = gpioModeInputPullFilter,
mbed_official 525:c320967f86b9 78 InputPullFilterUp = gpioModeInputPullFilter | 0x10,
mbed_official 525:c320967f86b9 79 PushPull = gpioModePushPull,
mbed_official 525:c320967f86b9 80 PushPullDrive = gpioModePushPullDrive,
mbed_official 525:c320967f86b9 81 WiredOr = gpioModeWiredOr,
mbed_official 525:c320967f86b9 82 WiredOrPullDown = gpioModeWiredOrPullDown,
mbed_official 525:c320967f86b9 83 WiredAnd = gpioModeWiredAnd,
mbed_official 525:c320967f86b9 84 WiredAndFilter = gpioModeWiredAndFilter,
mbed_official 525:c320967f86b9 85 WiredAndPullUp = gpioModeWiredAndPullUp,
mbed_official 525:c320967f86b9 86 WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter,
mbed_official 525:c320967f86b9 87 WiredAndDrive = gpioModeWiredAndDrive,
mbed_official 525:c320967f86b9 88 WiredAndDriveFilter = gpioModeWiredAndDriveFilter,
mbed_official 525:c320967f86b9 89 WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp,
mbed_official 525:c320967f86b9 90 WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter,
mbed_official 525:c320967f86b9 91
mbed_official 525:c320967f86b9 92 /* mbed modes:
mbed_official 525:c320967f86b9 93 * PullUp, PullDown, PullNone, OpenDrain
mbed_official 525:c320967f86b9 94 *
mbed_official 525:c320967f86b9 95 * mbed default digital input mode:
mbed_official 525:c320967f86b9 96 * PullDefault
mbed_official 525:c320967f86b9 97 *
mbed_official 525:c320967f86b9 98 * mbed default digital output mode:
mbed_official 525:c320967f86b9 99 * PullNone
mbed_official 525:c320967f86b9 100 */
mbed_official 525:c320967f86b9 101 PullUp = InputPullUp,
mbed_official 525:c320967f86b9 102 PullDown = InputPullDown,
mbed_official 525:c320967f86b9 103 OpenDrain = WiredAnd,
mbed_official 525:c320967f86b9 104 PullNone = PushPull,
mbed_official 593:78ee8643776a 105 PullDefault = PushPull
mbed_official 525:c320967f86b9 106 } PinMode;
mbed_official 525:c320967f86b9 107
mbed_official 525:c320967f86b9 108 #ifdef __cplusplus
mbed_official 525:c320967f86b9 109 }
mbed_official 525:c320967f86b9 110 #endif
mbed_official 525:c320967f86b9 111
mbed_official 525:c320967f86b9 112 #endif