SFBConstants.h

Go to the documentation of this file.
00001 /*                                             -*- mode:C++; fill-column:100 -*-
00002   SFBConstants.h - Names for SFB constants
00003   Copyright (C) 2008 The Regents of the University of New Mexico.  All rights reserved.
00004 
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009 
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014 
00015   You should have received a copy of the GNU General Public License
00016   along with this library; if not, write to the Free Software
00017   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
00018   USA
00019 */
00020 
00027 #ifndef SFBCONSTANTS_H_
00028 #define SFBCONSTANTS_H_
00029 
00030 #include "SFBTypes.h"
00031 #include "SFBMacros.h"
00032 
00035 #define HIGH 1            
00036 #define LOW 0             
00038 
00039 
00041 #define DEC 10            
00042 #define HEX 16            
00043 #define OCT 8             
00044 #define BIN 2             
00045 #define BYTE 0            
00047 #define BESHORT -1        
00048 #define BELONG -2         
00049 #define B36 36            
00051 
00052 
00054 #define INPUT  0          
00055 #define OUTPUT 1          
00056 #define REFLEX_MODE 2     
00057 #define HW_MODE 3         
00059 
00060 
00063 #define NORTH  0u         
00064 #define SOUTH  1u         
00065 #define EAST   2u         
00066 #define WEST   3u         
00089 #define FACE_COUNT 4      
00090 
00096 #define SPINE 4u          
00097 #define WMEM  5u          
00098 #define BRAIN 6u          
00100 #define ALL_FACES 7u      
00102 #define NO_FACES 8u       
00105 #define MIN_VIRTUAL_FACE 9u  
00108 #define VIRTUAL_FACE_COUNT 16 
00112 #define MAX_FACE_INDEX (MIN_VIRTUAL_FACE+VIRTUAL_FACE_COUNT) 
00118 #define NOT_A_FACE (MAX_FACE_INDEX) 
00121 
00122 
00125 #define RISING  0x01            
00126 #define FALLING 0x02            
00127 #define CHANGING ((RISING)|(FALLING)) 
00129 
00130 
00133 #define LSBFIRST 0              
00134 #define MSBFIRST 1              
00136 
00137 
00139 #define UNKNOWN_BOOT_MODE 0     
00140 #define RED_BOOT_MODE 1         
00141 #define GREEN_BOOT_MODE 2       
00142 #define BLUE_BOOT_MODE 3        
00143 #define MAX_BOOT_MODES 4       
00145 
00146 
00151 #define PK_DELETED    0x01   
00152 #define PK_OVERRUN    0x02   
00153 #define PK_PARITY     0x04   
00154 #define PK_FRAMING    0x08   
00155 #define PK_BREAK      0x10   
00156 #define PK_BUFFER     0x20   
00157 #define PK_BAD_ESCAPE 0x40   
00158 #define PK_RESERVED8  0x80   
00162 #define PK_BYTE_ERROR (PK_OVERRUN|PK_PARITY|PK_FRAMING|PK_BREAK) 
00164 #define PK_PACKET_ERROR (PK_BUFFER|PK_BAD_ESCAPE)   
00166 #define PK_BROKEN (PK_PACKET_ERROR|PK_BYTE_ERROR)   
00169 
00170 
00264 #define MAX_PACKET_LENGTH 252  
00265 
00272 #define SINGLE_PACKET_BUFFER_SIZE_WORDS (((MAX_PACKET_LENGTH)>>2)+1)
00273 #define SINGLE_PACKET_BUFFER_SIZE_BYTES (SINGLE_PACKET_BUFFER_SIZE_WORDS<<2)
00274 
00275 #define BYTE_BUFFER_BITS 9   /* 512 bytes.  Big enough for a worst-case escaped packet (though
00276                                 that's not strictly required, since we deframe incrementally). */
00277 #define BYTE_BUFFER_BYTES (1<<BYTE_BUFFER_BITS)
00278 
00279 #define BYTE_BUFFER_MASK (BYTE_BUFFER_BYTES-1)
00280 
00281 
00284 #endif /*SFBCONSTANTS_H_*/

Generated on Thu Sep 17 07:37:51 2009 for SFB by doxygen 1.5.9