www.pudn.com > S3c2410bsp.zip > s3c2410xSio.h


/* s3c2410xSio.h - header file for Samsung  */


/* Copyright 1984-2001 Wind River Systems, Inc. */
#include "copyright_wrs.h"


#ifndef __INCs3c2410xSioh
#define __INCs3c2410xSioh

#ifdef __cplusplus
extern "C" {
#endif

#include "sioLib.h"
#include "s3c2410x.h"
#include "config.h"



#define S3C2410X_ULCON         0x0000       
#define S3C2410X_UCON          0x0004       

#define S3C2410X_UFCON		   0x0008		 
#define S3C2410X_UMCON		   0x000C		

#define S3C2410X_USTAT         0x0010       

#define S3C2410X_UERSTAT       0x0014      
#define S3C2410X_UFSTAT        0x0018      
#define S3C2410X_UMSTAT        0x001C      


#define S3C2410X_UTXBUF        0x0020       
#define S3C2410X_URXBUF        0x0024 

#define S3C2410X_UBRDIV        0x0028        

#define PARITY_NONE     0x00            
#define PARITY_ODD      0x20           
#define PARITY_EVEN     0x28          
#define ONE_STOP        0x00          
#define WORD_LEN        0x03          
#define INFRA_RED_NONE	0x00
#define INFRA_RED_MODE	0X40

#define UCON_RX          0x01            
#define UCON_TX          0x04            
#define UCON_TX_DIS      0x00          
#define UCON_BREAK       0x10            
#define UCON_RX_TX_RESET 0xff0           

#define UCON_TX_LEVEL	 0x200	
#define UCON_RX_PULSE	 0x000	

#define USTAT_TX_READY  0x02           
#define USTAT_RX_AVAIL  0x01            
#define USTAT_RX_READY  0x01            

#define UFSTAT_TX_FULL  0x200            
#define UFSTAT_RX_COUNT  0x00F            



#if 1
#define S3C2410X_CNT0_1200      (2499)    
#define S3C2410X_CNT0_2400      (1249)    
#define S3C2410X_CNT0_4800       (624)    
#define S3C2410X_CNT0_9600       (311)    
#define S3C2410X_CNT0_19200      (155)   
#define S3C2410X_CNT0_38400      (77)    
#define S3C2410X_CNT0_57600       (51)   
#define S3C2410X_CNT0_115200      (25)    
#define S3C2410X_CNT0_230400      (12)    
#define S3C2410X_CNT0_460800       (5)    
#endif

      

#define S3C2410X_CNT1_VAL         0x00    


/* device and channel structures */

typedef struct
    {
    /* must be first */

    SIO_CHAN        sio;        


    STATUS            (*getTxChar) ();
    STATUS            (*putRcvChar) ();
    void *            getTxArg;
    void *            putRcvArg;


    UINT32 *          regs;        

    UINT8             intLevelRx;    
    UINT8             intLevelTx;    
  

    UINT32            regDelta;      
    uint_t            options;      
    int               mode;           
    int               baudRate;     

    } S3C2410X_CHAN;


#if defined(__STDC__)

extern void    s3c2410xDevInit  (S3C2410X_CHAN *pChan); 
extern void    s3c2410xDevInit2 (S3C2410X_CHAN *pChan); 
extern void    s3c2410xIntRcv   (S3C2410X_CHAN *pChan);
extern void    s3c2410xIntTx    (S3C2410X_CHAN *pChan);
extern void    s3c2410xInt    (S3C2410X_CHAN *pChan);



#else   /* __STDC__ */

extern void    s3c2410xDevInit  ();
extern void    s3c2410xDevInit2 ();
extern void    s3c2410xIntRcv   ();
extern void    s3c2410xIntTx    ();
extern void    s3c2410xInt    ();


#endif  /* __STDC__ */

#ifdef __cplusplus
}
#endif

#endif  /* __INCs3c2410xSioh */