I need to know how to use UART interrupt in MicroEJ(when data receive ,do my job) . I dont want use a thread with while(true) (forever loop) to read input stream. we have these functions in C
LLCOMM_UART_callback and LLCOMM_BUFFERED_CONNECTION_dataReceived
//main uart interrupt
void USART6_IRQHandler(void)
{
LLCOMM_UART_callback(&LLCOMM_UARTs[UART6_INDEX]);
}
/* Interrupt callback --------------------------------------------------------*/
void LLCOMM_UART_callback(LLCOMM_UART* llcomm)
{
// retrieve LLCOM environment for given comIndex
LLCOMM_BUFFERED_CONNECTION* env = &llcomm->header;
UART_HandleTypeDef* handle = &llcomm->hal_uart_handle;
uint8_t leave = interrupt_enter();
// check RX
if (__HAL_UART_GET_IT(handle, UART_IT_RXNE))
{
// read data, clear the interrupt and send data to MicroEJ framework
LLCOMM_BUFFERED_CONNECTION_dataReceived(env, handle->Instance->RDR);
}
}
but i cant find how to implement these interface to java ?
the 2nd part is how to use input pins interrupt and interface them to java? is there any API for this??
Thanks