uart_api.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:2k
- /*****************************************************************************
- Copyright (c) 2000 ZORAN Corporation, All Rights Reserved
- THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
- File: "uart_api.h" 07/11/01
- Created by: Rinat Alfia rinata@zoran.co.il
- Description:
- header file for Uart driver for UART 0 - use by Boot ROM only.
- *****************************************************************************/
- #ifndef UART_API_H
- #define UART_API_H
- #include "config.h"
- #include "IncludeSysdefs.h"
- //#define START_CODE 0xffff
- #define MAX_MESSAGE_DATA_LENGTH 512
- #define CRC_DATA_LENGTH 4
- typedef enum
- {
- /* Host -> boot */
- MESSAGE_PING = 0x0000,
- MESSAGE_RELEASE_DEVICE = 0x0001,
- MESSAGE_KEY_DOWNLOAD = 0x0002,
- MESSAGE_KEY_UPLOAD = 0x0003,
- MESSAGE_KEY_DELETE = 0x0004,
- MESSAGE_ACKNOWLEDGE_PING = 0x0100,
- MESSAGE_ACKNOWLEDGE_RELEASE_DEVICE = 0x0101,
- MESSAGE_ACKNOWLEDGE_KEY_DOWNLOAD = 0x0102,
- MESSAGE_ACKNOWLEDGE_KEY_UPLOAD = 0x0103,
- MESSAGE_ACKNOWLEDGE_KEY_DELETE = 0x0104,
- MESSAGE_ACKNOWLEDGE_ERROR = 0x0111,
- }MESSAGE_TYPE;
- #define KEY_IS_DOWNLOADED 0x80
- #define KEY_ISNOT_DOWNLOADED 0x00
- void Check_Uart_Rx(UINT8 hTimer);
- BOOL _uartIsTxReady(void);
- BOOL _uartIsRxReady(void);
- void _uartOpen(void);
- void _uartBaudRate( unsigned int baud_rate );
- void _uartSndByte( unsigned char byte);
- unsigned char _uartRcvByte(void);
- void _uartSndNBytes(unsigned char *p , int N );
- BOOL _uartRcvNBytes( unsigned char *p, int N);
- void boot_outport ( unsigned int __portid, unsigned int __value );
- unsigned int boot_inport ( unsigned int __portid );
- #endif