New platform: TI cc2530 Development Kit

This commits adds support for TI's SmartRF05 Eval. Board with cc2530 EMs
Some initial support for cc2531 USB dongles
This commit is contained in:
George Oikonomou 2012-03-05 15:47:01 +00:00
parent b7674c3636
commit ad256e5014
68 changed files with 6824 additions and 0 deletions

View file

@ -0,0 +1,123 @@
/*
* Copyright (c) 2011, George Oikonomou - <oikonomou@users.sourceforge.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*/
/**
* \file
* ADC sensor module for TI SmartRF05EB devices.
*
* \author
* George Oikonomou - <oikonomou@users.sourceforge.net>
*/
#include "sfr-bits.h"
#include "cc253x.h"
#include "adc-sensor.h"
#if ADC_SENSOR_ON
/*---------------------------------------------------------------------------*/
static int
value(int type)
{
uint16_t reading;
/*
* For single-shot AD conversions, we may only write to ADCCON3[3:0] once
* (This write triggers the conversion). We thus use the variable 'command'
* to store intermediate steps (reference, decimation rate, input channel)
*/
uint8_t command;
/* 1.25V ref, max decimation rate */
command = ADCCON3_EDIV1 | ADCCON3_EDIV0;
/* Clear the Interrupt Flag */
ADCIF = 0;
/* Depending on the desired reading, append the input bits to 'command' and
* enable the corresponding input channel in ADCCFG if necessary */
switch(type) {
#if TEMP_SENSOR_ON
case ADC_SENSOR_TYPE_TEMP:
command |= ADCCON3_ECH3 | ADCCON3_ECH2 | ADCCON3_ECH1;
break;
#endif
#if VDD_SENSOR_ON
case ADC_SENSOR_TYPE_VDD:
command |= ADCCON3_ECH3 | ADCCON3_ECH2 | ADCCON3_ECH1 | ADCCON3_ECH0;
break;
#endif
default:
/* If the sensor is not present or disabled in conf, return -1 */
return -1;
}
/* Writing in bits 3:0 of ADCCON3 will trigger a single conversion */
ADCCON3 = command;
/*
* When the conversion is complete, the ADC interrupt flag is set. We don't
* use an ISR here, we just wait on the flag and clear it afterwards.
*/
while(!ADCIF);
/* Clear the Interrupt Flag */
ADCIF = 0;
reading = ADCL;
reading |= (((uint8_t) ADCH) << 8);
/* 12-bit decimation rate: 4 LS bits are noise */
reading >>= 4;
return reading;
}
/*---------------------------------------------------------------------------*/
static int
status(int type)
{
return 1;
}
/*---------------------------------------------------------------------------*/
static int
configure(int type, int value)
{
switch(type) {
case SENSORS_HW_INIT:
#if TEMP_SENSOR_ON
/* Connect temperature sensor to the SoC */
ATEST = 1;
TR0 = 1;
#endif
APCFG = 0; /* Disables Input Channels */
break;
}
return 1;
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(adc_sensor, ADC_SENSOR, value, configure, status);
#endif /* ADC_SENSOR_ON */

View file

@ -0,0 +1,82 @@
/*
* Copyright (c) 2011, George Oikonomou - <oikonomou@users.sourceforge.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*/
/**
* \file
* Header file for ADC sensors on the SmartRF05EB.
*
* Sensors will be off by default, unless turned on explicitly
* in contiki-conf.h
*
* \author
* George Oikonomou - <oikonomou@users.sourceforge.net>
*/
#ifndef __ADC_SENSOR_H__
#define __ADC_SENSOR_H__
#include "cc253x.h"
#include "contiki-conf.h"
#include "lib/sensors.h"
/* ADC Sensor Types */
#define ADC_SENSOR "ADC"
#define ADC_SENSOR_TYPE_TEMP 0
#define ADC_SENSOR_TYPE_VDD 4
#ifdef ADC_SENSOR_CONF_ON
#define ADC_SENSOR_ON ADC_SENSOR_CONF_ON
#endif /* ADC_SENSOR_CONF_ON */
#if ADC_SENSOR_ON
extern const struct sensors_sensor adc_sensor;
#define ADC_SENSOR_ACTIVATE() adc_sensor.configure(SENSORS_ACTIVE, 1)
#else
#define ADC_SENSOR_ACTIVATE()
#endif /* ADC_SENSOR_ON */
/* Battery - SmartRF stuff */
#ifdef BATTERY_SENSOR_CONF_ON
#define BATTERY_SENSOR_ON BATTERY_SENSOR_CONF_ON
#endif /* BATTERY_SENSOR_CONF_ON */
/* Temperature - Available on all devices */
#ifdef TEMP_SENSOR_CONF_ON
#define TEMP_SENSOR_ON TEMP_SENSOR_CONF_ON
#endif /* TEMP_SENSOR_CONF_ON */
/* Supply Voltage (VDD / 3) - Available on all devices*/
#ifdef VDD_SENSOR_CONF_ON
#define VDD_SENSOR_ON VDD_SENSOR_CONF_ON
#endif /* VDD_SENSOR_CONF_ON */
#endif /* __ADC_SENSOR_H__ */

View file

@ -0,0 +1,105 @@
/*
* Copyright (c) 2005, Swedish Institute of Computer Science
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*/
/*
* This file contains ISRs: Keep it in the HOME bank.
*/
#include "dev/port.h"
#include "dev/button-sensor.h"
/*---------------------------------------------------------------------------*/
#if BUTTON_SENSOR_ON
static __data struct timer debouncetimer;
/*---------------------------------------------------------------------------*/
static
int value(int type)
{
return BUTTON_READ() || !timer_expired(&debouncetimer);
}
/*---------------------------------------------------------------------------*/
static
int status(int type)
{
switch (type) {
case SENSORS_ACTIVE:
case SENSORS_READY:
return BUTTON_IRQ_ENABLED();
}
return 0;
}
/*---------------------------------------------------------------------------*/
static
int configure(int type, int value)
{
switch(type) {
case SENSORS_HW_INIT:
P0INP |= 2; /* Tri-state */
BUTTON_IRQ_ON_PRESS();
BUTTON_FUNC_GPIO();
BUTTON_DIR_INPUT();
return 1;
case SENSORS_ACTIVE:
if(value) {
if(!BUTTON_IRQ_ENABLED()) {
timer_set(&debouncetimer, 0);
BUTTON_IRQ_FLAG_OFF();
BUTTON_IRQ_ENABLE();
}
} else {
BUTTON_IRQ_DISABLE();
}
return 1;
}
return 0;
}
/*---------------------------------------------------------------------------*/
void
port_0_isr(void) __interrupt(P0INT_VECTOR)
{
EA = 0;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* This ISR is for the entire port. Check if the interrupt was caused by our
* button's pin. */
if(BUTTON_IRQ_CHECK()) {
if(timer_expired(&debouncetimer)) {
timer_set(&debouncetimer, CLOCK_SECOND / 8);
sensors_changed(&button_sensor);
}
}
BUTTON_IRQ_FLAG_OFF();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
EA = 1;
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(button_sensor, BUTTON_SENSOR, value, configure, status);
#endif /* BUTTON_SENSOR_ON */

View file

@ -0,0 +1,80 @@
/*
* Copyright (c) 2011, George Oikonomou - <oikonomou@users.sourceforge.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*/
/**
* \file
* Override core/dev/button-sensor.h
*
* \author
* George Oikonomou - <oikonomou@users.sourceforge.net>
*/
#ifndef __BUTTON_SENSOR_H__
#define __BUTTON_SENSOR_H__
#include "contiki-conf.h"
#include "lib/sensors.h"
#define BUTTON_PORT 0
#define BUTTON_PIN 1
#define BUTTON_SENSOR "Button"
/*
* SmartRF Buttons
* B1: P0_1, B2: Not Connected
*/
#ifdef BUTTON_SENSOR_CONF_ON
#define BUTTON_SENSOR_ON BUTTON_SENSOR_CONF_ON
#endif /* BUTTON_SENSOR_CONF_ON */
#if BUTTON_SENSOR_ON
extern const struct sensors_sensor button_sensor;
/* Button 1: P0_1 - Port 0 ISR needed */
void port_0_isr(void) __interrupt(P0INT_VECTOR);
#define BUTTON_SENSOR_ACTIVATE() button_sensor.configure(SENSORS_ACTIVE, 1)
#else
#define BUTTON_SENSOR_ACTIVATE()
#endif /* BUTTON_SENSOR_ON */
/* Define macros for button 1 */
#define BUTTON_READ() PORT_READ(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_FUNC_GPIO() PORT_FUNC_GPIO(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_DIR_INPUT() PORT_DIR_INPUT(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_IRQ_ENABLED() PORT_IRQ_ENABLED(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_IRQ_CHECK() PORT_IRQ_CHECK(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_IRQ_ENABLE() PORT_IRQ_ENABLE(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_IRQ_DISABLE() PORT_IRQ_DISABLE(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_IRQ_FLAG_OFF() PORT_IRQ_FLAG_OFF(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_IRQ_ON_PRESS() PORT_IRQ_EDGE_RISE(BUTTON_PORT, BUTTON_PIN)
#define BUTTON_IRQ_ON_RELEASE() PORT_IRQ_EDGE_FALL(BUTTON_PORT, BUTTON_PIN)
#endif /* __BUTTON_SENSOR_H__ */

View file

@ -0,0 +1,87 @@
/*
* Copyright (c) 2011, George Oikonomou - <oikonomou@users.sourceforge.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*/
/**
* \file
* Platform-specific led driver for the TI SmartRF05 Eval. Board.
*
* \author
* George Oikonomou - <oikonomou@users.sourceforge.net>
*/
#include "contiki-conf.h"
#include "dev/leds.h"
#include "dev/leds-arch.h"
#include "cc253x.h"
/*
* LEDS
* 1: P1_0
* 2: P1_1
* 3: P1_4
* 4: P0_1 (LED4 shares port/pin with B1 and is currently unused)
*/
/* H/W Connections */
#define LED1_PIN P1_0
#define LED2_PIN P1_1
#define LED3_PIN P1_4
/* P0DIR and P0SEL masks */
#define LED1_MASK 0x01
#define LED2_MASK 0x02
#define LED3_MASK 0x10
#define LED4_MASK 0x02
/*---------------------------------------------------------------------------*/
void
leds_arch_init(void)
{
P1SEL &= ~(LED1_MASK | LED2_MASK | LED3_MASK);
P1DIR |= (LED1_MASK | LED2_MASK | LED3_MASK);
}
/*---------------------------------------------------------------------------*/
unsigned char
leds_arch_get(void)
{
unsigned char v;
v = (unsigned char) (LED1_PIN | (LED2_PIN << 1) | (LED3_PIN << 2));
return v;
}
/*---------------------------------------------------------------------------*/
void
leds_arch_set(unsigned char leds)
{
LED1_PIN = leds & 0x01;
LED2_PIN = (leds & 0x02) >> 1;
LED3_PIN = (leds & 0x04) >> 2;
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,53 @@
/*
* Copyright (c) 2011, George Oikonomou - <oikonomou@users.sourceforge.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*/
/**
* \file
* Header file for platform-specific led functionality
*
* \author
* George Oikonomou - <oikonomou@users.sourceforge.net>
*/
#ifndef __LEDS_ARCH_H__
#define __LEDS_ARCH_H__
#include "dev/port.h"
/* Led 4 on the SmartRF05EB is multiplexed with Button 1 on P0_1 */
#define LED4_READ() PORT_READ(LED4_PORT, LED4_PIN)
#define LED4_WRITE(v) PORT_WRITE(LED4_PORT, LED4_PIN, v)
#define LED4_FUNC_GPIO() PORT_FUNC_GPIO(LED4_PORT, LED4_PIN)
#define LED4_DIR_INPUT() PORT_DIR_INPUT(LED4_PORT, LED4_PIN)
#define LED4_DIR_OUTPUT() PORT_DIR_OUTPUT(LED4_PORT, LED4_PIN)
#endif /* __LEDS_ARCH_H__ */

View file

@ -0,0 +1,50 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)$Id: slip_uart1.c,v 1.8 2008/02/03 20:59:35 adamdunkels Exp $
*/
/*
* Machine dependent cc2530eb SLIP routines for UART1.
*/
#include "dev/slip.h"
#include "dev/uart0.h"
/*---------------------------------------------------------------------------*/
void
slip_arch_writeb(unsigned char c)
{
uart0_writeb(c);
}
/*---------------------------------------------------------------------------*/
void
slip_arch_init(unsigned long ubr)
{
uart0_set_input(slip_input_byte);
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,54 @@
/*
* Copyright (c) 2011, George Oikonomou - <oikonomou@users.sourceforge.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*/
/**
* \file
* Data structures for SmartRF05EB sensing elements
*
* \author
* George Oikonomou - <oikonomou@users.sourceforge.net>
*/
#include "dev/button-sensor.h"
#include "dev/adc-sensor.h"
#include "sys/energest.h"
const struct sensors_sensor *sensors[] = {
#if ADC_SENSOR_ON
&adc_sensor,
#endif
#if BUTTON_SENSOR_ON
&button_sensor,
#endif
0
};
unsigned char sensors_flags[(sizeof(sensors) / sizeof(struct sensors_sensor *))];