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 /* mbed Microcontroller Library
yihui 1:fc2f9d636751 2 * Copyright (c) 2006-2013 ARM Limited
yihui 1:fc2f9d636751 3 *
yihui 1:fc2f9d636751 4 * Licensed under the Apache License, Version 2.0 (the "License");
yihui 1:fc2f9d636751 5 * you may not use this file except in compliance with the License.
yihui 1:fc2f9d636751 6 * You may obtain a copy of the License at
yihui 1:fc2f9d636751 7 *
yihui 1:fc2f9d636751 8 * http://www.apache.org/licenses/LICENSE-2.0
yihui 1:fc2f9d636751 9 *
yihui 1:fc2f9d636751 10 * Unless required by applicable law or agreed to in writing, software
yihui 1:fc2f9d636751 11 * distributed under the License is distributed on an "AS IS" BASIS,
yihui 1:fc2f9d636751 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
yihui 1:fc2f9d636751 13 * See the License for the specific language governing permissions and
yihui 1:fc2f9d636751 14 * limitations under the License.
yihui 1:fc2f9d636751 15 */
yihui 1:fc2f9d636751 16
yihui 1:fc2f9d636751 17 #ifndef __NRF51822_H__
yihui 1:fc2f9d636751 18 #define __NRF51822_H__
yihui 1:fc2f9d636751 19
yihui 1:fc2f9d636751 20 #include "mbed.h"
yihui 1:fc2f9d636751 21 #include "blecommon.h"
yihui 1:fc2f9d636751 22 #include "BLEDevice.h"
yihui 1:fc2f9d636751 23 #include "nRF51Gap.h"
yihui 1:fc2f9d636751 24 #include "nRF51GattServer.h"
yihui 1:fc2f9d636751 25
yihui 1:fc2f9d636751 26 class nRF51822n : public BLEDeviceInstanceBase
yihui 1:fc2f9d636751 27 {
yihui 1:fc2f9d636751 28 public:
yihui 1:fc2f9d636751 29 nRF51822n(void);
yihui 1:fc2f9d636751 30 virtual ~nRF51822n(void);
yihui 1:fc2f9d636751 31
yihui 1:fc2f9d636751 32 virtual const char *getVersion(void);
yihui 1:fc2f9d636751 33
yihui 1:fc2f9d636751 34 virtual Gap &getGap() {
yihui 1:fc2f9d636751 35 return nRF51Gap::getInstance();
yihui 1:fc2f9d636751 36 };
yihui 1:fc2f9d636751 37 virtual GattServer &getGattServer() {
yihui 1:fc2f9d636751 38 return nRF51GattServer::getInstance();
yihui 1:fc2f9d636751 39 };
yihui 1:fc2f9d636751 40
yihui 1:fc2f9d636751 41 virtual ble_error_t setTxPower(int8_t txPower);
yihui 1:fc2f9d636751 42 virtual void getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP);
yihui 1:fc2f9d636751 43
yihui 1:fc2f9d636751 44 virtual ble_error_t init(void);
yihui 1:fc2f9d636751 45 virtual ble_error_t shutdown(void);
yihui 1:fc2f9d636751 46 virtual ble_error_t reset(void);
yihui 1:fc2f9d636751 47 virtual void waitForEvent(void);
yihui 1:fc2f9d636751 48 };
yihui 1:fc2f9d636751 49
yihui 1:fc2f9d636751 50 #endif