Tool/software: TI-RTOS
Hi,
sdk: processor_sdk_rtos_am57xx_3_02_00_05
pdk: pdk_am57xx_1_0_5
I want to read bytes on UART 3. I want to set this UART port in Hw interrupt mode.
I did the following changes in the code.
#define UART_INSTANCE 2
UART_Params uartParams;
/* UART SoC init configuration */
UART_HwAttrs uart_cfg;
boardCfg = BOARD_INIT_PINMUX_CONFIG |
BOARD_INIT_MODULE_CLOCK | BOARD_INIT_UART_STDIO;
Board_init(boardCfg);
/***************************************UART_In_Callback();***************/
/* Get the default UART init configurations */
UART_socGetInitCfg(UART_INSTANCE, &uart_cfg);
uart_cfg.edmaHandle = NULL;
uart_cfg.dmaMode = FALSE;
uart_cfg.loopback = FALSE;
/* Set the DMA enabled UART init configurations */
UART_socSetInitCfg(UART_INSTANCE, &uart_cfg);
/* Set callback mode for both read and write */
UART_Params_init(&uartParams);
uartParams.readCallback = UART_callback;
uartParams.readMode = UART_MODE_CALLBACK;
uart = UART_open(UART_INSTANCE, &uartParams);
void UART_callback(UART_Handle handle, void *buf, size_t count)
{
int32_t Count_encoder,addrScanPrompt;
addrScanPrompt= (int32_t)scanPrompt;
Count_encoder=UART_read(uart, (void *)addrScanPrompt, UART_TEST_READ_LEN);
Cnt=Cnt+Count_encoder;
}
and send the Cnt value on serial. But the UART_callback function is not getting call.
I think i am doing something wrong or not able to configure uart properly.
I want to read data in interrupt mode. Please help me to solve the issue
Thanks,
Anjana Pathak