From 70cbff9255ab2f8e07148fee747c5b428640fe0f Mon Sep 17 00:00:00 2001 From: Oliver Hahm Date: Fri, 29 Oct 2010 17:32:03 +0200 Subject: [PATCH] * added support for sht11 for msb-430-common * fixed some jamfile isssues for msb-430 * fixed arch32 detection for scheduler * changed sht11 driver to be platform independent --- msb-430-common/Jamrules.msb-430-common | 1 + msb-430-common/board_init.c | 2 +- msb-430-common/drivers/include/sht11-board.h | 61 ++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 msb-430-common/drivers/include/sht11-board.h diff --git a/msb-430-common/Jamrules.msb-430-common b/msb-430-common/Jamrules.msb-430-common index db12fc6763..bfe5a1a6f8 100644 --- a/msb-430-common/Jamrules.msb-430-common +++ b/msb-430-common/Jamrules.msb-430-common @@ -34,3 +34,4 @@ FLASHFLAGS ?= -d $(FLASH_PORT) -j uif ; RESET ?= $(FLASHER) $(FLASHFLAGS) reset ; +HDRS += [ FPath $(TOP) board msb-430-common drivers include ] ; diff --git a/msb-430-common/board_init.c b/msb-430-common/board_init.c index 7dee70e3b1..4673600445 100644 --- a/msb-430-common/board_init.c +++ b/msb-430-common/board_init.c @@ -201,7 +201,7 @@ void board_init() { msp430_cpu_init(); msb_ports_init(); - RED_ON; + LED_RED_ON; msp430_set_cpu_speed(7372800uL); } diff --git a/msb-430-common/drivers/include/sht11-board.h b/msb-430-common/drivers/include/sht11-board.h new file mode 100644 index 0000000000..a4debd4473 --- /dev/null +++ b/msb-430-common/drivers/include/sht11-board.h @@ -0,0 +1,61 @@ +/****************************************************************************** +Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. + +These sources were developed at the Freie Universitaet Berlin, Computer Systems +and Telematics group (http://cst.mi.fu-berlin.de). +------------------------------------------------------------------------------- +This file is part of FeuerWare. + +This program is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 of the License, or (at your option) any later +version. + +FeuerWare is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see http://www.gnu.org/licenses/ . +-------------------------------------------------------------------------------- +For further information and questions please use the web site + http://scatterweb.mi.fu-berlin.de +and the mailinglist (subscription via web site) + scatterweb@lists.spline.inf.fu-berlin.de +*******************************************************************************/ + +#ifndef SHT11BOARD_H_ +#define SHT11BOARD_H_ + +/** + * @ingroup msb_430h + * @{ + */ + +/** + * @file + * @brief SHT11 Device Driver Configuration For MSB-430 Platform + * + * @author Freie Universität Berlin, Computer Systems & Telematics, µkleos + * @version $Revision$ + * + * @note $Id$ + */ +#include +#include + +/* SCK = P3B5 + * DATA = P3B4 + */ + +#define SHT11_SCK_LOW P3OUT &= ~(BIT5); /**< serial clock line low */ +#define SHT11_SCK_HIGH P3OUT |= BIT5; /**< serial clock line high */ +#define SHT11_DATA (P3IN & BIT5) /**< read serial I/O */ +#define SHT11_DATA_LOW P3OUT &= ~(BIT5); /**< serial I/O line low */ +#define SHT11_DATA_HIGH P3OUT |= BIT5; /**< serial I/O line high */ +#define SHT11_DATA_IN P3DIR &= ~(BIT5); /**< serial I/O as input */ +#define SHT11_DATA_OUT P3DIR |= BIT5; /**< serial I/O as output */ +#define SHT11_INIT P3DIR |= BIT5; /* FIO1DIR |= BIT25; PINSEL3 &= ~(BIT14|BIT15 | BIT16|BIT17); */ + +/** @} */ +#endif /* SHT11BOARD_H_ */