www.pudn.com > RS485_USART-ok.rar > usart.h, change:2008-12-15,size:1070b


 
 
 
#ifndef _USART_H 
#define _USART_H 
 
 
#define baud_rate      38400 
#define AT91C_US_485_BAUD 		19200 
 
#define AT91C_US_485_MODE ( AT91C_US_USMODE_RS485 + \ 
                        AT91C_US_NBSTOP_1_BIT + \ 
                        AT91C_US_PAR_NONE + \ 
                        AT91C_US_CHRL_8_BITS + \ 
                        AT91C_US_CLKS_CLOCK ) 
 
#define PC_USART_INTERRUPT_LEVEL	 	AT91C_AIC_PRIOR_HIGHEST - 4 
 
#define SPEED_US0_INTERRUPT_LEVEL       AT91C_AIC_PRIOR_HIGHEST 
#define COMM_REC_DATA_FIFO_SIZE         10 
 
 
typedef struct _comm_rec_data_fifo 
{ 
       INT8U DATA_BUF[COMM_REC_DATA_FIFO_SIZE];        // FIFO  
	INT8U	comm_ptr;						// FIFO ָ 
	 
}COMM_REC_DATA_FIFO; 
 
extern  char PCRxBuf1[COMM_REC_DATA_FIFO_SIZE]; 
extern  char PCRxBuf2[COMM_REC_DATA_FIFO_SIZE]; 
extern COMM_REC_DATA_FIFO   USART_FIFO; 
void US_Init(void); 
void Usart_Send(char *str); 
INT8S GET_Char(void); 
void USART_DATA_IRQ_Handle(AT91PS_USART pUSART); 
void PC_USART_INTERRUPT(void); 
//void COMM_USART0_Interrupt_Handler(void); 
#endif