cc2420_const.h

00001 /*
00002  * Copyright (c) 2006, Swedish Institute of Computer Science
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. Neither the name of the Institute nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  *
00029  */
00030 
00031 /* @(#)$Id: cc2420_const.h,v 1.4 2010/06/24 09:28:12 nifi Exp $ */
00032 
00033 #ifndef CC2420_CONST_H
00034 #define CC2420_CONST_H
00035 
00036 /*
00037  * All constants are from the Chipcon CC2420 Data Sheet that at one
00038  * point in time could be found at
00039  * http://www.chipcon.com/files/CC2420_Data_Sheet_1_4.pdf
00040  *
00041  * The page numbers below refer to pages in this document.
00042  */
00043 
00044 /* Page 27. */
00045 enum cc2420_status_byte {
00046   CC2420_XOSC16M_STABLE = 6,
00047   CC2420_TX_UNDERFLOW   = 5,
00048   CC2420_ENC_BUSY       = 4,
00049   CC2420_TX_ACTIVE      = 3,
00050   CC2420_LOCK           = 2,
00051   CC2420_RSSI_VALID     = 1,
00052 };
00053 
00054 /* Page 27. */
00055 enum cc2420_memory_size {
00056   CC2420_RAM_SIZE       = 368,
00057   CC2420_FIFO_SIZE      = 128,
00058 };
00059 
00060 /* Page 29. */
00061 enum cc2420_address {
00062   CC2420RAM_TXFIFO      = 0x000,
00063   CC2420RAM_RXFIFO      = 0x080,
00064   CC2420RAM_KEY0        = 0x100,
00065   CC2420RAM_RXNONCE     = 0x110,
00066   CC2420RAM_SABUF       = 0x120,
00067   CC2420RAM_KEY1        = 0x130,
00068   CC2420RAM_TXNONCE     = 0x140,
00069   CC2420RAM_CBCSTATE    = 0x150,
00070   CC2420RAM_IEEEADDR    = 0x160,
00071   CC2420RAM_PANID       = 0x168,
00072   CC2420RAM_SHORTADDR   = 0x16A,
00073 };
00074 
00075 /* Page 60. */
00076 enum cc2420_register {
00077   CC2420_SNOP           = 0x00,
00078   CC2420_SXOSCON        = 0x01,
00079   CC2420_STXCAL         = 0x02,
00080   CC2420_SRXON          = 0x03,
00081   CC2420_STXON          = 0x04,
00082   CC2420_STXONCCA       = 0x05,
00083   CC2420_SRFOFF         = 0x06,
00084   CC2420_SXOSCOFF       = 0x07,
00085   CC2420_SFLUSHRX       = 0x08,
00086   CC2420_SFLUSHTX       = 0x09,
00087   CC2420_SACK           = 0x0A,
00088   CC2420_SACKPEND       = 0x0B,
00089   CC2420_SRXDEC         = 0x0C,
00090   CC2420_STXENC         = 0x0D,
00091   CC2420_SAES           = 0x0E,
00092   CC2420_foo            = 0x0F,
00093   CC2420_MAIN           = 0x10,
00094   CC2420_MDMCTRL0       = 0x11,
00095   CC2420_MDMCTRL1       = 0x12,
00096   CC2420_RSSI           = 0x13,
00097   CC2420_SYNCWORD       = 0x14,
00098   CC2420_TXCTRL         = 0x15,
00099   CC2420_RXCTRL0        = 0x16,
00100   CC2420_RXCTRL1        = 0x17,
00101   CC2420_FSCTRL         = 0x18,
00102   CC2420_SECCTRL0       = 0x19,
00103   CC2420_SECCTRL1       = 0x1A,
00104   CC2420_BATTMON        = 0x1B,
00105   CC2420_IOCFG0         = 0x1C,
00106   CC2420_IOCFG1         = 0x1D,
00107   CC2420_MANFIDL        = 0x1E,
00108   CC2420_MANFIDH        = 0x1F,
00109   CC2420_FSMTC          = 0x20,
00110   CC2420_MANAND         = 0x21,
00111   CC2420_MANOR          = 0x22,
00112   CC2420_AGCCTRL        = 0x23,
00113   CC2420_AGCTST0        = 0x24,
00114   CC2420_AGCTST1        = 0x25,
00115   CC2420_AGCTST2        = 0x26,
00116   CC2420_FSTST0         = 0x27,
00117   CC2420_FSTST1         = 0x28,
00118   CC2420_FSTST2         = 0x29,
00119   CC2420_FSTST3         = 0x2A,
00120   CC2420_RXBPFTST       = 0x2B,
00121   CC2420_FSMSTATE       = 0x2C,
00122   CC2420_ADCTST         = 0x2D,
00123   CC2420_DACTST         = 0x2E,
00124   CC2420_TOPTST         = 0x2F,
00125   CC2420_RESERVED       = 0x30,
00126   /* 0x31 - 0x3D not used */
00127   CC2420_TXFIFO         = 0x3E,
00128   CC2420_RXFIFO         = 0x3F,
00129 };
00130 
00131 /* Page 69. */
00132 enum cc2420_secctrl0 {
00133   CC2420_SECCTRL0_NO_SECURITY           = 0x0000,
00134   CC2420_SECCTRL0_CBC_MAC               = 0x0001,
00135   CC2420_SECCTRL0_CTR                   = 0x0002,
00136   CC2420_SECCTRL0_CCM                   = 0x0003,
00137 
00138   CC2420_SECCTRL0_SEC_M_IDX             = 2,
00139 
00140   CC2420_SECCTRL0_RXKEYSEL0             = 0x0000,
00141   CC2420_SECCTRL0_RXKEYSEL1             = 0x0020,
00142 
00143   CC2420_SECCTRL0_TXKEYSEL0             = 0x0000,
00144   CC2420_SECCTRL0_TXKEYSEL1             = 0x0040,
00145 
00146   CC2420_SECCTRL0_SAKEYSEL0             = 0x0000,
00147   CC2420_SECCTRL0_SAKEYSEL1             = 0x0080,
00148 
00149   CC2420_SECCTRL0_SEC_CBC_HEAD          = 0x0100,
00150   CC2420_SECCTRL0_RXFIFO_PROTECTION     = 0x0200,
00151 };
00152 
00153 #endif /* CC2420_CONST_H */

Generated on Mon Apr 11 14:23:28 2011 for Contiki 2.5 by  doxygen 1.6.1