/home/hillier_g/checkout/most4linux/libnetservices/include/user_adjust/most_drv.h

00001 /*
00002 ==============================================================================
00003 
00004 Project:        MOST NetServices 
00005 Module:         MOST Low Level Driver, Macro Definitions, Header Inclusion
00006 File:           most_drv.h
00007 Version:        1.10.03 
00008 Language:       C
00009 Author(s):      S.Kerber
00010 Date:           25.Feb.2005
00011 
00012 FileGroup:      Layer I
00013 Customer ID:    20D0FF0B011003.N.SIERE
00014 FeatureCode:    FCR1
00015 ------------------------------------------------------------------------------
00016 
00017                 (c) Copyright 1998-2005
00018                 Oasis SiliconSystems AG
00019                 All Rights Reserved
00020 
00021 ------------------------------------------------------------------------------
00022 
00023 
00024 
00025 Modifications
00026 ~~~~~~~~~~~~~
00027 Date    By      Description
00028 
00029 ==============================================================================
00030 */
00031 
00032 #ifndef _MOSTDRV_H
00033 #define _MOSTDRV_H
00034 
00035 
00036 
00037 
00038 //------------------------------------------
00039 // Serial Control Port Driver: I2C 
00040 //------------------------------------------
00041 #ifdef CP_I2C 
00042     #include "sw_i2c.h"                         // Include your own respective headerfile
00043 #endif
00044 
00045 
00046 
00047 //------------------------------------------
00048 // Serial Control Port Driver: SPI 
00049 //------------------------------------------
00050 #ifdef CP_SPI
00051     #include "spi.h"                            // Include your own respective headerfile
00052 #endif
00053 
00054 
00055 
00056 //------------------------------------------
00057 // Parallel Control Port Driver
00058 //------------------------------------------
00059 #ifdef CP_PAR
00060     #include "par_cp.h"                         // Include your own respective headerfile
00061 #endif
00062 
00063 
00064 
00065 //------------------------------------------
00066 // Com Port Driver 
00067 // (only if using internal MOST Transceiver)
00068 //------------------------------------------
00069 #ifdef CP_COM 
00070     #include "com_port.h"                       // Include your own respective headerfile
00071 #endif
00072 
00073 
00074 
00075 //------------------------------------------
00076 // Parallel Asynchronous Source Port 
00077 // Interface
00078 //------------------------------------------
00079 #ifdef PADT
00080     #include "par_sp.h"                         // Include your own respective headerfile
00081 #endif                                      
00082 
00083 
00084 
00085 
00086 //-------------------------------------------------------
00087 // Select MOST I2C Address if using I2C Interface
00088 //-------------------------------------------------------
00089 #define I2C_ADDR_MOST   0x40
00090 
00091 
00092 
00093 
00094 
00095 //-------------------------------------------------------
00096 // Access on Controll Port
00097 //-------------------------------------------------------
00098 
00099 #ifdef CP_I2C
00100     #define MOST_WRITE(map,value)           I2cWrite((tMostMap)(map), (byte)(value), (byte)I2C_ADDR_MOST)
00101 
00102     #define MOST_WRITEBLOCK(map,num,ptr)    I2cWriteBlock((tMostMap)(map), (byte)(num), (byte *)(ptr), (byte)I2C_ADDR_MOST)
00103 
00104     #define MOST_READ(map)                  I2cRead((tMostMap)(map), (byte)I2C_ADDR_MOST)
00105 
00106     #define MOST_READBLOCK(map,num,ptr)     I2cReadBlock((tMostMap)(map), (byte)(num), (byte *)(ptr), (byte)I2C_ADDR_MOST)
00107 #endif
00108 
00109 #ifdef CP_SPI
00110     #define MOST_WRITE(map,value)           SPIWrite((tMostMap)(map), (byte)(value))
00111                         
00112     #define MOST_WRITEBLOCK(map,num,ptr)    SPIWriteBlock((tMostMap)(map), (byte)(num), (byte *)(ptr))
00113                                 
00114     #define MOST_READ(map)                  SPIRead((tMostMap)(map))
00115 
00116     #define MOST_READBLOCK(map,num,ptr)     SPIReadBlock((tMostMap)(map), (byte)(num), (byte *)(ptr))
00117 #endif
00118 
00119 #ifdef CP_PAR
00120     #define MOST_WRITE(map,value)           ParWrite((tMostMap)(map),(byte)(value))
00121 
00122     #define MOST_WRITEBLOCK(map,num,ptr)    ParWriteBlock((tMostMap)(map),(byte)(num), (byte *)(ptr))
00123 
00124     #define MOST_READ(map)                  ParRead((tMostMap)(map))
00125 
00126     #define MOST_READBLOCK(map,num,ptr)     ParReadBlock((tMostMap)(map),(byte)(num), (byte *)(ptr))
00127 #endif
00128 
00129 
00130 #ifdef CP_COM
00131     #define MOST_WRITE(map,value)           CheWrite((tMostMap)(map),(byte)(value))
00132 
00133     #define MOST_WRITEBLOCK(map,num,ptr)    CheWriteBlock((tMostMap)(map),(byte)(num), (byte *)(ptr))
00134 
00135     #define MOST_READ(map)                  CheRead((tMostMap)(map))
00136 
00137     #define MOST_READBLOCK(map,num,ptr)     CheReadBlock((tMostMap)(map),(byte)(num), (byte *)(ptr))
00138 #endif
00139 
00140 
00141 
00142 //-------------------------------------------------------
00143 // Access on Parallel Asynchronous Source Port:
00144 //-------------------------------------------------------
00145 #ifdef PADT
00146 
00147 #ifndef MOST_MAP_16BIT  // 8Bit map
00148     #define PAR_A_WRITE_MAP(page, map)                  ParAWriteMap((byte)(page), (byte)(map))
00149 
00150     #define PAR_A_WRITE_SINGLE_BYTE(page, map, value)   ParAWriteSingleByte((byte)(page), (byte)(map), (byte)(value))
00151 
00152     #define PAR_A_WRITE_DATA(num, ptr)                  ParAWriteData((byte)(num), (byte*)(ptr))
00153 
00154     #define PAR_A_READ_DATA(num, ptr)                   ParAReadData((byte)(num), (byte*)(ptr))
00155 #endif
00156 
00157 #ifdef MOST_MAP_16BIT   // 16Bit map (page+map)
00158     #define PAR_A_WRITE_MAP(page, map)                  ParAWriteMap((word)(map))                       // parameter page is not used
00159 
00160     #define PAR_A_WRITE_SINGLE_BYTE(page, map, value)   ParAWriteSingleByte((word)(map), (byte)(value)) // parameter page is not used
00161 
00162     #define PAR_A_WRITE_DATA(num, ptr)                  ParAWriteData((byte)(num), (byte*)(ptr))
00163 
00164     #define PAR_A_READ_DATA(num, ptr)                   ParAReadData((byte)(num), (byte*)(ptr))
00165 #endif
00166 
00167 #endif
00168 
00169 
00170 
00171 
00172 /*------------------------------------------------------------------------------------------------------------
00173     Secondary Node Solution
00174     
00175     The following macros are only required, if SECONDARY NODE is defined in adjust.h
00176 
00177     Please note: The following macros are just an example (control port in I2C mode).
00178 ------------------------------------------------------------------------------------------------------------*/
00179 #ifdef SECONDARY_NODE
00180 
00181     #define I2C_ADDR_MOST_SEC   0x42
00182 
00183     #define MOST_WRITE_SEC(map, value)                  I2cWrite((tMostMap)(map), (byte)(value), (byte)I2C_ADDR_MOST_SEC)
00184 
00185     #define MOST_WRITEBLOCK_SEC(map, num, ptr)          I2cWriteBlock((tMostMap)(map), (byte)(num), (byte *)(ptr), (byte)I2C_ADDR_MOST_SEC)
00186 
00187     #define MOST_READ_SEC(map)                          I2cRead((tMostMap)(map), (byte)I2C_ADDR_MOST_SEC)
00188 
00189     #define MOST_READBLOCK_SEC(map, num, ptr)           I2cReadBlock((tMostMap)(map), (byte)(num), (byte *)(ptr), (byte)I2C_ADDR_MOST_SEC)
00190 
00191 #endif
00192 
00193 
00194 
00195 /*------------------------------------------------------------------------------------------------------------
00196     Extended Hardware Layer Interface
00197     
00198     The following macros are only required, if MNS_MSG_INTF is defined in adjust.h
00199 ------------------------------------------------------------------------------------------------------------*/
00200 
00201 //-------------------------------------------------------
00202 // Access to the HW Layer CTRL-IN-FIFO
00203 //-------------------------------------------------------
00204 //  #define MOST_WRITE_CMD(pcmd)                            MostWriteCmd((pTMnsCtrl)(pcmd))
00205 
00206 //-------------------------------------------------------
00207 // Access to the HW Layer CTRL-OUT-FIFO
00208 //-------------------------------------------------------
00209 //  #define MOST_READ_INFO(pinfo)                           MostReadInfo((pTMnsCtrl)(pinfo))
00210 //  #define MOST_INFO_PENDING                               MostInfoPending()
00211 
00212 
00213 //-------------------------------------------------------
00214 // Access to the HW Layer MSG-IN-FIFO
00215 //-------------------------------------------------------
00216 //  #define MOST_MSG_TRANSMIT(handle, pmsg, num_data)       MostMsgTransmit((word)(handle), (byte*)(pmsg), (byte)(num_data))
00217 
00218 //-------------------------------------------------------
00219 // Access to the HW Layer MSG-OUT-FIFO
00220 //-------------------------------------------------------
00221 //  #define MOST_MSG_RECEIVE(pmsg)                          MostMsgReceive((byte*)(pmsg))
00222 //  #define MOST_MSG_RXPENDING                              MostMsgRxPending()
00223 
00224 
00225 
00226 #endif // _MOSTDRV_H
00227 
00228 //-------------------------------------------------------------------
00229 // END OF most_drv.h
00230 //-------------------------------------------------------------------

Generated on Fri Mar 9 14:48:59 2007 for MOST Adaption Layer for Netservices Library by  doxygen 1.5.0