alarmcountermillip.nc
来自「tinyos-2.0源代码!转载而已!要的尽管拿!」· NC 代码 · 共 53 行
NC
53 行
// $Id: AlarmCounterMilliP.nc,v 1.1.2.4 2006/01/27 21:52:11 idgay Exp $/* * Copyright (c) 2005-2006 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. *//** * Configure hardware timer 0 for use as the mica family's millisecond * timer. This component does not follow the TEP102 HAL guidelines as * there is only one compare register for timer 0, which is used to * implement HilTimerMilliC. Hence it isn't useful to expose an * AlarmMilliC or CounterMillIC component. * * @author David Gay <dgay@intel-research.net> * @author Martin Turon <mturon@xbow.com> */configuration AlarmCounterMilliP{ provides interface Init; provides interface Alarm<TMilli, uint32_t> as AlarmMilli32; provides interface Counter<TMilli, uint32_t> as CounterMilli32;}implementation{ components HplAtm128Timer0AsyncC as Timer0, PlatformC, new Atm128TimerInitC(uint8_t, ATM128_CLK8_DIVIDE_32) as MilliInit, new Atm128AlarmC(TMilli, uint8_t, 2) as MilliAlarm, new Atm128CounterC(TMilli, uint8_t) as MilliCounter, new TransformAlarmCounterC(TMilli, uint32_t, TMilli, uint8_t, 0, uint32_t) as Transform32; // Top-level interface wiring AlarmMilli32 = Transform32; CounterMilli32 = Transform32; // Strap in low-level hardware timer (Timer0Async) Init = MilliInit; MilliInit.Timer -> Timer0.Timer; MilliAlarm.HplAtm128Timer -> Timer0.Timer; MilliAlarm.HplAtm128Compare -> Timer0.Compare; MilliCounter.Timer -> Timer0.Timer; PlatformC.SubInit -> Timer0; // Alarm Transform Wiring Transform32.AlarmFrom -> MilliAlarm; Transform32.CounterFrom -> MilliCounter;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?