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:
Fri Sep 25 14:15:10 2015 +0100
Revision:
627:4fa1328d9c60
Parent:
593:78ee8643776a
Synchronized with git revision fe238a91ab7a4d1d72c4cab9da04967c619d54ad

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

Silicon Labs - Add support for low-power async Serial

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 627:4fa1328d9c60 1 /***************************************************************************//**
mbed_official 627:4fa1328d9c60 2 * @file PinNames.h
mbed_official 627:4fa1328d9c60 3 *******************************************************************************
mbed_official 627:4fa1328d9c60 4 * @section License
mbed_official 627:4fa1328d9c60 5 * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
mbed_official 627:4fa1328d9c60 6 *******************************************************************************
mbed_official 525:c320967f86b9 7 *
mbed_official 627:4fa1328d9c60 8 * Permission is granted to anyone to use this software for any purpose,
mbed_official 627:4fa1328d9c60 9 * including commercial applications, and to alter it and redistribute it
mbed_official 627:4fa1328d9c60 10 * freely, subject to the following restrictions:
mbed_official 525:c320967f86b9 11 *
mbed_official 627:4fa1328d9c60 12 * 1. The origin of this software must not be misrepresented; you must not
mbed_official 627:4fa1328d9c60 13 * claim that you wrote the original software.
mbed_official 627:4fa1328d9c60 14 * 2. Altered source versions must be plainly marked as such, and must not be
mbed_official 627:4fa1328d9c60 15 * misrepresented as being the original software.
mbed_official 627:4fa1328d9c60 16 * 3. This notice may not be removed or altered from any source distribution.
mbed_official 525:c320967f86b9 17 *
mbed_official 627:4fa1328d9c60 18 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
mbed_official 627:4fa1328d9c60 19 * obligation to support this Software. Silicon Labs is providing the
mbed_official 627:4fa1328d9c60 20 * Software "AS IS", with no express or implied warranties of any kind,
mbed_official 627:4fa1328d9c60 21 * including, but not limited to, any implied warranties of merchantability
mbed_official 627:4fa1328d9c60 22 * or fitness for any particular purpose or warranties against infringement
mbed_official 627:4fa1328d9c60 23 * of any proprietary rights of a third party.
mbed_official 627:4fa1328d9c60 24 *
mbed_official 627:4fa1328d9c60 25 * Silicon Labs will not be liable for any consequential, incidental, or
mbed_official 627:4fa1328d9c60 26 * special damages, or any other relief, or for any claim by any third party,
mbed_official 627:4fa1328d9c60 27 * arising from your use of this Software.
mbed_official 627:4fa1328d9c60 28 *
mbed_official 627:4fa1328d9c60 29 ******************************************************************************/
mbed_official 525:c320967f86b9 30 #ifndef MBED_PINNAMES_H
mbed_official 525:c320967f86b9 31 #define MBED_PINNAMES_H
mbed_official 525:c320967f86b9 32
mbed_official 525:c320967f86b9 33 #include "cmsis.h"
mbed_official 525:c320967f86b9 34 #include "em_gpio.h"
mbed_official 525:c320967f86b9 35
mbed_official 525:c320967f86b9 36 #ifdef __cplusplus
mbed_official 525:c320967f86b9 37 extern "C" {
mbed_official 525:c320967f86b9 38 #endif
mbed_official 525:c320967f86b9 39
mbed_official 525:c320967f86b9 40 typedef enum {
mbed_official 525:c320967f86b9 41 PIN_INPUT = 0,
mbed_official 525:c320967f86b9 42 PIN_OUTPUT = 1
mbed_official 525:c320967f86b9 43 } PinDirection;
mbed_official 525:c320967f86b9 44
mbed_official 525:c320967f86b9 45 typedef enum {
mbed_official 525:c320967f86b9 46 /* EFM32 Pin Names
mbed_official 525:c320967f86b9 47 * First 4 bits represent pin number, the remaining
mbed_official 525:c320967f86b9 48 * bits represent port number (A = 0, B = 1, ...)
mbed_official 525:c320967f86b9 49 */
mbed_official 525:c320967f86b9 50 PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15,
mbed_official 525:c320967f86b9 51 PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15,
mbed_official 525:c320967f86b9 52 PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15,
mbed_official 525:c320967f86b9 53 PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15,
mbed_official 525:c320967f86b9 54 PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15,
mbed_official 525:c320967f86b9 55 PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15,
mbed_official 525:c320967f86b9 56
mbed_official 525:c320967f86b9 57 /* 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 58 LED0 = PE2,
mbed_official 525:c320967f86b9 59 LED1 = PE3,
mbed_official 525:c320967f86b9 60 LED2 = LED0,
mbed_official 525:c320967f86b9 61 LED3 = LED0,
mbed_official 525:c320967f86b9 62 LED4 = LED1,
mbed_official 525:c320967f86b9 63
mbed_official 525:c320967f86b9 64 /* Push Buttons */
mbed_official 525:c320967f86b9 65 SW0 = PB9,
mbed_official 525:c320967f86b9 66 SW1 = PB10,
mbed_official 525:c320967f86b9 67 BTN0 = SW0,
mbed_official 525:c320967f86b9 68 BTN1 = SW1,
mbed_official 525:c320967f86b9 69
mbed_official 525:c320967f86b9 70 /* Serial */
mbed_official 525:c320967f86b9 71 SERIAL_TX = PD0,
mbed_official 525:c320967f86b9 72 SERIAL_RX = PD1,
mbed_official 525:c320967f86b9 73 USBTX = PE0,
mbed_official 525:c320967f86b9 74 USBRX = PE1,
mbed_official 525:c320967f86b9 75 EFM_BC_EN = PF7,
mbed_official 525:c320967f86b9 76
mbed_official 525:c320967f86b9 77 /* Not connected */
mbed_official 525:c320967f86b9 78 NC = (int) 0xFFFFFFFF
mbed_official 525:c320967f86b9 79 } PinName;
mbed_official 525:c320967f86b9 80
mbed_official 525:c320967f86b9 81
mbed_official 525:c320967f86b9 82 /* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */
mbed_official 525:c320967f86b9 83 typedef enum {
mbed_official 525:c320967f86b9 84 /* EFM32 pin modes */
mbed_official 525:c320967f86b9 85 Disabled = gpioModeDisabled,
mbed_official 525:c320967f86b9 86 DisabledPullUp = gpioModeDisabled | 0x10,
mbed_official 525:c320967f86b9 87 Input = gpioModeInput,
mbed_official 525:c320967f86b9 88 InputFilter = gpioModeInput | 0x10,
mbed_official 525:c320967f86b9 89 InputPullDown = gpioModeInputPull,
mbed_official 525:c320967f86b9 90 InputPullUp = gpioModeInputPull | 0x10,
mbed_official 525:c320967f86b9 91 InputPullFilterDown = gpioModeInputPullFilter,
mbed_official 525:c320967f86b9 92 InputPullFilterUp = gpioModeInputPullFilter | 0x10,
mbed_official 525:c320967f86b9 93 PushPull = gpioModePushPull,
mbed_official 525:c320967f86b9 94 PushPullDrive = gpioModePushPullDrive,
mbed_official 525:c320967f86b9 95 WiredOr = gpioModeWiredOr,
mbed_official 525:c320967f86b9 96 WiredOrPullDown = gpioModeWiredOrPullDown,
mbed_official 525:c320967f86b9 97 WiredAnd = gpioModeWiredAnd,
mbed_official 525:c320967f86b9 98 WiredAndFilter = gpioModeWiredAndFilter,
mbed_official 525:c320967f86b9 99 WiredAndPullUp = gpioModeWiredAndPullUp,
mbed_official 525:c320967f86b9 100 WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter,
mbed_official 525:c320967f86b9 101 WiredAndDrive = gpioModeWiredAndDrive,
mbed_official 525:c320967f86b9 102 WiredAndDriveFilter = gpioModeWiredAndDriveFilter,
mbed_official 525:c320967f86b9 103 WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp,
mbed_official 525:c320967f86b9 104 WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter,
mbed_official 525:c320967f86b9 105
mbed_official 525:c320967f86b9 106 /* mbed modes:
mbed_official 525:c320967f86b9 107 * PullUp, PullDown, PullNone, OpenDrain
mbed_official 525:c320967f86b9 108 *
mbed_official 548:1abac31e188e 109 * mbed default digital input mode:
mbed_official 548:1abac31e188e 110 * PullDefault
mbed_official 525:c320967f86b9 111 *
mbed_official 525:c320967f86b9 112 * mbed default digital output mode:
mbed_official 525:c320967f86b9 113 * PullNone
mbed_official 525:c320967f86b9 114 */
mbed_official 525:c320967f86b9 115 PullUp = InputPullUp,
mbed_official 525:c320967f86b9 116 PullDown = InputPullDown,
mbed_official 525:c320967f86b9 117 OpenDrain = WiredAnd,
mbed_official 525:c320967f86b9 118 PullNone = PushPull,
mbed_official 593:78ee8643776a 119 PullDefault = PushPull
mbed_official 525:c320967f86b9 120 } PinMode;
mbed_official 525:c320967f86b9 121
mbed_official 525:c320967f86b9 122 #ifdef __cplusplus
mbed_official 525:c320967f86b9 123 }
mbed_official 525:c320967f86b9 124 #endif
mbed_official 525:c320967f86b9 125
mbed_official 525:c320967f86b9 126 #endif