本文整理汇总了C++中rt_hw_serial_isr函数的典型用法代码示例。如果您正苦于以下问题:C++ rt_hw_serial_isr函数的具体用法?C++ rt_hw_serial_isr怎么用?C++ rt_hw_serial_isr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rt_hw_serial_isr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rt_fh_uart_handler
void rt_fh_uart_handler(int vector, void *param)
{
int status;
unsigned int ret;
struct fh_uart *uart;
unsigned int reg_status;
rt_device_t dev = (rt_device_t)param;
uart = (struct fh_uart *)dev->user_data;
status = uart_get_iir_status(uart->uart_port);
if (status & UART_IIR_NOINT)
{
return;
}
if(status & UART_IIR_THREMPTY) {
//first close tx isr
uart_disable_irq(uart->uart_port,UART_IER_ETBEI);
rt_hw_serial_isr((struct rt_serial_device *)dev, RT_SERIAL_EVENT_TX_DONE);
}
else if((status & UART_IIR_CHRTOUT)==UART_IIR_CHRTOUT) {
//bug....
//if no data in rx fifo
reg_status = uart_get_status(uart->uart_port);
if((reg_status & 1<<3) == 0)
ret = uart_getc(uart->uart_port);
}
else {
rt_interrupt_enter();
rt_hw_serial_isr((struct rt_serial_device *)dev, RT_SERIAL_EVENT_RX_IND);
rt_interrupt_leave();
}
}
示例2: UART0_IRQHandler
void UART0_IRQHandler(void)
{
if (nrf_uart_int_enable_check(NRF_UART0, NRF_UART_INT_MASK_ERROR)
&& nrf_uart_event_check(NRF_UART0, NRF_UART_EVENT_ERROR))
{
nrf_uart_event_clear(NRF_UART0, NRF_UART_EVENT_ERROR);
}
if (nrf_uart_int_enable_check(NRF_UART0, NRF_UART_INT_MASK_RXDRDY)
&& nrf_uart_event_check(NRF_UART0, NRF_UART_EVENT_RXDRDY))
{
rt_hw_serial_isr(working_cfg->serial, RT_SERIAL_EVENT_RX_IND);
}
if (nrf_uart_int_enable_check(NRF_UART0, NRF_UART_INT_MASK_TXDRDY)
&& nrf_uart_event_check(NRF_UART0, NRF_UART_EVENT_TXDRDY))
{
rt_hw_serial_isr(working_cfg->serial, RT_SERIAL_EVENT_TX_DONE);
}
if (nrf_uart_event_check(NRF_UART0, NRF_UART_EVENT_RXTO))
{
rt_hw_serial_isr(working_cfg->serial, RT_SERIAL_EVENT_RX_TIMEOUT);
}
}
示例3: USART1_IRQHandler
void USART1_IRQHandler(void)
{
struct stm32_uart* uart;
uart = &uart1;
/* enter interrupt */
rt_interrupt_enter();
if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{
rt_hw_serial_isr(&serial1, RT_SERIAL_EVENT_RX_IND);
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
}
if (USART_GetITStatus(uart->uart_device, uart->tx_irq_type) != RESET)
{
/* clear interrupt */
rt_hw_serial_isr(&serial1, RT_SERIAL_EVENT_TX_DONE);
if (uart->tx_irq_type == USART_IT_TC)
{
USART_ClearITPendingBit(uart->uart_device, uart->tx_irq_type);
}
}
if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET)
{
stm32_getc(&serial1);
}
/* leave interrupt */
rt_interrupt_leave();
}
示例4: UART0_RX_TX_IRQHandler
/* Implementation of UART0 handler named in startup code. */
void UART0_RX_TX_IRQHandler(void)
{
rt_interrupt_enter();
rt_hw_serial_isr((struct rt_serial_device*)&_kinetis_serial, RT_SERIAL_EVENT_RX_IND);
//UART_DRV_IRQHandler(0);
rt_interrupt_leave();
}
示例5: uart_isr
/**
* Uart common interrupt process. This need add to uart ISR.
*
* @param serial serial device
*/
static void uart_isr(struct rt_serial_device *serial)
{
struct imxrt_uart *uart;
LPUART_Type *base;
RT_ASSERT(serial != RT_NULL);
uart = (struct imxrt_uart *) serial->parent.user_data;
RT_ASSERT(uart != RT_NULL);
base = uart->uart_base;
RT_ASSERT(base != RT_NULL);
/* enter interrupt */
rt_interrupt_enter();
/* UART in mode Receiver -------------------------------------------------*/
if (LPUART_GetStatusFlags(base) & kLPUART_RxDataRegFullFlag)
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
}
/* If RX overrun. */
if (LPUART_STAT_OR_MASK & base->STAT)
{
/* Clear overrun flag, otherwise the RX does not work. */
base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_OR_MASK);
}
/* leave interrupt */
rt_interrupt_leave();
}
示例6: _ep_out_handler
/**
* This function will handle cdc bulk out endpoint request.
*
* @param func the usb function object.
* @param size request size.
*
* @return RT_EOK.
*/
static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size)
{
rt_uint32_t level;
struct vcom *data;
RT_ASSERT(func != RT_NULL);
RT_DEBUG_LOG(RT_DEBUG_USB, ("_ep_out_handler %d\n", size));
data = (struct vcom*)func->user_data;
/* receive data from USB VCOM */
level = rt_hw_interrupt_disable();
rt_ringbuffer_put(&data->rx_ringbuffer, data->ep_out->buffer, size);
rt_hw_interrupt_enable(level);
/* notify receive data */
rt_hw_serial_isr(&data->serial);
data->ep_out->request.buffer = data->ep_out->buffer;
data->ep_out->request.size = EP_MAXPACKET(data->ep_out);
data->ep_out->request.req_type = UIO_REQUEST_READ_MOST;
rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request);
return RT_EOK;
}
示例7: UART4_IRQHandler
void UART4_IRQHandler(void)
{
struct stm32_uart* uart;
uart = &uart4;
/* enter interrupt */
rt_interrupt_enter();
if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{
rt_hw_serial_isr(&serial4, RT_SERIAL_EVENT_RX_IND);
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
}
if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET)
{
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_TC);
}
if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET)
{
stm32_getc(&serial4);
}
/* leave interrupt */
rt_interrupt_leave();
}
示例8: CME_UART_IRQHandler
static void CME_UART_IRQHandler(struct rt_serial_device *serial)
{
struct CME_M7_uart* uart;
RT_ASSERT(serial != RT_NULL);
uart = (struct CME_M7_uart *)serial->parent.user_data;
if(UART_GetIntStatus(uart->uart_device, UART_Int_RxNotEmpty))
{
UART_ClearInt(uart->uart_device, UART_Int_RxNotEmpty);
rt_hw_serial_isr(&serial2, RT_SERIAL_EVENT_RX_IND);
}
if(UART_GetIntStatus(uart->uart_device, UART_Int_RxThresholdReach))
{
UART_ClearInt(uart->uart_device, UART_Int_RxThresholdReach);
}
if(UART_GetIntStatus(uart->uart_device, UART_Int_OverrunError))
{
UART_ClearInt(uart->uart_device, UART_Int_OverrunError);
}
if(UART_GetIntStatus(uart->uart_device, UART_Int_FrameError))
{
UART_ClearInt(uart->uart_device, UART_Int_FrameError);
}
if(UART_GetIntStatus(uart->uart_device, UART_Int_ParityError))
{
UART_ClearInt(uart->uart_device, UART_Int_ParityError);
}
}
示例9: MFS3RX_IRQHandler
void MFS3RX_IRQHandler(void)
{
/* enter interrupt */
rt_interrupt_enter();
rt_hw_serial_isr(&serial3, RT_SERIAL_EVENT_RX_IND);
/* leave interrupt */
rt_interrupt_leave();
}
示例10: USART1_IRQHandler
void USART1_IRQHandler(void) {
struct usart_dev* usart_dev = Serial1.c_dev();
rt_interrupt_enter();
if (usart_dev->regs->SR & USART_SR_RXNE) {
rt_hw_serial_isr(&serial1, RT_SERIAL_EVENT_RX_IND);
}
rt_interrupt_leave();
}
示例11: USART2_Handler
void USART2_Handler(void)
{
/* enter interrupt */
rt_interrupt_enter();
rt_hw_serial_isr(&usart2.serial);
/* leave interrupt */
rt_interrupt_leave();
}
示例12: dbg_uart_irq_handler
void dbg_uart_irq_handler(void * data)
{
u32 IrqEn = DiagGetIsrEnReg();
DiagSetIsrEnReg(0);
rt_hw_serial_isr(&ameba_dbg_serial, RT_SERIAL_EVENT_RX_IND);
DiagSetIsrEnReg(IrqEn);
}
示例13: UART1_RX_TX_IRQHandler
/* Implementation of UART1 handler named in startup code. */
void UART1_RX_TX_IRQHandler(void)
{
rt_interrupt_enter();
rt_hw_serial_isr((struct rt_serial_device*)&_kinetis_serial, RT_SERIAL_EVENT_RX_IND);
/* Disable receive data full and rx overrun interrupt */
//UART_BWR_C2_RIE(g_uartBase[1], 0U);
//UART_HAL_SetIntMode(g_uartBase[1], kUartIntRxOverrun, false);
//UART_BWR_C2_TIE(g_uartBase[1], 0U);
rt_interrupt_leave();
}
示例14: ameba_uart_irq
static void ameba_uart_irq(uint32_t id, SerialIrq event)
{
struct rt_serial_device *serial = (struct rt_serial_device *)id;
if(event == RxIrq)
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
}
else if(event == TxIrq)
{
}
}
示例15: USART1_IRQHandler
/*******************************************************************************
* Function Name : USART1_IRQHandler
* Description : This function handles USART1 global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void USART1_IRQHandler(void)
{
#ifdef RT_USING_UART1
extern struct rt_device uart1_device;
/* enter interrupt */
rt_interrupt_enter();
rt_hw_serial_isr(&uart1_device);
/* leave interrupt */
rt_interrupt_leave();
#endif
}