To get started with Seeed Tiny BLE, include detecting motion, button and battery level.

Dependencies:   BLE_API eMPL_MPU6050 mbed nRF51822

Committer:
yihui
Date:
Wed Apr 22 07:47:17 2015 +0000
Revision:
1:fc2f9d636751
update libraries; ; delete nRF51822/nordic-sdk/components/gpiote/app_gpiote.c to solve GPIOTE_IRQHandler multiply defined issue. temperarily change nRF51822 library to folder

Who changed what in which revision?

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