uarthw_dsk5402.h
上传用户:dahaojd
上传日期:2008-01-29
资源大小:14357k
文件大小:3k
源码类别:

DSP编程

开发平台:

C/C++

  1. /*
  2.  *  Copyright 2003 by Texas Instruments Incorporated.
  3.  *  All rights reserved. Property of Texas Instruments Incorporated.
  4.  *  Restricted rights to use, duplicate or disclose this code are
  5.  *  granted through contract.
  6.  *  
  7.  */
  8. /* "@(#) DDK 1.10.00.23 07-02-03 (ddk-b12)" */
  9. /*
  10.  *  ======== uarthw_dsk5402.h ========
  11.  */
  12. #ifndef UARTHW_DSK5402_
  13. #define UARTHW_DSK5402_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef enum {
  18.     UARTHW_DSK5402_WORD7             = 0x02,    /* 7-bit */
  19.     UARTHW_DSK5402_WORD8             = 0x03     /* 8-bit */
  20. } UARTHW_DSK5402_WordLen;
  21. typedef enum {
  22.     UARTHW_DSK5402_STOP1             = 0,       /* 1 stop bit */
  23.     UARTHW_DSK5402_STOP2             = 1        /* 2 stop bits */
  24. } UARTHW_DSK5402_StopBits;
  25. typedef enum {
  26.     UARTHW_DSK5402_DISABLE_PARITY    = 0x0,     /* disable parity checking */
  27.     UARTHW_DSK5402_EVEN_PARITY       = 0x3,     /* enable even parity */
  28.     UARTHW_DSK5402_ODD_PARITY        = 0x2      /* enable odd parity */
  29. } UARTHW_DSK5402_Parity;
  30. typedef enum {
  31.     UARTHW_DSK5402_FLOW_NONE         = 0x0000,          
  32.     UARTHW_DSK5402_FLOW_AFE_RTSCTS   = 0x0001,
  33.     UARTHW_DSK5402_FLOW_AFE_CTS      = 0x0002
  34. } UARTHW_DSK5402_FlowControl;
  35. /* TL16C550C UART baud rates */
  36. typedef enum {
  37.     UARTHW_DSK5402_BAUD_19200      = 12,
  38.     UARTHW_DSK5402_BAUD_38400      = 6,
  39.     UARTHW_DSK5402_BAUD_57600      = 4,
  40.     UARTHW_DSK5402_BAUD_115200     = 2
  41. } UARTHW_DSK5402_Baud;
  42. #define UARTHW_DSK5402_INTR_MASK_DEFAULT 1
  43. /* UART default attributes settings */
  44. #define UARTHW_DSK5402_DEFAULTATTRS  {                  
  45.     UARTHW_DSK5402_FLOW_NONE,                           
  46.     UARTHW_DSK5402_DISABLE_PARITY,                      
  47.     UARTHW_DSK5402_WORD8,                               
  48.     UARTHW_DSK5402_STOP1,                               
  49.     UARTHW_DSK5402_BAUD_115200,                         
  50.     UARTHW_DSK5402_INTR_MASK_DEFAULT                    
  51. }
  52. #define UARTHW_DSK5402_HW_FLOW_MASK (UARTHW_DSK5402_FLOW_AFE_CTS| 
  53.                                      UARTHW_DSK5402_FLOW_AFE_RTSCTS)
  54. typedef struct UARTHW_DSK5402_Params {
  55.     /* Flow Control Parameters */
  56.     UARTHW_DSK5402_FlowControl    flowControl;  
  57.     
  58.     /* Communication Parameters */
  59.     UARTHW_DSK5402_Parity         parity;
  60.     UARTHW_DSK5402_WordLen        wordSize;
  61.     UARTHW_DSK5402_StopBits       stopBits;
  62.     UARTHW_DSK5402_Baud           baud;
  63.     Uns                           intrMask;
  64. } UARTHW_DSK5402_Params;
  65. #ifdef __cplusplus
  66. }
  67. #endif /* extern "C" */
  68. #endif /* UARTHW_DSK5402_ */