dataXfer.h

Go to the documentation of this file.
00001 /*
00002  * "Copyright (c) 2008 Robert B. Reese, Bryan A. Jones, J. W. Bruce ("AUTHORS")"
00003  * All rights reserved.
00004  * (R. Reese, reese_AT_ece.msstate.edu, Mississippi State University)
00005  * (B. A. Jones, bjones_AT_ece.msstate.edu, Mississippi State University)
00006  * (J. W. Bruce, jwbruce_AT_ece.msstate.edu, Mississippi State University)
00007  *
00008  * Permission to use, copy, modify, and distribute this software and its
00009  * documentation for any purpose, without fee, and without written agreement is
00010  * hereby granted, provided that the above copyright notice, the following
00011  * two paragraphs and the authors appear in all copies of this software.
00012  *
00013  * IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
00014  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
00015  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
00016  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00017  *
00018  * THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
00019  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
00020  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
00021  * ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
00022  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
00023  *
00024  * Please maintain this header in its entirety when copying/modifying
00025  * these files.
00026  *
00027  *
00028  */
00029 
00030 #ifndef __DATA_XFER_H__
00031 #define __DATA_XFER_H__
00032 
00037 #include "dataXferImpl.h"
00038 
00039 // Specify that this is C code for proper C++ linking
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00046 #define RECEIVE_TIMEOUT (FCY              * 1/20              * 0.1)
00047 
00050 void xferOutChar(char c);
00051 
00052 
00054 #ifndef OUT_CHAR
00055 #ifdef __PIC__
00056 void outChar(uint8 c);
00057 #define OUT_CHAR(c) outChar(c);
00058 #else
00059 void outChar(uint8 c);
00060 #define OUT_CHAR(c) outChar(c);
00061 #endif
00062 #else
00063 // Hack: a command line of -DOUT_CHAR(c)=testOutChar(c) doesn't work. Just -DOUT_CHAR then
00064 // redefine it here.
00065 #undef OUT_CHAR
00066 void testOutChar(uint8 c);
00067 #define OUT_CHAR(c) testOutChar(c)
00068 #endif
00069 
00072 void initDataXfer();
00073 
00088 void specifyVar(uint u_varIndex, void* pv_data, uint u_size, 
00089                 BOOL b_isWriteable, char* psz_format, char* psz_name,
00090                 char* psz_desc);
00091 
00104 #define SPECIFY_VAR(u_varIndex, data, isWriteable, format, desc) \
00105   specifyVar(u_varIndex, &data, sizeof(data), isWriteable, format, #data, desc)
00106 
00110 void sendVar(uint u_varIndex);
00111 
00112 #if !defined(__PIC__) || defined(__DOXYGEN__)
00113 
00124 int formatVar(uint u_varIndex, char* psz_buf);
00125 #endif
00126 
00127 
00128 #if defined(__PIC__) || defined(__DOXYGEN__)
00129 
00136 uint receiveVar(char* c);
00137 
00145 char inCharXfer();
00146 #endif
00147 
00148 
00149 #ifdef __cplusplus
00150 }
00151 #endif
00152 
00153 #endif

Generated on Mon Oct 18 07:40:46 2010 for Python-on-a-chip by  doxygen 1.5.9