[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/interfaces
CC2420Config.nc, NONE, 1.1 CC2420Fifo.nc, NONE,
1.1 CC2420Packet.nc, NONE, 1.1 CC2420PacketBody.nc, NONE,
1.1 CC2420Power.nc, NONE, 1.1 CC2420Ram.nc, NONE,
1.1 CC2420Receive.nc, NONE, 1.1 CC2420Register.nc, NONE,
1.1 CC2420Strobe.nc, NONE, 1.1 CC2420Transmit.nc, NONE,
1.1 ChipSpiResource.nc, NONE, 1.1 PowerCycle.nc, NONE,
1.1 RadioBackoff.nc, NONE, 1.1 ReceiveIndicator.nc, NONE, 1.1
dmm
rincon at users.sourceforge.net
Tue Jul 3 17:37:17 PDT 2007
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/csma
CC2420CsmaC.nc, NONE, 1.1 CC2420CsmaP.nc, NONE, 1.1
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/link
PacketLinkC.nc, NONE, 1.1 PacketLinkDummyC.nc, NONE,
1.1 PacketLinkDummyP.nc, NONE, 1.1 PacketLinkP.nc, NONE,
1.1 readme.txt, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/interfaces
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30635/interfaces
Added Files:
CC2420Config.nc CC2420Fifo.nc CC2420Packet.nc
CC2420PacketBody.nc CC2420Power.nc CC2420Ram.nc
CC2420Receive.nc CC2420Register.nc CC2420Strobe.nc
CC2420Transmit.nc ChipSpiResource.nc PowerCycle.nc
RadioBackoff.nc ReceiveIndicator.nc
Log Message:
New CC2420 architecture in place for 2.0.2 release. See the README.txt file for changes. Test results from TUnit testing are included.
--- NEW FILE: CC2420Config.nc ---
/*
* Copyright (c) 2005-2006 Arch Rock Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Arch Rock Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* An HAL abstraction of the ChipCon CC2420 radio. This abstraction
* deals specifically with radio configurations. All get() and set()
* commands are single-phase. After setting some values, a call to
* sync() is required for the changes to propagate to the cc2420
* hardware chip. This interface allows setting multiple parameters
* before calling sync().
*
* @author Jonathan Hui <jhui at archrock.com>
* @version $Revision: 1.1 $ $Date: 2007/07/04 00:37:14 $
*/
interface CC2420Config {
/**
* Sync configuration changes with the radio hardware. This only
* applies to set commands below.
*
* @return SUCCESS if the request was accepted, FAIL otherwise.
*/
command error_t sync();
event void syncDone( error_t error );
/**
* Change the channel of the radio, between 11 and 26
*/
command uint8_t getChannel();
command void setChannel( uint8_t channel );
/**
* Change the short address of the radio.
*/
command uint16_t getShortAddr();
command void setShortAddr( uint16_t address );
/**
* Change the PAN address of the radio.
*/
command uint16_t getPanAddr();
command void setPanAddr( uint16_t address );
/**
* Sync must be called for acknowledgement changes to take effect
* @param enableAutoAck TRUE to enable auto acknowledgements
* @param hwAutoAck TRUE to default to hardware auto acks, FALSE to
* default to software auto acknowledgements
*/
command void setAutoAck(bool enableAutoAck, bool hwAutoAck);
/**
* @return TRUE if hardware auto acks are the default, FALSE if software
* acks are the default
*/
async command bool isHwAutoAckDefault();
/**
* @return TRUE if auto acks are enabled
*/
async command bool isAutoAckEnabled();
}
--- NEW FILE: CC2420Fifo.nc ---
/*
* Copyright (c) 2005-2006 Arch Rock Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Arch Rock Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* HAL abstraction for accessing the FIFO registers of a ChipCon
* CC2420 radio.
*
* @author Jonathan Hui <jhui at archrock.com>
* @version $Revision: 1.1 $ $Date: 2007/07/04 00:37:14 $
*/
interface CC2420Fifo {
/**
* Start reading from the FIFO. The <code>readDone</code> event will
* be signalled upon completion.
*
* @param data a pointer to the receive buffer.
* @param length number of bytes to read.
* @return status byte returned when sending the last address byte
* of the SPI transaction.
*/
async command cc2420_status_t beginRead( uint8_t* data, uint8_t length );
/**
* Continue reading from the FIFO without having to send the address
* byte again. The <code>readDone</code> event will be signalled
* upon completion.
*
* @param data a pointer to the receive buffer.
* @param length number of bytes to read.
* @return SUCCESS always.
*/
async command error_t continueRead( uint8_t* data, uint8_t length );
/**
* Signals the completion of a read operation.
*
* @param data a pointer to the receive buffer.
* @param length number of bytes read.
* @param error notification of how the operation went
*/
async event void readDone( uint8_t* data, uint8_t length, error_t error );
/**
* Start writing the FIFO. The <code>writeDone</code> event will be
* signalled upon completion.
*
* @param data a pointer to the send buffer.
* @param length number of bytes to write.
* @return status byte returned when sending the last address byte
* of the SPI transaction.
*/
async command cc2420_status_t write( uint8_t* data, uint8_t length );
/**
* Signals the completion of a write operation.
*
* @param data a pointer to the send buffer.
* @param length number of bytes written.
* @param error notification of how the operation went
*/
async event void writeDone( uint8_t* data, uint8_t length, error_t error );
}
--- NEW FILE: CC2420Packet.nc ---
/*
* Copyright (c) 2005-2006 Arch Rock Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Arch Rock Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* @author Jonathan Hui <jhui at archrock.com>
* @author David Moss
* @author Chad Metcalf
*/
#include "message.h"
interface CC2420Packet {
/**
* Get transmission power setting for current packet.
*
* @param the message
*/
async command uint8_t getPower( message_t* p_msg );
/**
* Set transmission power for a given packet. Valid ranges are
* between 0 and 31.
*
* @param p_msg the message.
* @param power transmission power.
*/
async command void setPower( message_t* p_msg, uint8_t power );
/**
* Get rssi value for a given packet. For received packets, it is
* the received signal strength when receiving that packet. For sent
* packets, it is the received signal strength of the ack if an ack
* was received.
*/
async command int8_t getRssi( message_t* p_msg );
/**
* Get lqi value for a given packet. For received packets, it is the
* link quality indicator value when receiving that packet. For sent
* packets, it is the link quality indicator value of the ack if an
* ack was received.
*/
async command uint8_t getLqi( message_t* p_msg );
}
--- NEW FILE: CC2420PacketBody.nc ---
/*
* Copyright (c) 2005-2006 Rincon Research Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Rincon Research Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* RINCON RESEARCH OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* Internal interface for the CC2420 to get portions of a packet.
* @author David Moss
*/
interface CC2420PacketBody {
/**
* @return pointer to the cc2420_header_t of the given message
*/
async command cc2420_header_t *getHeader(message_t *msg);
/**
* @return pointer to the cc2420_metadata_t of the given message
*/
async command cc2420_metadata_t *getMetadata(message_t *msg);
}
--- NEW FILE: CC2420Power.nc ---
/*
* Copyright (c) 2005-2006 Arch Rock Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Arch Rock Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* An HAL abstraction of the ChipCon CC2420 radio. This abstraction
* deals specifically with radio power operations (e.g. voltage
* regulator, oscillator, etc). However, it does not include
* transmission power, see the CC2420Config interface.
*
* @author Jonathan Hui <jhui at archrock.com>
* @version $Revision: 1.1 $ $Date: 2007/07/04 00:37:14 $
*/
interface CC2420Power {
/**
* Start the voltage regulator on the CC2420. On SUCCESS,
* <code>startVReg()</code> will be signalled when the voltage
* regulator is fully on.
*
* @return SUCCESS if the request was accepted, FAIL otherwise.
*/
async command error_t startVReg();
/**
* Signals that the voltage regulator has been started.
*/
async event void startVRegDone();
/**
* Stop the voltage regulator immediately.
*
* @return SUCCESS always
*/
async command error_t stopVReg();
/**
* Start the oscillator. On SUCCESS, <code>startOscillator</code>
* will be signalled when the oscillator has been started.
*
* @return SUCCESS if the request was accepted, FAIL otherwise.
*/
async command error_t startOscillator();
/**
* Signals that the oscillator has been started.
*/
async event void startOscillatorDone();
/**
* Stop the oscillator.
*
* @return SUCCESS if the oscillator was stopped, FAIL otherwise.
*/
async command error_t stopOscillator();
/**
* Enable RX.
*
* @return SUCCESS if receive mode has been enabled, FAIL otherwise.
*/
async command error_t rxOn();
/**
* Disable RX.
*
* @return SUCCESS if receive mode has been disabled, FAIL otherwise.
*/
async command error_t rfOff();
}
--- NEW FILE: CC2420Ram.nc ---
/*
* Copyright (c) 2005-2006 Arch Rock Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Arch Rock Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* HAL abstraction for accessing theRAM of a ChipCon CC2420 radio.
*
* @author Jonathan Hui <jhui at archrock.com>
* @version $Revision: 1.1 $ $Date: 2007/07/04 00:37:14 $
*/
#include "CC2420.h"
interface CC2420Ram {
/**
* Read data from a RAM. This operation is sychronous.
*
* @param offset within the field.
* @param data a pointer to the receive buffer.
* @param length number of bytes to read.
* @return status byte returned when sending the last byte
* of the SPI transaction.
*/
async command cc2420_status_t read( uint8_t offset, uint8_t* data, uint8_t length );
/**
* Write data to RAM. This operation is sychronous.
*
* @param offset within the field.
* @param data a pointer to the send buffer.
* @param length number of bytes to write.
* @return status byte returned when sending the last address byte
* of the SPI transaction.
*/
async command cc2420_status_t write( uint8_t offset, uint8_t* data, uint8_t length );
}
--- NEW FILE: CC2420Receive.nc ---
/*
* Copyright (c) 2005-2006 Arch Rock Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Arch Rock Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* Low-level abstraction of the receive path implementation for the
* ChipCon CC2420 radio.
*
* @author Jonathan Hui <jhui at archrock.com>
* @version $Revision: 1.1 $ $Date: 2007/07/04 00:37:14 $
*/
interface CC2420Receive {
/**
* Notification that an SFD capture has occured.
*
* @param time at which the capture happened.
*/
async command void sfd( uint16_t time );
/**
* Notification that the packet has been dropped by the radio
* (e.g. due to address rejection).
*/
async command void sfd_dropped();
/**
* Signals that a message has been received.
*
* @param type of the message received.
* @param message pointer to message received.
*/
async event void receive( uint8_t type, message_t* message );
}
--- NEW FILE: CC2420Register.nc ---
/* tab:4
* "Copyright (c) 2005 Stanford University. All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose, without fee, and without written
* agreement is hereby granted, provided that the above copyright
* notice, the following two paragraphs and the author appear in all
* copies of this software.
*
* IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF STANFORD UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
* PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND STANFORD UNIVERSITY
* HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
* ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* Interface representing one of the Read/Write registers on the
* CC2420 radio. The return values (when appropriate) refer to the
* status byte returned on the CC2420 SO pin. A full list of RW
* registers can be found on page 61 of the CC2420 datasheet (rev
* 1.2). Page 25 of the same document describes the protocol for
* interacting with these registers over the CC2420 SPI bus.
*
* @author Philip Levis
* @version $Revision: 1.1 $ $Date: 2007/07/04 00:37:14 $
*/
#include "CC2420.h"
interface CC2420Register {
/**
* Read a 16-bit data word from the register.
*
* @param data pointer to place the register value.
* @return status byte from the read.
*/
async command cc2420_status_t read(uint16_t* data);
/**
* Write a 16-bit data word to the register.
*
* @param data value to write to register.
* @return status byte from the write.
*/
async command cc2420_status_t write(uint16_t data);
}
--- NEW FILE: CC2420Strobe.nc ---
/* tab:4
* "Copyright (c) 2005 Stanford University. All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose, without fee, and without written
* agreement is hereby granted, provided that the above copyright
* notice, the following two paragraphs and the author appear in all
* copies of this software.
*
* IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF STANFORD UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
* PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND STANFORD UNIVERSITY
* HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
* ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* Interface representing one of the CC2420 command strobe registers.
* Writing to one of these registers enacts a command on the CC2420,
* such as power-up, transmission, or clear a FIFO.
*
* @author Philip Levis
* @version $Revision: 1.1 $ $Date: 2007/07/04 00:37:14 $
*/
#include "CC2420.h"
interface CC2420Strobe {
/**
* Send a command strobe to the register. The return value is the
* CC2420 status register. Table 5 on page 27 of the CC2420
* datasheet (v1.2) describes the contents of this register.
*
* @return Status byte from the CC2420.
*/
async command cc2420_status_t strobe();
}
--- NEW FILE: CC2420Transmit.nc ---
/*
* Copyright (c) 2005-2006 Arch Rock Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Arch Rock Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* Low-level abstraction for the transmit path implementaiton of the
* ChipCon CC2420 radio.
*
* @author Jonathan Hui <jhui at archrock.com>
* @version $Revision: 1.1 $ $Date: 2007/07/04 00:37:14 $
*/
#include "message.h"
interface CC2420Transmit {
/**
* Send a message
*
* @param p_msg message to send.
* @param useCca TRUE if this Tx should use clear channel assessments
* @return SUCCESS if the request was accepted, FAIL otherwise.
*/
async command error_t send( message_t* p_msg, bool useCca );
/**
* Send the previous message again
* @param useCca TRUE if this re-Tx should use clear channel assessments
* @return SUCCESS if the request was accepted, FAIL otherwise.
*/
async command error_t resend(bool useCca);
/**
* Cancel sending of the message.
*
* @return SUCCESS if the request was accepted, FAIL otherwise.
*/
async command error_t cancel();
/**
* Signal that a message has been sent
*
* @param p_msg message to send.
* @param error notifaction of how the operation went.
*/
async event void sendDone( message_t* p_msg, error_t error );
/**
* Modify the contents of a packet. This command can only be used
* when an SFD capture event for the sending packet is signalled.
*
* @param offset in the message to start modifying.
* @param buf to data to write
* @param len of bytes to write
* @return SUCCESS if the request was accepted, FAIL otherwise.
*/
async command error_t modify( uint8_t offset, uint8_t* buf, uint8_t len );
}
--- NEW FILE: ChipSpiResource.nc ---
/**
* Interface for the SPI resource for an entire chip. The chip accesses
* the platform SPI resource one time, but can have multiple clients
* using the SPI bus on top. When all of the clients are released, the
* chip will normally try to release itself from the platforms SPI bus.
* In some cases, this isn't desirable - so even though upper components
* aren't actively using the SPI bus, they can tell the chip to hold onto
* it so they can have immediate access when they need.
*
* Any component that aborts a release MUST attempt the release at a later
* time if they don't acquire and release the SPI bus naturally after the
* abort.
*
* @author David Moss
*/
interface ChipSpiResource {
/**
* The SPI bus is about to be automatically released. Modules that aren't
* using the SPI bus but still want the SPI bus to stick around must call
* abortRelease() within the event.
*/
async event void releasing();
/**
* Abort the release of the SPI bus. This must be called only with the
* releasing() event
*/
async command void abortRelease();
/**
* Release the SPI bus if there are no objections
* @return SUCCESS if the SPI bus is released from the chip.
* FAIL if the SPI bus is already in use.
* EBUSY if some component aborted the release.
*/
async command error_t attemptRelease();
}
--- NEW FILE: PowerCycle.nc ---
/*
* Copyright (c) 2005-2006 Rincon Research Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Rincon Research Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* RINCON RESEARCH OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* Manage the CC2420's duty cycle and power management
* @author David Moss
*/
interface PowerCycle {
/**
* Set the sleep interval, in binary milliseconds
* @param sleepIntervalMs the sleep interval in [ms]
*/
command void setSleepInterval(uint16_t sleepIntervalMs);
/**
* @return the sleep interval in [ms]
*/
command uint16_t getSleepInterval();
/**
* @deprecated Should be removed in the future when the PowerCycle
* component does packet-level detects and is in full control of radio
* power.
*/
event void detected();
}
--- NEW FILE: RadioBackoff.nc ---
/*
* Copyright (c) 2005-2006 Rincon Research Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Rincon Research Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* RINCON RESEARCH OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* Interface to request and specify backoff periods for messages
*
* We use a call back method for setting the backoff as opposed to
* events that return backoff values.
*
* This is because of fan-out issues with multiple components wanting to
* affect backoffs for whatever they're interested in:
* If you signal out an *event* to request an initial backoff and
* several components happen to be listening, then those components
* would be required to return a backoff value. We don't want that
* behavior.
* With this strategy, components can listen for the requests and then
* decide if they want to affect the behavior. If the component wants to
* affect the behavior, it calls back using the setXYZBackoff(..) command.
* If several components call back, then the last component to get its
* word in has the final say.
*
* @author David Moss
*/
interface RadioBackoff {
/**
* Must be called within a requestInitialBackoff event
* @param backoffTime the amount of time in some unspecified units to backoff
*/
async command void setInitialBackoff(uint16_t backoffTime);
/**
* Must be called within a requestCongestionBackoff event
* @param backoffTime the amount of time in some unspecified units to backoff
*/
async command void setCongestionBackoff(uint16_t backoffTime);
/**
* Enable CCA for the outbound packet. Must be called within a requestCca
* event
* @param ccaOn TRUE to enable CCA, which is the default.
*/
async command void setCca(bool ccaOn);
/**
* Request for input on the initial backoff
* Reply using setInitialBackoff(..)
* @param msg pointer to the message being sent
*/
async event void requestInitialBackoff(message_t *msg);
/**
* Request for input on the congestion backoff
* Reply using setCongestionBackoff(..)
* @param msg pointer to the message being sent
*/
async event void requestCongestionBackoff(message_t *msg);
/**
* Request for input on whether or not to use CCA on the outbound packet.
* Replies should come in the form of setCca(..)
* @param msg pointer to the message being sent
*/
async event void requestCca(message_t *msg);
}
--- NEW FILE: ReceiveIndicator.nc ---
/*
* Copyright (c) 2005-2006 Rincon Research Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Rincon Research Corporation nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* RINCON RESEARCH OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE
*/
/**
* Interface to obtain energy, byte, and packet receive check readings
* @author David Moss
*/
interface ReceiveIndicator {
/**
* @return TRUE if the indicator is showing we are actively receiving at this
* level
*/
command bool isReceiving();
}
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/csma
CC2420CsmaC.nc, NONE, 1.1 CC2420CsmaP.nc, NONE, 1.1
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/link
PacketLinkC.nc, NONE, 1.1 PacketLinkDummyC.nc, NONE,
1.1 PacketLinkDummyP.nc, NONE, 1.1 PacketLinkP.nc, NONE,
1.1 readme.txt, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list