Hi,

I am creating my own platform and it contains two MCU ( one with sensors and
the other with the wireless protocol stack). I got Blink to work on my
sensor platform and I now need to manage the spi communication with the
other MCU.

 

I am trying some tests just to get the hand with the nesC abstractions with
this simple example.

 

 

C:\cygwin\opt\tinyos-2.x\apps\MyApp\ TestC.nc

#include "Timer.h"

 

module TestC

{

  uses interface Timer<TMilli> as Timer0;

  uses interface Leds;

  uses interface Boot;

  uses interface Wn100;

}

 

implementation

{

uint8_t counter =0; 

uint8_t receive =0; 

 

  event void Boot.booted()

  {

    call Timer0.startPeriodic( 1000 );

  }

 

  event void Timer0.fired()

  {

    counter++;

    call Wn100.cscomset();

    call Leds.led0Toggle();

    call Wn100.sendoxae();

    call Leds.led1Toggle();

  }

}

 

C:\cygwin\opt\tinyos-2.x\apps\MyApp\ TestAppC.nc

 

configuration TestAppC

{

}

implementation

{

  components MainC, TestC, LedsC, HplWn100C;

  components new TimerMilliC() as Timer0;

 

 

  TestC.Boot -> MainC.Boot;

  TestC.Timer0 -> Timer0;

  TestC.Leds -> LedsC.Leds;

  TestC.Wn100 -> HplWn100C.Wn100;

}

 

C:\cygwin\opt\tinyos-2.x\tos\platforms\newtrax\mb201\chips\Wn100\
HplWn100P.nc

 

module HplWn100P 

{

            provides interface Wn100;

            

  uses 

  {

                        interface SpiByte as WnSpi;

                        interface GeneralIO as Cs_Com;

                        interface GeneralIO as Cs_App;

  }

}

 

implementation

{

  void cscomset() 

  {

    call Cs_Com.set();

  }

  void cscomclear() 

  {

    call Cs_Com.clr();

  }

  void sendoxae()

  {

            uint8_t status;

            status = call WnSpi.write(0xAE);

  }

}

 

 

C:\cygwin\opt\tinyos-2.x\tos\platforms\newtrax\mb201\chips\Wn100\
HplWn100C.nc

 

configuration HplWn100C 

{

            provides interface Wn100;

}

 

implementation 

{

  

  components    new Msp430Spi1C() as Spi, 

                                    HplWn100P,

                                    HplMsp430GeneralIOC as MspGeneralIO,

                                    new Msp430GpioC() as Cs_Com,  

                                    new Msp430GpioC() as Cs_App;  

  

  Wn100 =  HplWn100P;

  

            Cs_Com -> MspGeneralIO.Port10;

            Cs_App -> MspGeneralIO.Port11;

            HplWn100P.Cs_Com -> Cs_Com; 

            HplWn100P.Cs_App -> Cs_App; 

            HplWn100P.WnSpi -> Spi;

}

 

 

 

********************************

Here is what I get 

 

In component `TestC':

TestC.nc:10: interface Wn100 not found

TestC.nc: In function `Timer0.fired':

TestC.nc:26: interface has no command or event named `cscomset'

TestC.nc:28: interface has no command or event named `sendoxae'

make: *** [exe0] Error 1

 

My Wn100 chip dir. is included in the .platform file so I don't see why the
interface is not found.

Any ideas

 

Thanks,

Alex

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to