Hello
we are new to AXM0F343-64-1-TX40
- Can you please show us a simple Single char read by uart interrupt .
- How Do we define the call back ?
- What example code best to implement the code .
thanks in advanced
Yaniv
Hello
we are new to AXM0F343-64-1-TX40
thanks in advanced
Yaniv
Hey Yaniv,
Let me know if you ever figure out how to define a call back function. But if you still need to do a quick uart interrupt, I found that you can use the GPIO_Exception_Handler() in the app.c file. Just declare your uart pins and initialize the RX pin as an interrupt as well.
UART_Init(eUsart0,TX_Pin,RX_Pin,115200UL,NULL);
GPIO_IntEnable(RX_Pin);
if(GPIO_ReadIntStatus(RX_Pin))
{
UART_Receive(eUsart0,myData,sizeof(myData),BLOCK);
printf( “Change \n”);
GPIO_ClearIntStatus(RX_Pin);
}
Hi Yaniv,
the UART example from the AXM0F343 CMSIS pack showcases exactly this functionality.
status = UART_Init(eUsart1, UART1_TX, UART1_RX, UART1_BAUD_RATE,UART1Event)
, where UART1Event is the callback function declared in the same file.UART_Send(eUsart1, uart_rxbuf, DATA_LENGTH, BLOCK)
) and waits to receive 5 chars ( UART_Receive(eUsart1, uart_rxbuf,DATA_LENGTH,NON_BLOCK)
.