-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4748 from alignan/pull/remote-update
RE-Mote revision A update
- Loading branch information
Showing
22 changed files
with
824 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
MODULE = board | ||
MODULE = remote-common | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.