CC2420 Cross-Platform Portability

From TinyOS Wiki
Revision as of 21:31, 25 November 2009 by Sissou (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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;

We recommend you look at the telos and micaz platform chip code for examples on what configuration files to provide and how the functionality is wired in.

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