From fd8c0de3d282308e731297c8f55df93258c6271a Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 26 Aug 2015 18:41:22 +0200 Subject: [PATCH] cpu/msp430-common: simplified hwtimer configuration --- cpu/msp430-common/Makefile | 2 +- cpu/msp430-common/include/hwtimer_cpu.h | 63 +++++++------------------ 2 files changed, 18 insertions(+), 47 deletions(-) diff --git a/cpu/msp430-common/Makefile b/cpu/msp430-common/Makefile index aff6a1957f..93db83f9fb 100644 --- a/cpu/msp430-common/Makefile +++ b/cpu/msp430-common/Makefile @@ -1,3 +1,3 @@ -MODULE =msp430_common +MODULE = msp430_common include $(RIOTBASE)/Makefile.base diff --git a/cpu/msp430-common/include/hwtimer_cpu.h b/cpu/msp430-common/include/hwtimer_cpu.h index 5586c07594..ee52f8bea4 100644 --- a/cpu/msp430-common/include/hwtimer_cpu.h +++ b/cpu/msp430-common/include/hwtimer_cpu.h @@ -1,5 +1,6 @@ /* - * Copyright (C) 2014 Freie Universitaet Berlin (FUB) and INRIA. All rights reserved. + * Copyright (C) 2014 INRIA + * 2014, 2015 Freie Universität Berlin * * 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 @@ -7,66 +8,36 @@ */ /** - * @ingroup cpu_msp430_common + * @ingroup cpu_msp430-common * @{ - */ - -/** - * @file - * @brief msp430 hardware timer driver definitions * - * @author Freie Universitaet Berlin, Computer Systems and Telematics group + * @file + * @brief Hardware timer configuration for MSP430 based CPUs + * * @author Oliver Hahm * @author Kévin Roussel + * @author Hauke Petersen * */ #ifndef HWTIMER_CPU_H_ #define HWTIMER_CPU_H_ -#include - -#include "cpu.h" +#include "board.h" +#include "periph_conf.h" #ifdef __cplusplus extern "C" { #endif -#if defined (__MSP430_HAS_TA2__) -#define TIMER_A_MAXCOMP 2 -#elif defined (__MSP430_HAS_TA3__) -#define TIMER_A_MAXCOMP 3 -#elif defined (__MSP430_HAS_T0A5__) -#define TIMER_A_MAXCOMP 5 -#else -#define TIMER_A_MAXCOMP 0 -#endif - -#if defined (__MSP430_HAS_TB3__) -#define TIMER_B_MAXCOMP 3 -#elif defined (__MSP430_HAS_TB7__) -#define TIMER_B_MAXCOMP 7 -#else -#define TIMER_B_MAXCOMP 0 -#endif - -#define HWTIMER_MAXTIMERS (TIMER_A_MAXCOMP + TIMER_B_MAXCOMP) - -#ifndef HWTIMER_MAXTIMERS -#warning "HWTIMER_MAXTIMERS UNSET!" -#define HWTIMER_MAXTIMERS 0 -#endif - -typedef struct { - enum { - TIMER_A, - TIMER_B, - } base_timer; - uint8_t ccr_num; -} msp430_timer_t; - -#define HWTIMER_SPEED (F_RC_OSCILLATOR) -#define HWTIMER_MAXTICKS (0x0000FFFF) +/** + * @brief Hardware timer configuration + * @{ + */ +#define HWTIMER_MAXTIMERS (TIMER_CHAN) +#define HWTIMER_SPEED (F_RC_OSCILLATOR) +#define HWTIMER_MAXTICKS (0x0000FFFF) +/** @} */ #ifdef __cplusplus }