A library for easier setup and prototyping of IoT devices (pucks), by collecting everything that is common for all pucks in one place.

Dependencies:   BLE_API nRF51822

Dependents:   ir-puck display-puck ir-puck2 BLE_ScoringDevice ... more

/media/uploads/stiaje/header.jpg

Introduction

Raspberry Pi took the maker community by storm when it launched in 2012. With its internet access it allowed small projects to be internet-of-things enabled. We have created a platform to take this one step further.

Our platform, called the Puck platform, is an internet of things platform for mbed. mbed makes it easy to program embedded hardware for people new to embedded systems. Our platform is built upon the first mbed chip with Bluetooth, the nRF51822 created by Nordic Semiconductor. We hope to create a community around these BLE devices where people contribute to the project, and share their designs with each other. Everything is open-source, of course, with lots of supporting materials.

We make it easy to rapidly prototype and develop Bluetooth LE enabled devices - get up and running in under 10 lines of code.

Tutorials and in-depth documentation is available at the project's GitHub page

Pucks

We've developed a handful of awesome examples to demonstrate the platform. These examples are named 'Pucks'. By talking to the internet through your smartphone, the barrier to creating your own Internet of Things device is lower than ever.

Committer:
Timmmm
Date:
Fri Jul 24 18:43:36 2015 +0000
Revision:
25:5ac5f1d1a11e
Parent:
24:cd6703df9501
Update for latest nRF51822 repo.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cristea 12:8a8cc109f048 1 /**
cristea 12:8a8cc109f048 2 * Copyright 2014 Nordic Semiconductor
cristea 12:8a8cc109f048 3 *
cristea 12:8a8cc109f048 4 * Licensed under the Apache License, Version 2.0 (the "License");
cristea 12:8a8cc109f048 5 * you may not use this file except in compliance with the License.
cristea 12:8a8cc109f048 6 * You may obtain a copy of the License at
cristea 12:8a8cc109f048 7 *
cristea 12:8a8cc109f048 8 * http://www.apache.org/licenses/LICENSE-2.0
cristea 12:8a8cc109f048 9 *
cristea 12:8a8cc109f048 10 * Unless required by applicable law or agreed to in writing, software
cristea 12:8a8cc109f048 11 * distributed under the License is distributed on an "AS IS" BASIS,
cristea 12:8a8cc109f048 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
cristea 12:8a8cc109f048 13 * See the License for the specific language governing permissions and
cristea 12:8a8cc109f048 14 * limitations under the License
cristea 12:8a8cc109f048 15 */
cristea 12:8a8cc109f048 16
cristea 7:c07c01c2a741 17 #ifndef __LOG__H__
cristea 7:c07c01c2a741 18 #define __LOG__H__
cristea 7:c07c01c2a741 19
aleksanb 24:cd6703df9501 20 /**
aleksanb 24:cd6703df9501 21 * Warning: remove LOG_LEVEL_* defines in production for major power savings.
aleksanb 24:cd6703df9501 22 *
aleksanb 24:cd6703df9501 23 * Defining a log level will set up a serial connection to use for logging.
aleksanb 24:cd6703df9501 24 * This serial connection sets up a timer prohibiting the mbed chip
aleksanb 24:cd6703df9501 25 * from entering low power states, drawing ~1.4mAh instead of ~20µAh with logging disabled.
aleksanb 24:cd6703df9501 26 */
cristea 7:c07c01c2a741 27
cristea 7:c07c01c2a741 28 #ifdef LOG_LEVEL_VERBOSE
cristea 7:c07c01c2a741 29 #define __PUCK_LOG_LEVEL_VERBOSE__
cristea 7:c07c01c2a741 30 #endif
cristea 7:c07c01c2a741 31 #ifdef LOG_LEVEL_DEBUG
cristea 7:c07c01c2a741 32 #define __PUCK_LOG_LEVEL_DEBUG__
cristea 7:c07c01c2a741 33 #endif
cristea 7:c07c01c2a741 34 #ifdef LOG_LEVEL_INFO
cristea 7:c07c01c2a741 35 #define __PUCK_LOG_LEVEL_INFO__
cristea 7:c07c01c2a741 36 #endif
cristea 7:c07c01c2a741 37 #ifdef LOG_LEVEL_WARN
cristea 7:c07c01c2a741 38 #define __PUCK_LOG_LEVEL_WARN__
cristea 7:c07c01c2a741 39 #endif
cristea 7:c07c01c2a741 40 #ifdef LOG_LEVEL_ERROR
cristea 7:c07c01c2a741 41 #define __PUCK_LOG_LEVEL_ERROR__
cristea 7:c07c01c2a741 42 #endif
cristea 7:c07c01c2a741 43
cristea 7:c07c01c2a741 44 #ifdef __PUCK_LOG_LEVEL_VERBOSE__
cristea 7:c07c01c2a741 45 #define LOG_VERBOSE(fmt, ...) do { logger.printf("[V] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 46 #define __PUCK_LOG_LEVEL_DEBUG__
cristea 7:c07c01c2a741 47 #else
cristea 7:c07c01c2a741 48 #define LOG_VERBOSE(fmt, ...)
cristea 7:c07c01c2a741 49 #endif
cristea 7:c07c01c2a741 50
cristea 7:c07c01c2a741 51 #ifdef __PUCK_LOG_LEVEL_DEBUG__
cristea 7:c07c01c2a741 52 #define LOG_DEBUG(fmt, ...) do { logger.printf("[D] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 53 #define __PUCK_LOG_LEVEL_INFO__
cristea 7:c07c01c2a741 54 #else
cristea 7:c07c01c2a741 55 #define LOG_DEBUG(fmt, ...)
cristea 7:c07c01c2a741 56 #endif
cristea 7:c07c01c2a741 57
cristea 7:c07c01c2a741 58 #ifdef __PUCK_LOG_LEVEL_INFO__
cristea 7:c07c01c2a741 59 #define LOG_INFO(fmt, ...) do { logger.printf("[I] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 60 #define __PUCK_LOG_LEVEL_WARN__
cristea 7:c07c01c2a741 61 #else
cristea 7:c07c01c2a741 62 #define LOG_INFO(fmt, ...)
cristea 7:c07c01c2a741 63 #endif
cristea 7:c07c01c2a741 64
cristea 7:c07c01c2a741 65 #ifdef __PUCK_LOG_LEVEL_WARN__
cristea 7:c07c01c2a741 66 #define LOG_WARN(fmt, ...) do { logger.printf("![W] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 67 #define __PUCK_LOG_LEVEL_ERROR__
cristea 7:c07c01c2a741 68 #else
cristea 7:c07c01c2a741 69 #define LOG_WARN(fmt, ...)
cristea 7:c07c01c2a741 70 #endif
cristea 7:c07c01c2a741 71
cristea 7:c07c01c2a741 72 #ifdef __PUCK_LOG_LEVEL_ERROR__
cristea 7:c07c01c2a741 73 #define LOG_ERROR(fmt, ...) do { logger.printf("!![E] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 74 #else
cristea 7:c07c01c2a741 75 #define LOG_ERROR(fmt, ...)
cristea 7:c07c01c2a741 76 #endif
cristea 7:c07c01c2a741 77
cristea 7:c07c01c2a741 78 #ifdef __PUCK_LOG_LEVEL_ERROR__
cristea 7:c07c01c2a741 79 static Serial logger(USBTX, USBRX);
cristea 7:c07c01c2a741 80 #endif
cristea 7:c07c01c2a741 81
cristea 7:c07c01c2a741 82
cristea 7:c07c01c2a741 83 #endif //__LOG__H__