Code Search for Developers
 
 
  

hardware.h from EmStar at Krugle


Show hardware.h syntax highlighted

// $Id: hardware.h,v 1.5 2005/10/27 01:27:37 thanos 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.
 */
/*
 *
 */
#ifndef __HARDWARE_H__
#define __HARDWARE_H__



// work around nesc automatic platform definition
#ifndef PLATFORM_PC
#define PLATFORM_PC
#endif

#undef STATUS_DBG

// Allow use of atomic in C code
#undef atomic

#include <stdio.h>
#include <string.h>
//#include <time.h>
#include <signal.h>
#ifdef __HAVE_GCC_4
#include </usr/include/linux/stddef.h>
#endif
//#include "nido.h"


//#include "events.h"
#include <libmisc/local_types.h>
#include <timesync/sync_structs.h>
#include <link/link_structs.h>


#include "tos_emstar.h"
#include "hardware.nido.h"

// We need norace for tossim to declare tossim's state variables
// as norace (they are in "async" handlers, but tossim has no true
// concurrency)
#undef norace

#define TOS_INTERRUPT_HANDLER(name, params) \
void name##_interrupt params __attribute__((C))

#define TOS_SIGNAL_HANDLER(signame, params) \
void signame##_signal params __attribute__((C))

#define TOS_ISSUE_INTERRUPT(name) \
name##_interrupt

#define TOS_ISSUE_SIGNAL(signame) \
signame##_signal

#include "dbg.h"
extern norace TOS_dbg_mode dbg_modes;


norace TOS_state_t tos_state;

void TOSH_wait_250ns()
{
}

void TOSH_uwait(int u_sec)
{
}

void TOSH_sleep()
{
}

// atomic statement runtime support
// For nido, nothing needs to be done...

typedef uint8_t __nesc_atomic_t;

inline __nesc_atomic_t __nesc_atomic_start(void) __attribute__((spontaneous))
{
  return 0;
}

inline void __nesc_atomic_end(__nesc_atomic_t oldSreg) __attribute__((spontaneous))
{
}

inline void __nesc_enable_interrupt() 
{
}

enum {
  TOSH_ADC_PORTMAPSIZE = 255,
};

//".c" files needed for the simulator

#include "hpl.c"
#include "hardware.c"
#include "fplist.c"

//variable needed for avr/pgmspace.h to init/load inst rom
char* memcpy_filename;

#endif /* __HARDWARE_H__ */




See more files for this project here

EmStar

EmStar is a software system for developing and deploying wireless sensor networks involving Linux-based platforms. As the wireless sensor network community has attempted to deploy more complex designs---large-scale, long-lived systems that need self-organization and adaptivity---a number of difficult software design issues have arisen. Advances in software design have not kept pace with the capabilities of hardware. This is because designing for an adaptive, efficient, and useful sensor network has turned out to be surprisingly complex and difficult. EmStar is a Linux-based software framework, whose goal is to dramatically reduce this complexity, enabling work to be shared and reused, and simplifying and speeding the design of new sensor network applications.

Project homepage: http://cvs.cens.ucla.edu/emstar/
Programming language(s): C,Shell Script
License: other

  avr/
    pgmspace.h
  .gdbinit
  .platform
  ADCC.nc
  ADCM.nc
  AM.h
  BRadioM.nc
  ByteEEPROM_platform.h
  CC1000Control.nc
  CC1000ControlM.nc
  CC1000RadioIntM.nc
  EEPROM.h
  EEPROM.nc
  Emstar.nc
  HPLADCC.nc
  HPLClock.nc
  HPLConstants.h
  HPLPotC.nc
  HPLPowerManagementM.nc
  HPLUARTC.nc
  HPLUARTM.nc
  InjectMsg.nc
  LedsC.nc
  MacControl.nc
  Main.nc
  PageEEPROM.h
  PageEEPROM.nc
  PageEEPROMC.nc
  PageEEPROMM.nc
  PageEEPROMShare.nc
  PhyRadioMsg.h
  README
  RadioCRCPacket.nc
  SysTimeC.nc
  SysTimeM.nc
  TimerC.nc
  TimerHeap.nc
  Voltage.h
  VoltageM.nc
  avr_eeprom.h
  dbg.c
  dbg.h
  emstar.target
  fplist.c
  hardware.c
  hardware.h
  hardware.nido.h
  hpl.c
  install.sh
  sched.c
  tos_emstar.h