]> oss.titaniummirror.com Git - tinyos-2.x.git/blob - tos/platforms/mulle/DemoSensorC.nc
added command to set current time from app space.
[tinyos-2.x.git] / tos / platforms / mulle / DemoSensorC.nc
1 /*
2 * Copyright (c) 2009 Communication Group and Eislab at
3 * Lulea University of Technology
4 *
5 * Contact: Laurynas Riliskis, LTU
6 * Mail: laurynas.riliskis@ltu.se
7 * All rights reserved.
8 *
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * - Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * - Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the
18 * distribution.
19 * - Neither the name of Communication Group at Lulea University of Technology
20 * nor the names of its contributors may be used to endorse or promote
21 * products derived from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD
27 * UNIVERSITY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34 * OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36
37 /**
38 * Demo sensor that connects to the AN0 channel on the MCU. This can
39 * easily be used together with the potentiometer on the Mulle
40 * expansionboard.
41 *
42 * @author Henrik Makitaavola <henrik.makitaavola@gmail.com>
43 */
44 generic configuration DemoSensorC()
45 {
46 provides interface Read<uint16_t>;
47 }
48 implementation
49 {
50 components new AdcReadClientC(), DemoSensorP,
51 HplM16c62pGeneralIOC as IOs,
52 RealMainP;
53
54 DemoSensorP.Pin -> IOs.PortP100;
55 DemoSensorP.AVcc -> IOs.PortP76;
56
57 Read = AdcReadClientC;
58
59 AdcReadClientC.M16c62pAdcConfig -> DemoSensorP;
60
61 RealMainP.PlatformInit -> DemoSensorP;
62 }