Hello everyone,
I am trying to use the SPI bus of Atm1281 to peek into some of the registers
of RF230 radio chip from one of my components. I am using the SpiResource
provided by HplRF230C to request access to the SPI bus. The
SpiResource.granted event is signaled but it seems that the SPI bus is not
initialized. The SpiResource.isOwner method also returns false. See the code
snippets at the end of this email.
My question is that, why is the SPI bus not properly initialized and why
does the SpiResource.isOwner return false even though the
SpiResource.granted event has been signaled? Do I need to initialize the SPI
bus myself? I think the resource arbiter should initialize the bus. Any help
or pointers would be much appreciated.
Regards
In my application configuration I have
App.SpiResource -> HplRF230C.SpiResource;
and in the module implementation I have
module TestRF230SpiM {
uses {
interface Boot;
interface Leds;
interface Resource as SpiResource;
interface SplitControl as RadioControl;
interface Atm128Spi as SpiBus;
}
}
event void RadioControl.startDone(error_t error) {
if(error==SUCCESS)
call SpiResource.request();
else
call RadioControl.start();
}
event void SpiResource.granted() {
if( call SpiResource.isOwner() ){
call Leds.led1On();
if( call SpiBus.isSpiEnabled() )
call Leds.led2On();
}
else{
call Leds.led0On();
call SpiResource.immediateRequest();
}
}
I can see the led0 go on but not the others.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help