Skip to content

Commit

Permalink
Merge pull request #4748 from alignan/pull/remote-update
Browse files Browse the repository at this point in the history
RE-Mote revision A update
  • Loading branch information
PeterKietzmann authored Jun 30, 2016
2 parents 7b11a95 + 8d07c01 commit 4d7664c
Show file tree
Hide file tree
Showing 22 changed files with 824 additions and 102 deletions.
2 changes: 1 addition & 1 deletion boards/remote/Makefile → boards/remote-common/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MODULE = board
MODULE = remote-common

include $(RIOTBASE)/Makefile.base
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# define the cpu used by the Re-mote board
# define the cpu used by the RE-mote board
export CPU = cc2538
export CPU_MODEL = cc2538sf53

# define the default port depending on the host OS
PORT_LINUX ?= /dev/ttyUSB1
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
export CPU_MODEL = cc2538sf53

# define the default flash-tool
export PROGRAMMER ?= cc2538-bsl
Expand Down Expand Up @@ -32,5 +28,8 @@ export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE)
export RESET_FLAGS = $(BINDIR)
export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb

# include remote-common includes
export INCLUDES += -I$(RIOTBOARD)/remote-common/include

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
File renamed without changes.
File renamed without changes.
File renamed without changes.
96 changes: 96 additions & 0 deletions boards/remote-common/include/board_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* Copyright (C) 2014 Freie Universität Berlin
* Copyright (C) 2015 Zolertia SL
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/

/**
* @ingroup boards_remote
* @brief Support for the RE-Mote boards
* @{
*
* @file
* @brief Board specific definitions for the RE-Mote boards
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* Antonio Lignan <alinan@zolertia.com>
*/

#ifndef BOARD_COMMON__H
#define BOARD_COMMON__H

#include "cpu.h"
#include "periph/gpio.h"
#include "periph/spi.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @name Macros for controlling the on-board RGB LEDs
* @{
*/
#define LED_ALL_OFF LED0_OFF; \
LED1_OFF; \
LED2_OFF
/* Output is color white */
#define LED_ALL_ON LED0_ON; \
LED1_ON; \
LED2_ON

/* Yellow */
#define LED3_ON LED2_OFF; \
LED0_ON; \
LED1_ON
#define LED3_OFF LED1_OFF; \
LED0_OFF
#define LED3_TOGGLE LED1_TOGGLE; \
LED0_TOGGLE

/* Purple */
#define LED4_ON LED1_OFF; \
LED2_ON; \
LED0_ON
#define LED4_OFF LED2_OFF; \
LED0_OFF
#define LED4_TOGGLE LED2_TOGGLE; \
LED0_TOGGLE
/** @} */

/**
* @name Flash Customer Configuration Area (CCA) parameters
* @{
*/
#ifndef UPDATE_CCA
#define UPDATE_CCA (1)
#endif
#define CCA_BACKDOOR_ENABLE (1)
#define CCA_BACKDOOR_PORT_A_PIN (3) /**< Select button */
#define CCA_BACKDOOR_ACTIVE_LEVEL (0) /**< Active low */
/** @} */

/**
* @name xtimer configuration
* @{
*/
#define XTIMER TIMER_0
#define XTIMER_CHAN (0)
#define XTIMER_SHIFT (-4)
#define XTIMER_BACKOFF (50)
#define XTIMER_ISR_BACKOFF (40)
/** @} */

/**
* @brief Initialize board specific hardware
*/
void board_init(void);

#ifdef __cplusplus
} /* end extern "C" */
#endif
#endif /* BOARD_COMMON__H */
/** @} */
67 changes: 67 additions & 0 deletions boards/remote-common/include/fancy_leds.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2014 Freie Universität Berlin
* Copyright (C) 2015 Zolertia SL
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/

/**
* @ingroup boards_remote
* @brief LED extension
* @{
*
* @file
* @brief LED extended functions
*
* @author Antonio Lignan <alinan@zolertia.com>
*/

#ifndef FANCY_LEDS_H_
#define FANCY_LEDS_H_

#include "board_common.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @name Macro to create blinking and rainbows with the LEDs
* @{
*/
/* Take LED_COLOR as argument, i.e LED0 */
#define LED_FADE(led) \
volatile int i; \
int k, j; \
LED_FADE_EXPAND(led)

#define LED_FADE_EXPAND(led) \
for(k = 0; k < 800; ++k) { \
j = k > 400 ? 800 - k : k; \
led##_ON; \
for(i = 0; i < j; ++i) { \
asm("nop"); \
} \
led##_OFF; \
for(i = 0; i < 400 - j; ++i) { \
asm("nop"); \
} \
}

#define LED_RAINBOW() \
volatile int i; \
int k,j; \
LED_FADE_EXPAND(LED3); \
LED_FADE_EXPAND(LED0); \
LED_FADE_EXPAND(LED4); \
LED_FADE_EXPAND(LED2); \
LED_FADE_EXPAND(LED1);
/** @} */

#ifdef __cplusplus
} /* end extern "C" */
#endif
#endif /* FANCY_LEDS_H_ */
/** @} */
92 changes: 92 additions & 0 deletions boards/remote-common/include/periph_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright (C) 2014 Freie Universität Berlin
* Copyright (C) 2015 Zolertia SL
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/

/**
* @ingroup boards_remote
* @{
*
* @file
* @brief Peripheral MCU configuration for the Re-Mote boards
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* Antonio Lignan <alinan@zolertia.com>
*/

#ifndef PERIPH_COMMON_H_
#define PERIPH_COMMON_H_

