[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/atm128/spi Atm128SpiC.nc, 1.4, 1.5 Atm128SpiP.nc, 1.6, 1.7 HplAtm128SpiP.nc, 1.4, 1.5
Miklos Maroti
mmaroti at users.sourceforge.net
Thu Apr 24 15:31:28 PDT 2008
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/spi
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25258/tos/chips/atm128/spi
Modified Files:
Atm128SpiC.nc Atm128SpiP.nc HplAtm128SpiP.nc
Log Message:
Allow possibly multiple slaves for the Atmega128 SPI bus.
Move the slave select logic from the HPL SPI to the user of the resouce.
This touched the MicaZ SPI access (but not the mica2 which uses its own logic)
Index: Atm128SpiC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/spi/Atm128SpiC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Atm128SpiC.nc 12 Dec 2006 18:23:04 -0000 1.4
--- Atm128SpiC.nc 24 Apr 2008 22:31:25 -0000 1.5
***************
*** 71,75 ****
implementation {
components Atm128SpiP as SpiMaster, HplAtm128SpiC as HplSpi;
- components HplAtm128GeneralIOC as IO;
components new SimpleFcfsArbiterC("Atm128SpiC.Resource") as Arbiter;
components McuSleepC;
--- 71,74 ----
***************
*** 82,86 ****
SpiMaster.ResourceArbiter -> Arbiter;
! SpiMaster.ArbiterInfo -> Arbiter;
SpiMaster.Spi -> HplSpi;
SpiMaster.McuPowerState -> McuSleepC;
--- 81,85 ----
SpiMaster.ResourceArbiter -> Arbiter;
! SpiMaster.ArbiterInfo -> Arbiter;
SpiMaster.Spi -> HplSpi;
SpiMaster.McuPowerState -> McuSleepC;
Index: Atm128SpiP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/spi/Atm128SpiP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Atm128SpiP.nc 28 Feb 2007 17:33:59 -0000 1.6
--- Atm128SpiP.nc 24 Apr 2008 22:31:25 -0000 1.7
***************
*** 102,106 ****
return SUCCESS;
}
- bool started;
void startSpi() {
--- 102,105 ----
***************
*** 120,124 ****
void stopSpi() {
call Spi.enableSpi(FALSE);
- started = FALSE;
atomic {
call Spi.sleep();
--- 119,122 ----
Index: HplAtm128SpiP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/spi/HplAtm128SpiP.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** HplAtm128SpiP.nc 12 Dec 2006 18:23:04 -0000 1.4
--- HplAtm128SpiP.nc 24 Apr 2008 22:31:25 -0000 1.5
***************
*** 81,88 ****
call MISO.makeInput();
call SCK.makeOutput();
- call SS.makeOutput();
call SPI.setMasterBit(TRUE);
- call SS.clr();
}
async command void SPI.initSlave() {
call MISO.makeOutput();
--- 81,87 ----
call MISO.makeInput();
call SCK.makeOutput();
call SPI.setMasterBit(TRUE);
}
+
async command void SPI.initSlave() {
call MISO.makeOutput();
***************
*** 94,98 ****
async command void SPI.sleep() {
! call SS.set();
}
--- 93,97 ----
async command void SPI.sleep() {
! // call SS.set(); // why was this needed?
}
More information about the Tinyos-2-commits
mailing list