00001 #ifndef __UART_INT_H__ 00002 #define __UART_INT_H__ 00003 00004 typedef void(*UARTI_CALLBACK_PTR)(void); 00005 00006 void uarti_tx_set_empty_callback(UARTI_CALLBACK_PTR callback); 00007 int uarti_tx_buf(char * buf, int buflen); 00008 void uarti_tx_refill(void); 00009 __irq void uarti_isr(void); 00010 void uarti_print_int(int i); 00011 void uarti_print_int2(int i1, int i2); 00012 void uarti_print_float(float f); 00013 void uarti_print_2float(float f1, float f2); 00014 00015 /* Put into hardware_setup.c 00016 00017 // *********************************************** 00018 // UART Init Section 00019 // *********************************************** 00020 00021 //Set P0.0 to TXD0 and P0.1 to RXD0 00022 PINSEL0 &= ~(0xF); 00023 PINSEL0 |= 0x5; 00024 00025 U0LCR = (1<<7);//DLAB = 1 to enable baud rate changes 00026 //Rate config from Jason for 115.2k, with 1+0.3 frac divider and pclk = 60MHz 00027 U0DLL = 25; 00028 U0DLM = 0; 00029 U0FDR = 3;//DIVADDVAL = 3 00030 U0FDR |= 10<<4;//MULTVAL = 10; 00031 // 00032 00033 U0LCR = (0<<7)|(3<<0);//DLAB = 0 to disable baud rate changes, Wordsize = 3 for 8 bit words 00034 00035 U0IER = (1<<1);//1: Enable THRE interrupt 00036 00037 IO0DIR |= 1<<10; //Unassert SHDN_L on uart level shifter 00038 IO0SET = 1<<10; 00039 00040 00041 VICVectAddr8 = (unsigned long)uarti_isr; 00042 VICVectCntl8 = 0x20 | VIC_UART0; // Timer1 Interrupt 00043 VICIntEnable = 1 << VIC_UART0; // Enable Timer1 Interrupt 00044 */ 00045 00046 #endif /* __UART_INT_H__ */
1.6.3