Interrupt driven UART communications for better (less cpu time) over serial. More...
Go to the source code of this file.
Interrupt driven UART communications for better (less cpu time) over serial.
Example use:
char string[50]; int str_length = sprintf(string,"Hello World!!\n"); //fill the char buffer uarti_tx_buf(string, str_length); //send out string over uart
Example Hardware and Register setup for interrupt UART:
// *********************************************** // UART Init Section // *********************************************** //Set P0.0 to TXD0 and P0.1 to RXD0 PINSEL0 &= ~(0xF); PINSEL0 |= 0x5; U0LCR = (1<<7);//DLAB = 1 to enable baud rate changes //Rate config from Jason for 115.2k, with 1+0.3 frac divider and pclk = 60MHz U0DLL = 25; U0DLM = 0; U0FDR = 3;//DIVADDVAL = 3 U0FDR |= 10<<4;//MULTVAL = 10; // U0LCR = (0<<7)|(3<<0);//DLAB = 0 to disable baud rate changes, Wordsize = 3 for 8 bit words U0IER = (1<<1);//1: Enable THRE interrupt IO0DIR |= 1<<10; //Unassert SHDN_L on uart level shifter IO0SET = 1<<10;
Example Interrupt setup for the uart_isr:
VICVectAddr8 = (unsigned long)uarti_isr; VICVectCntl8 = 0x20 | VIC_UART0; // Timer1 Interrupt VICIntEnable = 1 << VIC_UART0; // Enable Timer1 Interrupt
Definition in file uart_int.c.