SFBConstants.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
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 32 
00114 #define MAX_FACE_INDEX (MIN_VIRTUAL_FACE+VIRTUAL_FACE_COUNT) 
00120 #define NOT_A_FACE (MAX_FACE_INDEX) 
00123 
00124 
00127 #define RISING  0x01            
00128 #define FALLING 0x02            
00129 #define CHANGING ((RISING)|(FALLING)) 
00131 
00132 
00135 #define LSBFIRST 0              
00136 #define MSBFIRST 1              
00138 
00139 
00141 #define UNKNOWN_BOOT_MODE 0     
00142 #define RED_BOOT_MODE 1         
00143 #define GREEN_BOOT_MODE 2       
00144 #define BLUE_BOOT_MODE 3        
00145 #define MAX_BOOT_MODES 4       
00147 
00148 
00153 #define PK_DELETED    0x01   
00154 #define PK_OVERRUN    0x02   
00155 #define PK_PARITY     0x04   
00156 #define PK_FRAMING    0x08   
00157 #define PK_BREAK      0x10   
00158 #define PK_BUFFER     0x20   
00159 #define PK_BAD_ESCAPE 0x40   
00160 #define PK_RESERVED8  0x80   
00164 #define PK_BYTE_ERROR (PK_OVERRUN|PK_PARITY|PK_FRAMING|PK_BREAK) 
00166 #define PK_PACKET_ERROR (PK_BUFFER|PK_BAD_ESCAPE)   
00168 #define PK_BROKEN (PK_PACKET_ERROR|PK_BYTE_ERROR)   
00171 
00172 
00266 #define MAX_PACKET_LENGTH 252  
00267 
00274 #define SINGLE_PACKET_BUFFER_SIZE_WORDS (((MAX_PACKET_LENGTH)>>2)+1)
00275 #define SINGLE_PACKET_BUFFER_SIZE_BYTES (SINGLE_PACKET_BUFFER_SIZE_WORDS<<2)
00276 
00277 #define BYTE_BUFFER_BITS 10   
00278 
00279 #define BYTE_BUFFER_BYTES (1<<BYTE_BUFFER_BITS)
00280 
00281 #define BYTE_BUFFER_MASK (BYTE_BUFFER_BYTES-1)
00282 
00283 
00286 #endif