Tool/software: TI-RTOS
Hi,
I had a quick question about the how the UART driver works.
As I understand it, when using the UART driver, Hardware interrupt is automatically enabled. But how do I get the HWI to point to my function where I process the data?
my code:
In a task:
uint8_t buffer[20];
UART_Handle uart;
UART_Params uartParams;
// Initialize the UART driver.
UART_init();
// Create a UART with data processing off.
UART_Params_init(&uartParams);
uartParams.readMode = UART_MODE_BLOCKING;
uartParams.readCallback = UartRxFxn;
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 9600;
uart = UART_open(Board_UART0, &uartParams);
static void UartRxFxn(UART_Handle handle, void *buf, size_t count){
System_printf("task firing\n");
System_flush();
Semaphore_post(uartSem);
}
Reading and Writing to UART works fine by calling UART_read() and UART_write(). But how do I get the hardware interrupt to point to "UartRxFxn"?
The application locks up in UART_open() if I try to define the HWI myself(interrupt vector 21).
Any ideas? :-)