uart_api.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:2k
源码类别:

DVD

开发平台:

Others

  1. /*****************************************************************************
  2. Copyright (c) 2000 ZORAN Corporation, All Rights Reserved
  3. THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
  4. File: "uart_api.h"                                      07/11/01
  5.       Created by: Rinat Alfia rinata@zoran.co.il
  6. Description:
  7.       header file for Uart driver for UART 0 - use by Boot ROM only.
  8. *****************************************************************************/
  9. #ifndef UART_API_H
  10. #define UART_API_H
  11. #include "config.h"
  12. #include "IncludeSysdefs.h"
  13. //#define START_CODE 0xffff
  14. #define MAX_MESSAGE_DATA_LENGTH 512
  15. #define CRC_DATA_LENGTH 4
  16. typedef enum
  17. {
  18. /* Host -> boot */
  19. MESSAGE_PING = 0x0000,
  20. MESSAGE_RELEASE_DEVICE = 0x0001,
  21. MESSAGE_KEY_DOWNLOAD = 0x0002,
  22. MESSAGE_KEY_UPLOAD = 0x0003,
  23.   MESSAGE_KEY_DELETE = 0x0004,
  24.   MESSAGE_ACKNOWLEDGE_PING = 0x0100,
  25. MESSAGE_ACKNOWLEDGE_RELEASE_DEVICE = 0x0101,
  26. MESSAGE_ACKNOWLEDGE_KEY_DOWNLOAD = 0x0102,
  27. MESSAGE_ACKNOWLEDGE_KEY_UPLOAD = 0x0103,
  28.   MESSAGE_ACKNOWLEDGE_KEY_DELETE = 0x0104,
  29.   MESSAGE_ACKNOWLEDGE_ERROR = 0x0111,
  30. }MESSAGE_TYPE;
  31. #define KEY_IS_DOWNLOADED 0x80
  32. #define KEY_ISNOT_DOWNLOADED 0x00
  33. void Check_Uart_Rx(UINT8 hTimer);
  34. BOOL _uartIsTxReady(void);
  35. BOOL _uartIsRxReady(void);
  36. void _uartOpen(void);
  37. void _uartBaudRate( unsigned int baud_rate );
  38. void _uartSndByte( unsigned char byte);
  39. unsigned char _uartRcvByte(void);
  40. void _uartSndNBytes(unsigned char *p , int N );
  41. BOOL _uartRcvNBytes( unsigned char *p, int N);
  42. void  boot_outport ( unsigned int __portid, unsigned int __value );
  43. unsigned int boot_inport ( unsigned int __portid );
  44. #endif