#include "cc2538_gpio.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @name Clock system configuration
* @{
*/
#define CLOCK_CORECLOCK (32000000U) /* 32MHz */
/** @} */

/**
* @name Timer configuration
* @{
*/
#define TIMER_NUMOF (4U)
#define TIMER_0_EN 1
#define TIMER_1_EN 1
#define TIMER_2_EN 1
#define TIMER_3_EN 1

#define TIMER_IRQ_PRIO 1

/* Timer 0 configuration */
#define TIMER_0_DEV GPTIMER0
#define TIMER_0_CHANNELS 1
#define TIMER_0_MAX_VALUE 0xffffffff
#define TIMER_0_IRQn_1 GPTIMER_0A_IRQn
#define TIMER_0_IRQn_2 GPTIMER_0B_IRQn
#define TIMER_0_ISR_1 isr_timer0_chan0
#define TIMER_0_ISR_2 isr_timer0_chan1

/* Timer 1 configuration */
#define TIMER_1_DEV GPTIMER1
#define TIMER_1_CHANNELS 1
#define TIMER_1_MAX_VALUE 0xffffffff
#define TIMER_1_IRQn_1 GPTIMER_1A_IRQn
#define TIMER_1_IRQn_2 GPTIMER_1B_IRQn
#define TIMER_1_ISR_1 isr_timer1_chan0
#define TIMER_1_ISR_2 isr_timer1_chan1

/* Timer 2 configuration */
#define TIMER_2_DEV GPTIMER2
#define TIMER_2_CHANNELS 1
#define TIMER_2_MAX_VALUE 0xffffffff
#define TIMER_2_IRQn_1 GPTIMER_2A_IRQn
#define TIMER_2_IRQn_2 GPTIMER_2B_IRQn
#define TIMER_2_ISR_1 isr_timer2_chan0
#define TIMER_2_ISR_2 isr_timer2_chan1

/* Timer 3 configuration */
#define TIMER_3_DEV GPTIMER3
#define TIMER_3_CHANNELS 1
#define TIMER_3_MAX_VALUE 0xffffffff
#define TIMER_3_IRQn_1 GPTIMER_3A_IRQn
#define TIMER_3_IRQn_2 GPTIMER_3B_IRQn
#define TIMER_3_ISR_1 isr_timer3_chan0
#define TIMER_3_ISR_2 isr_timer3_chan1
/** @} */

#ifdef __cplusplus
} /* end extern "C" */
#endif

#endif /* PERIPH_COMMON_H_ */
/** @} */
5 changes: 5 additions & 0 deletions boards/remote-pa/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MODULE = board

DIRS = $(RIOTBOARD)/remote-common

include $(RIOTBASE)/Makefile.base
File renamed without changes.
7 changes: 7 additions & 0 deletions boards/remote-pa/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
USEMODULE += remote-common

# define the default port depending on the host OS
PORT_LINUX ?= /dev/ttyUSB1
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))

include $(RIOTBOARD)/remote-common/Makefile.include
14 changes: 7 additions & 7 deletions boards/remote/README.md → boards/remote-pa/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Zolertia Re-Mote platform
Zolertia RE-Mote platform
============================================

<a href="url"><img src="http://goo.gl/3AGZkI" align="center" height="320" ></a>

The Re-Mote platform is a IoT Hardware development platform based on TI's CC2538
system on chip (SoC), featuring an ARM Cortex-M3 with 512KB flash, 32Kb RAM,
double RF interface, and the following goodies:
The RE-Mote platform (prototype A) is a IoT Hardware development platform based
on TI's CC2538 system on chip (SoC), featuring an ARM Cortex-M3 with 512KB
flash, 32Kb RAM, double RF interface, and the following goodies:

* ISM 2.4-GHz IEEE 802.15.4 & Zigbee compliant.
* ISM 868-, 915-, 920-, 950-MHz ISM/SRD Band.
Expand All @@ -18,6 +18,9 @@ double RF interface, and the following goodies:
* Built-in TMP102 temperature sensor
* Small form-factor (as the Z1 mote, half the size of an Arduino) 57x35 mm.

This version was the first RE-Mote prototype, available to select users and beta
testers. A commercially available new model (namely the Revision A) is also
ported to RIOT.

Port Features
=============
Expand All @@ -36,7 +39,6 @@ In terms of hardware support, the following drivers have been implemented:
And under work or pending at cc2538 base cpu:

* RF 2.4GHz built-in in CC2538 (PR #2198)
* SPI/I2C library
* Built-in core temperature and battery sensor.
* TMP102 temperature sensor driver.
* CC1120 sub-1GHz radio interface.
Expand Down Expand Up @@ -108,10 +110,8 @@ On Linux:

More Reading
============
1. [Zolertia Re-Mote website][remote-site]
2. [CC2538 System-on-Chip Solution for 2.4-GHz IEEE 802.15.4 and ZigBee applications (SWRU319B)][cc2538]
3. [CC1120 sub-1GHz RF transceiver][cc1120]

[remote-site]: http://www.zolertia.io/products "Zolertia Re-Mote"
[cc1120]: http://www.ti.com/cc1120 "CC1120"
[cc2538]: http://www.ti.com/product/cc2538 "CC2538"
6 changes: 6 additions & 0 deletions boards/remote/board.c → boards/remote-pa/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "board.h"
#include "cpu.h"
#include "fancy_leds.h"

static inline void rf_switch_init(void);

Expand All @@ -31,10 +32,15 @@ void board_init(void)
gpio_init(LED0_PIN, GPIO_OUT);
gpio_init(LED1_PIN, GPIO_OUT);
gpio_init(LED2_PIN, GPIO_OUT);

/* initialize the CPU */
cpu_init();

/* initialize the 2.4GHz RF switch */
rf_switch_init();

/* Shoot rainbows */
LED_RAINBOW();
}

/**
Expand Down
Loading

0 comments on commit 4d7664c

Please sign in to comment.