sa1100Sio.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* sa1100Sio.h - Digital Semiconductor SA-1100 UART header file */
  2. /* Copyright 1998-2000 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01b,12apr00,jpd  added include of sioLib.h to work with project builds.
  7. 01a,22jan98,jpd  written from ambaSio.h, version 01b.
  8. */
  9. #ifndef __INCsa1100Sioh 
  10. #define __INCsa1100Sioh 
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /* Register description of SA-1100 UART */
  15. #ifndef _ASMLANGUAGE
  16. #include "vxWorks.h"
  17. #include "sioLib.h"
  18. /* Register offsets from base address */
  19. #define UTCR0 0x00 /* UART Control Register 0 */
  20. #define UTCR1 0x04 /* UART Control Register 1 */
  21. #define UTCR2 0x08 /* UART Control Register 2 */
  22. #define UTCR3 0x0C /* UART Control Register 3 */
  23. #define UTDR 0x14 /* UART Control Register */
  24. #define UTSR0 0x1C /* UART Status Register 0 */
  25. #define UTSR1 0x20 /* UART Status Register 1 */
  26. /* bit definitions within UTCR0 register */
  27. #define PARITY_NONE 0x00 /* set no parity */
  28. #define ONE_STOP 0x00 /* set one stop bit */
  29. #define WORD_LEN_8 (1 << 3) /* set 8 data bits */
  30. /* bit definitions within UTCR3 register */
  31. #define UTCR3_RXE 0x01 /* Receiver Enable */
  32. #define UTCR3_TXE 0x02 /* Transmitter Enable */
  33. #define UTCR3_RIM 0x08 /* Rx Interrupt Mask */
  34. #define UTCR3_TIM 0x10 /* Tx Interrupt Mask */
  35. /* bit definitions within UTSR0 register */
  36. #define UTSR0_TFS (1 << 0) /* Tx FIFO Service Request */
  37. #define UTSR0_RFS (1 << 1) /* Rx FIFO Service Request */
  38. #define UTSR0_RID (1 << 2) /* Receiver Idle */
  39. #define UTSR0_RBB (1 << 3) /* Rx beginning of Break */
  40. #define UTSR0_REB (1 << 4) /* Rx end of break */
  41. #define UTSR0_EIF (1 << 5) /* Error in FIFO */
  42. /* bit definitions within UTSR1 register */
  43. #define UTSR1_RNE (1 << 1) /* Receiver FIFO Not Empty */
  44. #define UTSR1_TNF (1 << 2) /* Transmitter FIFO Not Full */
  45. typedef struct SA1100_CHAN
  46.     {
  47.     /* must be first */
  48.     SIO_CHAN sio; /* standard SIO_CHAN element */
  49.     /* callbacks */
  50.     STATUS (*getTxChar) ();  /* installed Tx callback routine */
  51.     STATUS (*putRcvChar) (); /* installed Rx callback routine */
  52.     void * getTxArg; /* argument to Tx callback routine */
  53.     void * putRcvArg; /* argument to Rx callback routine */
  54.     UINT32 * regs; /* UART registers */
  55.     UINT8  level; /* Interrupt level for this device */
  56.     UINT32 channelMode; /* such as INT, POLL modes */
  57.     int baudRate; /* the current baud rate */
  58.     UINT32 xtal; /* UART clock frequency */     
  59.     } SA1100_CHAN;
  60. /* function declarations */
  61. extern void sa1100Int (SA1100_CHAN *pChan);
  62. extern void sa1100DevInit (SA1100_CHAN *pChan);
  63. #endif /* _ASMLANGUAGE */
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67.  
  68. #endif /* __INCsa1100Sioh */