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.
Dependencies: BLE_API_Native_IRC BLE_API mbed
nRF51822/nordic/nrf-sdk/nordic_common.h@1:48f6e08a3ac2, 2014-08-20 (annotated)
- Committer:
- jksoft
- Date:
- Wed Aug 20 13:24:20 2014 +0000
- Revision:
- 1:48f6e08a3ac2
2014.08.20?????BLE?????????????; ???mbed?????????????????; mbed HRM1017; Nordic nRF51822
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| jksoft | 1:48f6e08a3ac2 | 1 | /* Copyright (c) 2008 Nordic Semiconductor. All Rights Reserved. | 
| jksoft | 1:48f6e08a3ac2 | 2 | * | 
| jksoft | 1:48f6e08a3ac2 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. | 
| jksoft | 1:48f6e08a3ac2 | 4 | * Terms and conditions of usage are described in detail in NORDIC | 
| jksoft | 1:48f6e08a3ac2 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. | 
| jksoft | 1:48f6e08a3ac2 | 6 | * | 
| jksoft | 1:48f6e08a3ac2 | 7 | * Licensees are granted free, non-transferable use of the information. NO | 
| jksoft | 1:48f6e08a3ac2 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from | 
| jksoft | 1:48f6e08a3ac2 | 9 | * the file. | 
| jksoft | 1:48f6e08a3ac2 | 10 | */ | 
| jksoft | 1:48f6e08a3ac2 | 11 | |
| jksoft | 1:48f6e08a3ac2 | 12 | /** @file | 
| jksoft | 1:48f6e08a3ac2 | 13 | * @brief Common defines and macros for firmware developed by Nordic Semiconductor. | 
| jksoft | 1:48f6e08a3ac2 | 14 | */ | 
| jksoft | 1:48f6e08a3ac2 | 15 | |
| jksoft | 1:48f6e08a3ac2 | 16 | #ifndef NORDIC_COMMON_H__ | 
| jksoft | 1:48f6e08a3ac2 | 17 | #define NORDIC_COMMON_H__ | 
| jksoft | 1:48f6e08a3ac2 | 18 | |
| jksoft | 1:48f6e08a3ac2 | 19 | #include "nordic_global.h" | 
| jksoft | 1:48f6e08a3ac2 | 20 | |
| jksoft | 1:48f6e08a3ac2 | 21 | /** Swaps the upper byte with the lower byte in a 16 bit variable */ | 
| jksoft | 1:48f6e08a3ac2 | 22 | //lint -emacro((572),SWAP) // Suppress warning 572 "Excessive shift value" | 
| jksoft | 1:48f6e08a3ac2 | 23 | #define SWAP(x) ((((x)&0xFF)<<8)|(((x)>>8)&0xFF)) | 
| jksoft | 1:48f6e08a3ac2 | 24 | |
| jksoft | 1:48f6e08a3ac2 | 25 | /** The upper 8 bits of a 16 bit value */ | 
| jksoft | 1:48f6e08a3ac2 | 26 | //lint -emacro(572,MSB) // Suppress warning 572 "Excessive shift value" | 
| jksoft | 1:48f6e08a3ac2 | 27 | #define MSB(a) (((a) & 0xFF00) >> 8) | 
| jksoft | 1:48f6e08a3ac2 | 28 | /** The lower 8 bits (of a 16 bit value) */ | 
| jksoft | 1:48f6e08a3ac2 | 29 | #define LSB(a) ((a) & 0xFF) | 
| jksoft | 1:48f6e08a3ac2 | 30 | |
| jksoft | 1:48f6e08a3ac2 | 31 | /** Leaves the minimum of the two arguments */ | 
| jksoft | 1:48f6e08a3ac2 | 32 | /*lint -emacro(506, MIN) */ /* Suppress "Constant value Boolean */ | 
| jksoft | 1:48f6e08a3ac2 | 33 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) | 
| jksoft | 1:48f6e08a3ac2 | 34 | /** Leaves the maximum of the two arguments */ | 
| jksoft | 1:48f6e08a3ac2 | 35 | /*lint -emacro(506, MAX) */ /* Suppress "Constant value Boolean */ | 
| jksoft | 1:48f6e08a3ac2 | 36 | #define MAX(a, b) ((a) < (b) ? (b) : (a)) | 
| jksoft | 1:48f6e08a3ac2 | 37 | |
| jksoft | 1:48f6e08a3ac2 | 38 | #define BIT_0 0x01 /**< The value of bit 0 */ | 
| jksoft | 1:48f6e08a3ac2 | 39 | #define BIT_1 0x02 /**< The value of bit 1 */ | 
| jksoft | 1:48f6e08a3ac2 | 40 | #define BIT_2 0x04 /**< The value of bit 2 */ | 
| jksoft | 1:48f6e08a3ac2 | 41 | #define BIT_3 0x08 /**< The value of bit 3 */ | 
| jksoft | 1:48f6e08a3ac2 | 42 | #define BIT_4 0x10 /**< The value of bit 4 */ | 
| jksoft | 1:48f6e08a3ac2 | 43 | #define BIT_5 0x20 /**< The value of bit 5 */ | 
| jksoft | 1:48f6e08a3ac2 | 44 | #define BIT_6 0x40 /**< The value of bit 6 */ | 
| jksoft | 1:48f6e08a3ac2 | 45 | #define BIT_7 0x80 /**< The value of bit 7 */ | 
| jksoft | 1:48f6e08a3ac2 | 46 | #define BIT_8 0x0100 /**< The value of bit 8 */ | 
| jksoft | 1:48f6e08a3ac2 | 47 | #define BIT_9 0x0200 /**< The value of bit 9 */ | 
| jksoft | 1:48f6e08a3ac2 | 48 | #define BIT_10 0x0400 /**< The value of bit 10 */ | 
| jksoft | 1:48f6e08a3ac2 | 49 | #define BIT_11 0x0800 /**< The value of bit 11 */ | 
| jksoft | 1:48f6e08a3ac2 | 50 | #define BIT_12 0x1000 /**< The value of bit 12 */ | 
| jksoft | 1:48f6e08a3ac2 | 51 | #define BIT_13 0x2000 /**< The value of bit 13 */ | 
| jksoft | 1:48f6e08a3ac2 | 52 | #define BIT_14 0x4000 /**< The value of bit 14 */ | 
| jksoft | 1:48f6e08a3ac2 | 53 | #define BIT_15 0x8000 /**< The value of bit 15 */ | 
| jksoft | 1:48f6e08a3ac2 | 54 | #define BIT_16 0x00010000 /**< The value of bit 16 */ | 
| jksoft | 1:48f6e08a3ac2 | 55 | #define BIT_17 0x00020000 /**< The value of bit 17 */ | 
| jksoft | 1:48f6e08a3ac2 | 56 | #define BIT_18 0x00040000 /**< The value of bit 18 */ | 
| jksoft | 1:48f6e08a3ac2 | 57 | #define BIT_19 0x00080000 /**< The value of bit 19 */ | 
| jksoft | 1:48f6e08a3ac2 | 58 | #define BIT_20 0x00100000 /**< The value of bit 20 */ | 
| jksoft | 1:48f6e08a3ac2 | 59 | #define BIT_21 0x00200000 /**< The value of bit 21 */ | 
| jksoft | 1:48f6e08a3ac2 | 60 | #define BIT_22 0x00400000 /**< The value of bit 22 */ | 
| jksoft | 1:48f6e08a3ac2 | 61 | #define BIT_23 0x00800000 /**< The value of bit 23 */ | 
| jksoft | 1:48f6e08a3ac2 | 62 | #define BIT_24 0x01000000 /**< The value of bit 24 */ | 
| jksoft | 1:48f6e08a3ac2 | 63 | #define BIT_25 0x02000000 /**< The value of bit 25 */ | 
| jksoft | 1:48f6e08a3ac2 | 64 | #define BIT_26 0x04000000 /**< The value of bit 26 */ | 
| jksoft | 1:48f6e08a3ac2 | 65 | #define BIT_27 0x08000000 /**< The value of bit 27 */ | 
| jksoft | 1:48f6e08a3ac2 | 66 | #define BIT_28 0x10000000 /**< The value of bit 28 */ | 
| jksoft | 1:48f6e08a3ac2 | 67 | #define BIT_29 0x20000000 /**< The value of bit 29 */ | 
| jksoft | 1:48f6e08a3ac2 | 68 | #define BIT_30 0x40000000 /**< The value of bit 30 */ | 
| jksoft | 1:48f6e08a3ac2 | 69 | #define BIT_31 0x80000000 /**< The value of bit 31 */ | 
| jksoft | 1:48f6e08a3ac2 | 70 | |
| jksoft | 1:48f6e08a3ac2 | 71 | #define UNUSED_VARIABLE(X) ((void)(X)) | 
| jksoft | 1:48f6e08a3ac2 | 72 | #define UNUSED_PARAMETER(X) UNUSED_VARIABLE(X) | 
| jksoft | 1:48f6e08a3ac2 | 73 | |
| jksoft | 1:48f6e08a3ac2 | 74 | #endif // NORDIC_COMMON_H__ |