[Tinyos-beta-commits] CVS: tinyos-1.x/beta/platform/imote2
DebugUART.nc, NONE, 1.1 DebugUARTM.nc, NONE,
1.1 HPLDebugUARTC.nc, NONE, 1.1 SettingsC.nc, NONE,
1.1 SettingsM.nc, NONE, 1.1
Lama Nachman
lnachman at users.sourceforge.net
Tue Oct 18 13:59:18 PDT 2005
- Previous message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/teps/txt tep102.txt, 1.15, 1.16
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/platform/imote2
BluSHM.nc, 1.7, 1.8 BulkTxRx.nc, 1.1, 1.2 HPLUARTC.nc, 1.2,
1.3 PMIC.nc, 1.1, 1.2 PMICM.nc, 1.1, 1.2 SSP1M.nc, 1.2,
1.3 UARTBufferC.nc, 1.1, 1.2 pmic.h, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-1.x/beta/platform/imote2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28468
Added Files:
DebugUART.nc DebugUARTM.nc HPLDebugUARTC.nc SettingsC.nc
SettingsM.nc
Log Message:
Added support for 2 uarts. The debug uart wires by default to STUART and
is used by BluSH. The main uart (used by HPLUART) is wired to the FFUART
by default.
Also, added support for setting the TOS_LOCAL_ADDRESS from the unique
ID programmed in the flash. To override this default setting, a MY_ADDRESS
flag can be passed during compilation.
--- NEW FILE: DebugUART.nc ---
// $Id: DebugUART.nc,v 1.1 2005/10/18 20:59:16 lnachman Exp $
/* tab:4
* "Copyright (c) 2000-2003 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
* Copyright (c) 2002-2003 Intel Corporation
* All rights reserved.
*
* This file is distributed under the terms in the attached INTEL-LICENSE
* file. If you do not find these files, copies can be found by writing to
* Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
* 94704. Attention: Intel License Inquiry.
*/
/*
*
* Authors: Jason Hill, David Gay, Philip Levis
* Date last modified: 6/25/02
*
*/
/**
* @author Jason Hill
* @author David Gay
* @author Philip Levis
*/
configuration DebugUART {
provides {
interface ByteComm;
interface StdControl as Control;
}
}
implementation {
components DebugUARTM, HPLDebugUARTC;
ByteComm = DebugUARTM;
Control = DebugUARTM;
DebugUARTM.HPLUART -> HPLDebugUARTC;
}
--- NEW FILE: DebugUARTM.nc ---
// $Id: DebugUARTM.nc,v 1.1 2005/10/18 20:59:16 lnachman Exp $
/* tab:4
* "Copyright (c) 2000-2003 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
* Copyright (c) 2002-2003 Intel Corporation
* All rights reserved.
*
* This file is distributed under the terms in the attached INTEL-LICENSE
* file. If you do not find these files, copies can be found by writing to
* Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
* 94704. Attention: Intel License Inquiry.
*/
/*
*
* Authors: Jason Hill, David Gay, Philip Levis
* Date last modified: 5/27/03
*
* 5/27/03 pal Added atomic sections for safety.
*
*/
/**
* @author Jason Hill
* @author David Gay
* @author Philip Levis
*/
module DebugUARTM {
provides {
interface ByteComm;
interface StdControl as Control;
}
uses {
interface HPLUART;
}
}
implementation
{
bool state;
command result_t Control.init() {
dbg(DBG_BOOT, "UART initialized\n");
atomic {
state = FALSE;
}
return SUCCESS;
}
command result_t Control.start() {
return call HPLUART.init();
}
command result_t Control.stop() {
return call HPLUART.stop();
}
async event result_t HPLUART.get(uint8_t data) {
// Changed SRM 7.8.02 -- No reason to clear state just because
// we received some data, I think...
// state = FALSE;
signal ByteComm.rxByteReady(data, FALSE, 0);
dbg(DBG_UART, "signal: state %d\n", state);
return SUCCESS;
}
async event result_t HPLUART.putDone() {
bool oldState;
atomic {
dbg(DBG_UART, "intr: state %d\n", state);
oldState = state;
state = FALSE;
}
/* Note that the state transition/event signalling is not atomic.
It is possible, after state has been set to FALSE, that
someone calls txByte before txDone is signalled. The event
handler therefore may not be able to transmit. Sharing
the byte level can be very tricky, unless we assure non-preemptiveness
or have client ids. The UART implementation is non-preemptive,
but is not assuredly so. -pal*/
if (oldState) {
signal ByteComm.txDone();
signal ByteComm.txByteReady(TRUE);
}
return SUCCESS;
}
async command result_t ByteComm.txByte(uint8_t data) {
bool oldState;
dbg(DBG_UART, "UART_write_Byte_inlet %x\n", data);
atomic {
oldState = state;
state = TRUE;
}
if (oldState)
return FAIL;
call HPLUART.put(data);
return SUCCESS;
}
}
--- NEW FILE: HPLDebugUARTC.nc ---
// $Id: HPLDebugUARTC.nc,v 1.1 2005/10/18 20:59:16 lnachman Exp $
/* tab:4
* "Copyright (c) 2000-2003 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
* Copyright (c) 2002-2003 Intel Corporation
* All rights reserved.
*
* This file is distributed under the terms in the attached INTEL-LICENSE
* file. If you do not find these files, copies can be found by writing to
* Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
* 94704. Attention: Intel License Inquiry.
*/
/*
*
* Authors: Jason Hill, David Gay, Philip Levis
* Date last modified: $Id: HPLDebugUARTC.nc,v 1.1 2005/10/18 20:59:16 lnachman Exp $
*
*/
// The hardware presentation layer. See hpl.h for the C side.
// Note: there's a separate C side (hpl.h) to get access to the avr macros
// The model is that HPL is stateless. If the desired interface is as stateless
// it can be implemented here (Clock, FlashBitSPI). Otherwise you should
// create a separate component
/**
* @author Jason Hill
* @author David Gay
* @author Philip Levis
*/
configuration HPLDebugUARTC {
provides interface HPLUART as UART;
}
implementation
{
components HPLSTUARTC as HPLUART0M;
UART = HPLUART0M;
}
--- NEW FILE: SettingsC.nc ---
/* tab:4
* IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By
* downloading, copying, installing or using the software you agree to
* this license. If you do not agree to this license, do not download,
* install, copy or use the software.
*
* Intel Open Source License
*
* Copyright (c) 2002 Intel Corporation
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
*/
/*
*
* Authors: Lama Nachman
*/
configuration SettingsC{
provides{
interface StdControl;
}
}
implementation{
components SettingsM, BluSHC, UIDC;
StdControl = SettingsM;
SettingsM.UID->UIDC;
BluSHC.BluSH_AppI[unique("BluSH")] -> SettingsM.NodeID;
}
--- NEW FILE: SettingsM.nc ---
/* tab:4
* IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By
* downloading, copying, installing or using the software you agree to
* this license. If you do not agree to this license, do not download,
* install, copy or use the software.
*
* Intel Open Source License
*
* Copyright (c) 2002 Intel Corporation
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
*/
/*
*
* Authors: Lama Nachman
*/
/*
* A module to apply generic settings. For now, all we need is the tos
* local address
*/
includes trace;
module SettingsM{
provides{
interface StdControl;
interface BluSH_AppI as NodeID;
}
uses {
interface UID;
}
}
implementation {
command result_t StdControl.init(){
return SUCCESS;
}
command result_t StdControl.start(){
#ifdef MY_ADDRESS
TOS_LOCAL_ADDRESS = MY_ADDRESS;
#else
TOS_LOCAL_ADDRESS = (uint16_t) (call UID.getUID() & 0xff);
#endif
return SUCCESS;
}
command result_t StdControl.stop(){
return SUCCESS;
}
command BluSH_result_t NodeID.getName(char *buff, uint8_t len) {
const char name[] = "NodeID";
strcpy(buff, name);
return BLUSH_SUCCESS_DONE;
}
command BluSH_result_t NodeID.callApp(char *cmdBuff, uint8_t cmdLen,
char *resBuff, uint8_t resLen) {
trace(DBG_USR1,"0x%x\r\n", TOS_LOCAL_ADDRESS);
return BLUSH_SUCCESS_DONE;
}
}
- Previous message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/teps/txt tep102.txt, 1.15, 1.16
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/platform/imote2
BluSHM.nc, 1.7, 1.8 BulkTxRx.nc, 1.1, 1.2 HPLUARTC.nc, 1.2,
1.3 PMIC.nc, 1.1, 1.2 PMICM.nc, 1.1, 1.2 SSP1M.nc, 1.2,
1.3 UARTBufferC.nc, 1.1, 1.2 pmic.h, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-beta-commits
mailing list