changed low freq. clock source to IRC

Dependents:   BLE_ANCS_SDAPI_IRC

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nordic_common.h Source File

nordic_common.h

Go to the documentation of this file.
00001 /* Copyright (c) 2008 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is property of Nordic Semiconductor ASA.
00004  * Terms and conditions of usage are described in detail in NORDIC
00005  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  */ 
00011 
00012 /** @file
00013  * @brief Common defines and macros for firmware developed by Nordic Semiconductor.
00014  */
00015 
00016 #ifndef NORDIC_COMMON_H__
00017 #define NORDIC_COMMON_H__
00018 
00019 #include "nordic_global.h"
00020 
00021 /** Swaps the upper byte with the lower byte in a 16 bit variable */
00022 //lint -emacro((572),SWAP) // Suppress warning 572 "Excessive shift value"
00023 #define SWAP(x) ((((x)&0xFF)<<8)|(((x)>>8)&0xFF))
00024 
00025 /** The upper 8 bits of a 16 bit value */
00026 #define MSB(a) (((a) & 0xFF00) >> 8)
00027 /** The lower 8 bits (of a 16 bit value) */
00028 #define LSB(a) ((a) & 0xFF)
00029 
00030 /** Leaves the minimum of the two arguments */
00031 /*lint -emacro(506, MIN) */ /* Suppress "Constant value Boolean */ 
00032 #define MIN(a, b) ((a) < (b) ? (a) : (b))
00033 /** Leaves the maximum of the two arguments */
00034 /*lint -emacro(506, MAX) */ /* Suppress "Constant value Boolean */ 
00035 #define MAX(a, b) ((a) < (b) ? (b) : (a))
00036 
00037 #define BIT_0 0x01 /**< The value of bit 0 */
00038 #define BIT_1 0x02 /**< The value of bit 1 */
00039 #define BIT_2 0x04 /**< The value of bit 2 */
00040 #define BIT_3 0x08 /**< The value of bit 3 */
00041 #define BIT_4 0x10 /**< The value of bit 4 */
00042 #define BIT_5 0x20 /**< The value of bit 5 */
00043 #define BIT_6 0x40 /**< The value of bit 6 */
00044 #define BIT_7 0x80 /**< The value of bit 7 */
00045 #define BIT_8 0x0100 /**< The value of bit 8 */
00046 #define BIT_9 0x0200 /**< The value of bit 9 */
00047 #define BIT_10 0x0400 /**< The value of bit 10 */
00048 #define BIT_11 0x0800 /**< The value of bit 11 */
00049 #define BIT_12 0x1000 /**< The value of bit 12 */
00050 #define BIT_13 0x2000 /**< The value of bit 13 */
00051 #define BIT_14 0x4000 /**< The value of bit 14 */
00052 #define BIT_15 0x8000 /**< The value of bit 15 */
00053 #define BIT_16 0x00010000 /**< The value of bit 16 */
00054 #define BIT_17 0x00020000 /**< The value of bit 17 */
00055 #define BIT_18 0x00040000 /**< The value of bit 18 */
00056 #define BIT_19 0x00080000 /**< The value of bit 19 */
00057 #define BIT_20 0x00100000 /**< The value of bit 20 */
00058 #define BIT_21 0x00200000 /**< The value of bit 21 */
00059 #define BIT_22 0x00400000 /**< The value of bit 22 */
00060 #define BIT_23 0x00800000 /**< The value of bit 23 */
00061 #define BIT_24 0x01000000 /**< The value of bit 24 */
00062 #define BIT_25 0x02000000 /**< The value of bit 25 */
00063 #define BIT_26 0x04000000 /**< The value of bit 26 */
00064 #define BIT_27 0x08000000 /**< The value of bit 27 */
00065 #define BIT_28 0x10000000 /**< The value of bit 28 */
00066 #define BIT_29 0x20000000 /**< The value of bit 29 */
00067 #define BIT_30 0x40000000 /**< The value of bit 30 */
00068 #define BIT_31 0x80000000 /**< The value of bit 31 */
00069 
00070 #define UNUSED_VARIABLE(X)  ((void)(X))
00071 #define UNUSED_PARAMETER(X) UNUSED_VARIABLE(X)
00072 
00073 #endif // NORDIC_COMMON_H__