com_phy_layer.h File Reference

#include <time.h>
#include "common_defs.h"

Go to the source code of this file.

Classes

struct  CPLComDevice
struct  CPLEthDevice
struct  CPLConfig
struct  CPL_OBJ

Defines

#define CPL_DIM_RX_BUFF   260
#define CPL_DIM_TX_BUFF   260
#define CPL_LOW_BYTE(w)   ( *( UINT8*)( (UINT16*)&w))
#define CPL_HIGH_BYTE(w)   ( *((( UINT8*) ((UINT16*) &w))+ 1 ))
#define CPL_MAKE_WORD(a, b)   (((UINT16)((UINT8)(a)))| (((UINT16)((UINT8)(b)))<< 8))
#define MSK_BYTE(bCh)   ( 1<< (( UINT8)bCh))
#define MSK_WORD(wCh)   ( 1<< (( UINT16)wCh))
#define CPL_SWAP_WORD(value)   CPL_MAKE_WORD( CPL_HIGH_BYTE( value), CPL_LOW_BYTE( value))
#define CPL_GET_WORD(pWord)   ( CPL_MAKE_WORD( *(UINT8*)(( UINT8*)(pWord)+1), *( UINT8*)(pWord)))
#define CPL_GET_NATIVE_WORD(pWord)   ( CPL_MAKE_WORD( *(UINT8*)(( UINT8*)(pWord)), *( UINT8*)(pWord)+1))
#define CPL_SET_NATIVE_WORD(pWord, wValue)   *( UINT8*)(pWord)= CPL_LOW_BYTE(wValue);*(UINT8*)(( UINT8*)(pWord)+1)= CPL_HIGH_BYTE(wValue);
#define CPL_SET_WORD(pWord, wValue)   *( UINT8*)(pWord)= CPL_HIGH_BYTE(wValue);*(UINT8*)(( UINT8*)(pWord)+1)= CPL_LOW_BYTE(wValue);

Enumerations

enum  CPLBufferType { RX_BUFFER, TX_BUFFER, BOTH_BUFFER }
enum  CPLDevice { CPL_COM, CPL_ETH }
enum  CPLComBaudrate {
  SERBAUD_9600, SERBAUD_19200, SERBAUD_38400, SERBAUD_57600,
  SERBAUD_115200
}
enum  CPLComParity { SERPARITY_NONE, SERPARITY_EVEN, SERPARITY_ODD }
enum  CPLComStopBit { STOP_ONE, STOP_5ONE, STOP_TWO }
enum  CPLComDataBit { DATA_SEVEN, DATA_EIGHT }
enum  CPLComRtsFlow { RTS_DISABLE, RTS_HANDSHAKE }
enum  CPLComDtrFlow { DTR_DISABLE, DTR_HANDSHAKE }

Functions

void CPL_BiosInit (CPL_OBJ *pCPLObj)
BOOL CPL_Open (CPL_OBJ *pCPLObj, const CPLConfig *pConfig)
BOOL CPL_Close (CPL_OBJ *pCPLObj)
void CPL_Flush (CPL_OBJ *pCPLObj, CPLBufferType type)
UINT8 * CPL_GetBuffTX (CPL_OBJ *pCPLObj, UINT16 *wSize)
BOOL CPL_TX (CPL_OBJ *pCPLObj, UINT16 wCount)
const UINT8 * CPL_GetBuffRX (CPL_OBJ *pCPLObj, UINT16 *wSize)
BOOL CPL_RX (CPL_OBJ *pCPLObj, UINT16 wCount)
UINT16 CPL_GetCount (CPL_OBJ *pCPLObj, CPLBufferType type)
UINT16 CPL_GetFree (CPL_OBJ *pCPLObj, CPLBufferType type)
BOOL CPL_IsDataReady (CPL_OBJ *pCPLObj)
BOOL CPL_Reconnect (CPL_OBJ *pCPLObj)
BOOL CPL_direct_TX (CPL_OBJ *pCPLObj, const UINT8 *bBuff, UINT16 wCount)
BOOL CPL_direct_RX (CPL_OBJ *pCPLObj, UINT8 *bBuff, UINT16 *wCount)


Define Documentation

#define CPL_DIM_RX_BUFF   260

Definition at line 36 of file com_phy_layer.h.

#define CPL_DIM_TX_BUFF   260

Definition at line 37 of file com_phy_layer.h.

#define CPL_GET_NATIVE_WORD ( pWord   )     ( CPL_MAKE_WORD( *(UINT8*)(( UINT8*)(pWord)), *( UINT8*)(pWord)+1))

Definition at line 51 of file com_phy_layer.h.

