Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BLE_Acceleration_Statejudging
Fork of nRF51822 by
source/nordic-sdk/components/libraries/util/common.h@509:7dc75f30064f, 2015-12-02 (annotated)
- Committer:
- rgrover1
- Date:
- Wed Dec 02 12:35:26 2015 +0000
- Revision:
- 509:7dc75f30064f
- Parent:
- 504:2179e57ad950
- Child:
- 512:521c3578f13d
Synchronized with git rev 60a7c0c0
Author: Rohit Grover
bring in the latest changes for BLE::init() where we allow <object, member> tuples for init callback.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rgrover1 | 509:7dc75f30064f | 1 | /* |
| rgrover1 | 371:8f7d2137727a | 2 | * Copyright (c) Nordic Semiconductor ASA |
| rgrover1 | 371:8f7d2137727a | 3 | * All rights reserved. |
| rgrover1 | 371:8f7d2137727a | 4 | * |
| rgrover1 | 371:8f7d2137727a | 5 | * Redistribution and use in source and binary forms, with or without modification, |
| rgrover1 | 371:8f7d2137727a | 6 | * are permitted provided that the following conditions are met: |
| rgrover1 | 371:8f7d2137727a | 7 | * |
| rgrover1 | 371:8f7d2137727a | 8 | * 1. Redistributions of source code must retain the above copyright notice, this |
| rgrover1 | 371:8f7d2137727a | 9 | * list of conditions and the following disclaimer. |
| rgrover1 | 371:8f7d2137727a | 10 | * |
| rgrover1 | 371:8f7d2137727a | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this |
| rgrover1 | 371:8f7d2137727a | 12 | * list of conditions and the following disclaimer in the documentation and/or |
| rgrover1 | 371:8f7d2137727a | 13 | * other materials provided with the distribution. |
| rgrover1 | 371:8f7d2137727a | 14 | * |
| rgrover1 | 371:8f7d2137727a | 15 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of other |
| rgrover1 | 371:8f7d2137727a | 16 | * contributors to this software may be used to endorse or promote products |
| rgrover1 | 371:8f7d2137727a | 17 | * derived from this software without specific prior written permission. |
| rgrover1 | 371:8f7d2137727a | 18 | * |
| rgrover1 | 371:8f7d2137727a | 19 | * |
| rgrover1 | 371:8f7d2137727a | 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| rgrover1 | 371:8f7d2137727a | 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| rgrover1 | 371:8f7d2137727a | 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| rgrover1 | 371:8f7d2137727a | 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
| rgrover1 | 371:8f7d2137727a | 24 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| rgrover1 | 371:8f7d2137727a | 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| rgrover1 | 371:8f7d2137727a | 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| rgrover1 | 371:8f7d2137727a | 27 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| rgrover1 | 371:8f7d2137727a | 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| rgrover1 | 371:8f7d2137727a | 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| rgrover1 | 371:8f7d2137727a | 30 | * |
| rgrover1 | 371:8f7d2137727a | 31 | */ |
| rgrover1 | 371:8f7d2137727a | 32 | |
| rgrover1 | 371:8f7d2137727a | 33 | #ifndef COMMON_H |
| rgrover1 | 371:8f7d2137727a | 34 | #define COMMON_H |
| rgrover1 | 371:8f7d2137727a | 35 | |
| rgrover1 | 371:8f7d2137727a | 36 | /*lint ++flb "Enter library region" */ |
| rgrover1 | 371:8f7d2137727a | 37 | |
| rgrover1 | 371:8f7d2137727a | 38 | #include <stdbool.h> |
| rgrover1 | 371:8f7d2137727a | 39 | #include <stdint.h> |
| rgrover1 | 371:8f7d2137727a | 40 | |
| rgrover1 | 371:8f7d2137727a | 41 | /* @file |
| rgrover1 | 371:8f7d2137727a | 42 | * @brief Common header file for generic macros and definitions |
| rgrover1 | 371:8f7d2137727a | 43 | * |
| rgrover1 | 371:8f7d2137727a | 44 | */ |
| rgrover1 | 371:8f7d2137727a | 45 | |
| rgrover1 | 371:8f7d2137727a | 46 | /* |
| rgrover1 | 371:8f7d2137727a | 47 | * GPIO glue macros, this can be used to define a pin number in source/header file and use that macro for pin |
| rgrover1 | 371:8f7d2137727a | 48 | * configuration using this expansion. |
| rgrover1 | 371:8f7d2137727a | 49 | * example: |
| rgrover1 | 371:8f7d2137727a | 50 | * #define RESET_PIN 8 |
| rgrover1 | 371:8f7d2137727a | 51 | * NRF_GPIO->PINCNF(RESET_PIN) = XXX ; // Expanded NRF_GPIO->PIN_CNF[8] = XXX |
| rgrover1 | 371:8f7d2137727a | 52 | */ |
| rgrover1 | 371:8f7d2137727a | 53 | #define PINX_GLUE(x, y, z) x##y##_##z /*!< first level glue for pin macros */ |
| rgrover1 | 371:8f7d2137727a | 54 | #define PINCNF(p) PINX_GLUE(PIN,p,CNF) /*!< gpio configure pin number 'p' */ |
| rgrover1 | 371:8f7d2137727a | 55 | #define PINOUT(p) PINX_GLUE(PIN,p,OUT) /*!< gpio out pin number 'p' */ |
| rgrover1 | 371:8f7d2137727a | 56 | |
| rgrover1 | 371:8f7d2137727a | 57 | /*lint --flb "Leave library region" */ |
| rgrover1 | 371:8f7d2137727a | 58 | #endif |
