2016-09-05 21:12:47 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Freie Universität Berlin, Hinnerk van Bruinehsen
|
|
|
|
* 2016 Laurent Navet <laurent.navet@gmail.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2017-04-18 11:18:26 +02:00
|
|
|
/*
|
2017-11-30 23:34:07 +01:00
|
|
|
* @defgroup boards_common_arduino-atmega Arduino Atmega Common
|
|
|
|
* @ingroup boards_common
|
|
|
|
* @brief Shared files and configuration for Arduino Atmega boards.
|
2016-09-05 21:12:47 +02:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
2017-04-18 11:18:26 +02:00
|
|
|
* @brief Common board configuration for Arduino Atmega boards
|
2016-09-05 21:12:47 +02:00
|
|
|
*
|
|
|
|
* @author Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
|
|
|
|
* @author Laurent Navet <laurent.navet@gmail.com>
|
|
|
|
*/
|
|
|
|
|
2017-04-13 17:39:12 +02:00
|
|
|
#ifndef BOARD_COMMON_H
|
|
|
|
#define BOARD_COMMON_H
|
2016-09-05 21:12:47 +02:00
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "arduino_pinmap.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @name STDIO configuration
|
|
|
|
*
|
|
|
|
* As the CPU is too slow to handle 115200 baud, we set the default
|
|
|
|
* baudrate to 9600 for this board
|
2016-09-05 21:12:47 +02:00
|
|
|
* @{
|
|
|
|
*/
|
2018-07-05 14:09:08 +02:00
|
|
|
#define STDIO_UART_BAUDRATE (9600U)
|
2016-09-05 21:12:47 +02:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @name LED pin definitions and handlers
|
2016-09-05 21:12:47 +02:00
|
|
|
* @{
|
|
|
|
*/
|
2017-02-02 20:01:11 +01:00
|
|
|
#ifdef CPU_ATMEGA328P
|
2016-09-05 21:12:47 +02:00
|
|
|
#define LED0_PIN GPIO_PIN(1, 5)
|
|
|
|
#define LED0_MASK (1 << DDB5)
|
2017-02-02 20:01:11 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CPU_ATMEGA2560
|
|
|
|
#define LED0_PIN GPIO_PIN(1, 7)
|
|
|
|
#define LED0_MASK (1 << DDB7)
|
|
|
|
#endif
|
2016-09-05 21:12:47 +02:00
|
|
|
|
|
|
|
#define LED0_ON (PORTB |= LED0_MASK)
|
|
|
|
#define LED0_OFF (PORTB &= ~LED0_MASK)
|
|
|
|
#define LED0_TOGGLE (PORTB ^= LED0_MASK)
|
|
|
|
/** @} */
|
|
|
|
|
2018-09-21 18:51:32 +02:00
|
|
|
/**
|
|
|
|
* @name Usage of LED to turn on when a kernel panic occurs.
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define LED_PANIC LED0_ON
|
|
|
|
/** @} */
|
|
|
|
|
2018-09-21 19:23:31 +02:00
|
|
|
/**
|
|
|
|
* @name CPU clock scale for arduino boards
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define CPU_ATMEGA_CLK_SCALE_INIT CPU_ATMEGA_CLK_SCALE_DIV1
|
|
|
|
/** @} */
|
|
|
|
|
2016-09-05 21:12:47 +02:00
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @name xtimer configuration values
|
2016-09-05 21:12:47 +02:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define XTIMER_WIDTH (16)
|
2016-07-05 21:04:58 +02:00
|
|
|
#define XTIMER_HZ (250000UL)
|
2016-09-05 21:12:47 +02:00
|
|
|
#define XTIMER_BACKOFF (40)
|
|
|
|
/** @} */
|
|
|
|
|
2019-01-22 15:46:33 +01:00
|
|
|
/**
|
|
|
|
* @name Configuration parameters for the W5100 driver
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#ifndef W5100_PARAM_CS
|
|
|
|
#define W5100_PARAM_CS (ARDUINO_PIN_10)
|
|
|
|
#endif
|
|
|
|
#ifndef W5100_PARAM_EVT
|
|
|
|
#define W5100_PARAM_EVT (ARDUINO_PIN_2)
|
|
|
|
#endif
|
|
|
|
/** @} */
|
|
|
|
|
2016-09-05 21:12:47 +02:00
|
|
|
/**
|
2017-04-10 19:04:32 +02:00
|
|
|
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
2016-09-05 21:12:47 +02:00
|
|
|
*/
|
|
|
|
void board_init(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-04-13 17:39:12 +02:00
|
|
|
#endif /* BOARD_COMMON_H */
|
2016-09-05 21:12:47 +02:00
|
|
|
/** @} */
|