Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/arduino-mega2560: cleanup in periph_conf.h #5021

Merged
merged 1 commit into from
Mar 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 15 additions & 33 deletions boards/arduino-mega2560/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,25 @@ extern "C" {
#endif

/**
* @name Clock configuration
* @brief Clock configuration
* @{
*/
#define CLOCK_CORECLOCK (16000000L)
/** @} */

/**
* @name Timer peripheral configuration
* @brief The ATmega2560 has 6 timers. Timer0 and Timer2 are 8 Bit Timers,
* Timer0 has special uses too and therefore we'll avoid using it.
* Timer5 has special uses with certain Arduino Shields, too.
* Therefore we'll also avoid using Timer5.
* This results in the following mapping to use the left over 16 Bit
* timers:
* @brief Timer peripheral configuration
*
* Timer1 -> TIMER_0
* Timer3 -> TIMER_1
* Timer4 -> TIMER_2
* The ATmega2560 has 6 timers. Timer0 and Timer2 are 8 Bit Timers,
* Timer0 has special uses too and therefore we'll avoid using it.
* Timer5 has special uses with certain Arduino Shields, too.
* Therefore we'll also avoid using Timer5.
* This results in the following mapping to use the left over 16 Bit
* timers:
*
* Timer1 -> TIMER_0
* Timer3 -> TIMER_1
* Timer4 -> TIMER_2
*
* @{
*/
Expand Down Expand Up @@ -133,9 +134,10 @@ extern "C" {
#define TIMER2_COMPA_ISR TIMER4_COMPA_vect
#define TIMER2_COMPB_ISR TIMER4_COMPB_vect
#define TIMER2_COMPC_ISR TIMER4_COMPC_vect
/** @} */

/**
* @name UART configuration
* @brief UART configuration
* @{
*/
#define UART_NUMOF (4U)
Expand Down Expand Up @@ -239,20 +241,7 @@ extern "C" {
#define UART3_SET_8BIT_SIZE UART3_CTRL_STAT_C |= UART3_8BIT_SIZE
#define UART3_RECEIVED_DATA (UART3_CTRL_STAT_A & (1 << UART3_RX_COMPLETE))
#define UART3_DTREG_EMPTY (UART3_CTRL_STAT_A & (1 << UART3_DATA_EMPTY))

/**
* @brief ADC configuration
*/
#define ADC_NUMOF (0U)
#define ADC_0_EN 0
#define ADC_1_EN 0

/**
* @brief PWM configuration
*/
#define PWM_NUMOF (0U)
#define PWM_0_EN 0
#define PWM_1_EN 0
/** @} */

/**
* @brief SPI configuration
Expand All @@ -272,13 +261,6 @@ extern "C" {
#define SPI_0_EN 1 /* remove once SPI rework is done */
/** @} */

/**
* @brief I2C configuration
*/
#define I2C_NUMOF (0U) /* TODO */
#define I2C_0_EN 0
#define I2C_0_EN 0

#ifdef __cplusplus
}
#endif
Expand Down