#define CPL_GET_WORD ( pWord   )     ( CPL_MAKE_WORD( *(UINT8*)(( UINT8*)(pWord)+1), *( UINT8*)(pWord)))

Definition at line 50 of file com_phy_layer.h.

#define CPL_HIGH_BYTE (  )     ( *((( UINT8*) ((UINT16*) &w))+ 1 ))

Definition at line 42 of file com_phy_layer.h.

#define CPL_LOW_BYTE (  )     ( *( UINT8*)( (UINT16*)&w))

Definition at line 41 of file com_phy_layer.h.

#define CPL_MAKE_WORD ( a,
 )     (((UINT16)((UINT8)(a)))| (((UINT16)((UINT8)(b)))<< 8))

Definition at line 43 of file com_phy_layer.h.

#define CPL_SET_NATIVE_WORD ( pWord,
wValue   )     *( UINT8*)(pWord)= CPL_LOW_BYTE(wValue);*(UINT8*)(( UINT8*)(pWord)+1)= CPL_HIGH_BYTE(wValue);

Definition at line 53 of file com_phy_layer.h.

#define CPL_SET_WORD ( pWord,
wValue   )     *( UINT8*)(pWord)= CPL_HIGH_BYTE(wValue);*(UINT8*)(( UINT8*)(pWord)+1)= CPL_LOW_BYTE(wValue);

Definition at line 54 of file com_phy_layer.h.

#define CPL_SWAP_WORD ( value   )     CPL_MAKE_WORD( CPL_HIGH_BYTE( value), CPL_LOW_BYTE( value))

Definition at line 48 of file com_phy_layer.h.

#define MSK_BYTE ( bCh   )     ( 1<< (( UINT8)bCh))

Definition at line 45 of file com_phy_layer.h.

#define MSK_WORD ( wCh   )     ( 1<< (( UINT16)wCh))

Definition at line 46 of file com_phy_layer.h.


Enumeration Type Documentation

Enumerator:
RX_BUFFER 
TX_BUFFER 
BOTH_BUFFER 

Definition at line 56 of file com_phy_layer.h.

Enumerator:
SERBAUD_9600 
SERBAUD_19200 
SERBAUD_38400 
SERBAUD_57600 
SERBAUD_115200 

Definition at line 69 of file com_phy_layer.h.

Enumerator:
DATA_SEVEN 
DATA_EIGHT 

Definition at line 91 of file com_phy_layer.h.

Enumerator:
DTR_DISABLE 
DTR_HANDSHAKE 

Definition at line 104 of file com_phy_layer.h.

Enumerator:
SERPARITY_NONE 
SERPARITY_EVEN 
SERPARITY_ODD 

Definition at line 77 of file com_phy_layer.h.

Enumerator:
RTS_DISABLE 
RTS_HANDSHAKE 

Definition at line 97 of file com_phy_layer.h.

Enumerator:
STOP_ONE 
STOP_5ONE 
STOP_TWO 

Definition at line 84 of file com_phy_layer.h.

enum CPLDevice

Enumerator:
CPL_COM 
CPL_ETH 

Definition at line 63 of file com_phy_layer.h.


Function Documentation

void CPL_BiosInit ( CPL_OBJ pCPLObj  ) 

BOOL CPL_Close ( CPL_OBJ pCPLObj  ) 

BOOL CPL_direct_RX ( CPL_OBJ pCPLObj,
UINT8 *  bBuff,
UINT16 *  wCount 
)

BOOL CPL_direct_TX ( CPL_OBJ pCPLObj,
const UINT8 *  bBuff,
UINT16  wCount 
)

void CPL_Flush ( CPL_OBJ pCPLObj,
CPLBufferType  type 
)

const UINT8* CPL_GetBuffRX ( CPL_OBJ pCPLObj,
UINT16 *  wSize 
)

UINT8* CPL_GetBuffTX ( CPL_OBJ pCPLObj,
UINT16 *  wSize 
)

UINT16 CPL_GetCount ( CPL_OBJ pCPLObj,
CPLBufferType  type 
)

UINT16 CPL_GetFree ( CPL_OBJ pCPLObj,
CPLBufferType  type 
)

BOOL CPL_IsDataReady ( CPL_OBJ pCPLObj  ) 

BOOL CPL_Open ( CPL_OBJ pCPLObj,
const CPLConfig pConfig 
)

BOOL CPL_Reconnect ( CPL_OBJ pCPLObj  ) 

BOOL CPL_RX ( CPL_OBJ pCPLObj,
UINT16  wCount 
)

BOOL CPL_TX ( CPL_OBJ pCPLObj,
UINT16  wCount 
)


Generated on Mon Oct 6 09:29:16 2008 for CAEN N1568 Demo by  doxygen 1.5.6