2014-06-11 14:59:24 +02:00
|
|
|
/*
|
2014-07-03 10:36:46 +02:00
|
|
|
* Copyright (C) 2014 Freie Universität Berlin
|
2014-06-11 14:59:24 +02:00
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
2014-07-03 10:36:46 +02:00
|
|
|
* Public License v2.1. See the file LICENSE in the top level directory for more
|
2014-06-11 14:59:24 +02:00
|
|
|
* details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup board_iot-lab_M3 iot-lab_M3
|
|
|
|
* @ingroup boards
|
|
|
|
* @brief Board specific files for the iot-lab_M3 board.
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Board specific definitions for the iot-lab_M3 board.
|
|
|
|
*
|
|
|
|
* @author Alaeddine Weslati <alaeddine.weslati@inria.fr>
|
|
|
|
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
|
|
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BOARD_H_
|
|
|
|
#define BOARD_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "cpu.h"
|
2014-09-30 11:22:22 +02:00
|
|
|
#include "periph_conf.h"
|
2014-06-11 14:59:24 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the nominal CPU core clock in this board
|
|
|
|
*/
|
2014-09-30 11:22:22 +02:00
|
|
|
#define F_CPU CLOCK_CORECLOCK
|
2014-06-11 14:59:24 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Define the UART to be used as stdio and its baudrate
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define STDIO UART_0
|
2014-09-11 16:16:44 +02:00
|
|
|
#define STDIO_BAUDRATE (115200U)
|
2014-09-25 17:39:55 +02:00
|
|
|
#define STDIO_RX_BUFSIZE (64U)
|
2014-06-11 14:59:24 +02:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Assign the hardware timer
|
|
|
|
*/
|
|
|
|
#define HW_TIMER TIMER_0
|
|
|
|
|
2014-09-29 20:33:22 +02:00
|
|
|
/**
|
|
|
|
* @name Define the interface to the AT86RF231 radio
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define AT86RF231_SPI SPI_0
|
|
|
|
#define AT86RF231_CS GPIO_11
|
|
|
|
#define AT86RF231_INT GPIO_12
|
|
|
|
#define AT86RF231_RESET GPIO_13
|
|
|
|
#define AT86RF231_SLEEP GPIO_14
|
|
|
|
/** @} */
|
|
|
|
|
2014-06-11 14:59:24 +02:00
|
|
|
/**
|
|
|
|
* @name LED pin definitions
|
|
|
|
* @{
|
|
|
|
*/
|
2014-07-03 10:36:46 +02:00
|
|
|
#define LED_RED_PORT (GPIOD)
|
|
|
|
#define LED_RED_PIN (2)
|
|
|
|
#define LED_GREEN_PORT (GPIOB)
|
|
|
|
#define LED_GREEN_PIN (5)
|
|
|
|
#define LED_ORANGE_PORT (GPIOC)
|
|
|
|
#define LED_ORANGE_PIN (10)
|
2014-06-11 14:59:24 +02:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Macros for controlling the on-board LEDs.
|
|
|
|
* @{
|
|
|
|
*/
|
2014-07-03 10:36:46 +02:00
|
|
|
#define LED_RED_ON (LED_RED_PORT->ODR &= ~(1<<LED_RED_PIN))
|
|
|
|
#define LED_RED_OFF (LED_RED_PORT->ODR |= (1<<LED_RED_PIN))
|
|
|
|
#define LED_RED_TOGGLE (LED_RED_PORT->ODR ^= (1<<LED_RED_PIN))
|
2014-06-11 14:59:24 +02:00
|
|
|
|
2014-07-03 10:36:46 +02:00
|
|
|
#define LED_GREEN_ON (LED_GREEN_PORT->ODR &= ~(1<<LED_GREEN_PIN))
|
|
|
|
#define LED_GREEN_OFF (LED_GREEN_PORT->ODR |= (1<<LED_GREEN_PIN))
|
|
|
|
#define LED_GREEN_TOGGLE (LED_GREEN_PORT->ODR ^= (1<<LED_GREEN_PIN))
|
2014-06-11 14:59:24 +02:00
|
|
|
|
2014-07-03 10:36:46 +02:00
|
|
|
#define LED_ORANGE_ON (LED_ORANGE_PORT->ODR &= ~(1<<LED_ORANGE_PIN))
|
|
|
|
#define LED_ORANGE_OFF (LED_ORANGE_PORT->ODR |= (1<<LED_ORANGE_PIN))
|
|
|
|
#define LED_ORANGE_TOGGLE (LED_ORANGE_PORT->ODR ^= (1<<LED_ORANGE_PIN))
|
2014-06-11 14:59:24 +02:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the type for the radio packet length for the transceiver
|
|
|
|
*/
|
|
|
|
typedef uint8_t radio_packet_length_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
|
|
|
*/
|
|
|
|
void board_init(void);
|
|
|
|
|
|
|
|
#endif /* BOARD_H_ */
|
|
|
|
/** @} */
|