Generic communication interface between the wireless board (mote) and the sensor board. Any kind of sensor board can be connected to the mote using this specification given it provides a SPI peripheral, one input pin with interrupt capability and one digital output. The sensor board must implement a special register set from which all required information can be retrieved. Protocol: http://is.gd/wuQorh Github: http://is.gd/ySj1L9

Dependencies:   mbed-src

Committer:
marcelobarrosalmeida
Date:
Tue Apr 08 16:34:20 2014 +0000
Revision:
1:acdf490d94a7
Adding accel to sensor list

Who changed what in which revision?

UserRevisionLine numberNew contents of line
marcelobarrosalmeida 1:acdf490d94a7 1 /*
marcelobarrosalmeida 1:acdf490d94a7 2 * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
marcelobarrosalmeida 1:acdf490d94a7 3 * All rights reserved.
marcelobarrosalmeida 1:acdf490d94a7 4 *
marcelobarrosalmeida 1:acdf490d94a7 5 * Redistribution and use in source and binary forms, with or without
marcelobarrosalmeida 1:acdf490d94a7 6 * modification, are permitted provided that the following conditions
marcelobarrosalmeida 1:acdf490d94a7 7 * are met:
marcelobarrosalmeida 1:acdf490d94a7 8 * 1. Redistributions of source code must retain the above copyright
marcelobarrosalmeida 1:acdf490d94a7 9 * notice, this list of conditions and the following disclaimer.
marcelobarrosalmeida 1:acdf490d94a7 10 * 2. Redistributions in binary form must reproduce the above copyright
marcelobarrosalmeida 1:acdf490d94a7 11 * notice, this list of conditions and the following disclaimer in the
marcelobarrosalmeida 1:acdf490d94a7 12 * documentation and/or other materials provided with the distribution.
marcelobarrosalmeida 1:acdf490d94a7 13 * 3. Neither the name of the Institute nor the names of its contributors
marcelobarrosalmeida 1:acdf490d94a7 14 * may be used to endorse or promote products derived from this software
marcelobarrosalmeida 1:acdf490d94a7 15 * without specific prior written permission.
marcelobarrosalmeida 1:acdf490d94a7 16 *
marcelobarrosalmeida 1:acdf490d94a7 17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
marcelobarrosalmeida 1:acdf490d94a7 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
marcelobarrosalmeida 1:acdf490d94a7 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
marcelobarrosalmeida 1:acdf490d94a7 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
marcelobarrosalmeida 1:acdf490d94a7 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
marcelobarrosalmeida 1:acdf490d94a7 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
marcelobarrosalmeida 1:acdf490d94a7 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
marcelobarrosalmeida 1:acdf490d94a7 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
marcelobarrosalmeida 1:acdf490d94a7 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
marcelobarrosalmeida 1:acdf490d94a7 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
marcelobarrosalmeida 1:acdf490d94a7 27 * SUCH DAMAGE.
marcelobarrosalmeida 1:acdf490d94a7 28 *
marcelobarrosalmeida 1:acdf490d94a7 29 * This file is part of the Contiki operating system.
marcelobarrosalmeida 1:acdf490d94a7 30 *
marcelobarrosalmeida 1:acdf490d94a7 31 * Author: Adam Dunkels <adam@sics.se>
marcelobarrosalmeida 1:acdf490d94a7 32 *
marcelobarrosalmeida 1:acdf490d94a7 33 * $Id: lc-switch.h,v 1.4 2006/06/03 11:29:43 adam Exp $
marcelobarrosalmeida 1:acdf490d94a7 34 */
marcelobarrosalmeida 1:acdf490d94a7 35
marcelobarrosalmeida 1:acdf490d94a7 36 /**
marcelobarrosalmeida 1:acdf490d94a7 37 * \addtogroup lc
marcelobarrosalmeida 1:acdf490d94a7 38 * @{
marcelobarrosalmeida 1:acdf490d94a7 39 */
marcelobarrosalmeida 1:acdf490d94a7 40
marcelobarrosalmeida 1:acdf490d94a7 41 /**
marcelobarrosalmeida 1:acdf490d94a7 42 * \file
marcelobarrosalmeida 1:acdf490d94a7 43 * Implementation of local continuations based on switch() statment
marcelobarrosalmeida 1:acdf490d94a7 44 * \author Adam Dunkels <adam@sics.se>
marcelobarrosalmeida 1:acdf490d94a7 45 *
marcelobarrosalmeida 1:acdf490d94a7 46 * This implementation of local continuations uses the C switch()
marcelobarrosalmeida 1:acdf490d94a7 47 * statement to resume execution of a function somewhere inside the
marcelobarrosalmeida 1:acdf490d94a7 48 * function's body. The implementation is based on the fact that
marcelobarrosalmeida 1:acdf490d94a7 49 * switch() statements are able to jump directly into the bodies of
marcelobarrosalmeida 1:acdf490d94a7 50 * control structures such as if() or while() statmenets.
marcelobarrosalmeida 1:acdf490d94a7 51 *
marcelobarrosalmeida 1:acdf490d94a7 52 * This implementation borrows heavily from Simon Tatham's coroutines
marcelobarrosalmeida 1:acdf490d94a7 53 * implementation in C:
marcelobarrosalmeida 1:acdf490d94a7 54 * http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
marcelobarrosalmeida 1:acdf490d94a7 55 */
marcelobarrosalmeida 1:acdf490d94a7 56
marcelobarrosalmeida 1:acdf490d94a7 57 #ifndef __LC_SWITCH_H__
marcelobarrosalmeida 1:acdf490d94a7 58 #define __LC_SWITCH_H__
marcelobarrosalmeida 1:acdf490d94a7 59
marcelobarrosalmeida 1:acdf490d94a7 60 /* WARNING! lc implementation using switch() does not work if an
marcelobarrosalmeida 1:acdf490d94a7 61 LC_SET() is done within another switch() statement! */
marcelobarrosalmeida 1:acdf490d94a7 62
marcelobarrosalmeida 1:acdf490d94a7 63 /** \hideinitializer */
marcelobarrosalmeida 1:acdf490d94a7 64 typedef unsigned short lc_t;
marcelobarrosalmeida 1:acdf490d94a7 65
marcelobarrosalmeida 1:acdf490d94a7 66 #define LC_INIT(s) s = 0;
marcelobarrosalmeida 1:acdf490d94a7 67
marcelobarrosalmeida 1:acdf490d94a7 68 #define LC_RESUME(s) switch(s) { case 0:
marcelobarrosalmeida 1:acdf490d94a7 69
marcelobarrosalmeida 1:acdf490d94a7 70 #define LC_SET(s) s = __LINE__; case __LINE__:
marcelobarrosalmeida 1:acdf490d94a7 71
marcelobarrosalmeida 1:acdf490d94a7 72 #define LC_END(s) }
marcelobarrosalmeida 1:acdf490d94a7 73
marcelobarrosalmeida 1:acdf490d94a7 74 #endif /* __LC_SWITCH_H__ */
marcelobarrosalmeida 1:acdf490d94a7 75
marcelobarrosalmeida 1:acdf490d94a7 76 /** @} */