CC2420 Cross-Platform Portability

From TinyOS Wiki
Revision as of 11:44, 7 July 2008 by Dmoss (talk | contribs)
Jump to: navigation, search

To port the CC2420 radio to another platform, the following interfaces need to be implemented:

 // GPIO Pins
 interface GeneralIO as CCA;
 interface GeneralIO as CSN;
 interface GeneralIO as FIFO;
 interface GeneralIO as FIFOP;
 interface GeneralIO as RSTN;
 interface GeneralIO as SFD;
 interface GeneralIO as VREN;
   
 // SPI Bus
 interface Resource;
 interface SpiByte;
 interface SpiPacket;
 
 // Interrupts
 interface GpioCapture as CaptureSFD;
 interface GpioInterrupt as InterruptCCA;
 interface GpioInterrupt as InterruptFIFOP;

The GpioCapture interface is tied through the Timer to provide a relative time at which the interrupt occurred. This is useful for timestamping received packets for node synchronization.

If the CC2420 is not connected to the proper interrupt lines, interrupts can be emulated through the use of a spinning task that polls the GPIO pin. The MICAz implementation, for example, does this for the CCA interrupt.

See Also