本文整理汇总了C++中rt_hw_serial_isr函数的典型用法代码示例。如果您正苦于以下问题:C++ rt_hw_serial_isr函数的具体用法?C++ rt_hw_serial_isr怎么用?C++ rt_hw_serial_isr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rt_hw_serial_isr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
}
开发者ID:hezlog,项目名称:rt-thread,代码行数:32,代码来源:uart.c
示例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);
}
}
开发者ID:heyuanjie87,项目名称:rt-thread,代码行数:25,代码来源:uart.c
示例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();
}
开发者ID:pengleo392,项目名称:FreeModbus_Slave-Master-RTT-STM32,代码行数:31,代码来源:usart.c
示例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();
}
开发者ID:RT-Thread,项目名称:rtthread_fsl,代码行数:8,代码来源:fsl_uart_irq_rt.c
示例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();
}
开发者ID:geniusgogo,项目名称:rt-thread,代码行数:37,代码来源:drv_uart.c
示例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;
}
开发者ID:cedar-renjun,项目名称:air-conditioning-assistant,代码行数:34,代码来源:cdc_vcom.c
示例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();
}
开发者ID:AdrianHuang,项目名称:rt-thread,代码行数:27,代码来源:usart.c
示例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);
}
}
开发者ID:54chenjq,项目名称:rt-thread,代码行数:33,代码来源:uart.c
示例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();
}
开发者ID:AdrianHuang,项目名称:rt-thread,代码行数:8,代码来源:fm3_uart.c
示例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();
}
开发者ID:hongyegb123,项目名称:wrtnode2r_stm32,代码行数:9,代码来源:usart.c
示例11: USART2_Handler
void USART2_Handler(void)
{
/* enter interrupt */
rt_interrupt_enter();
rt_hw_serial_isr(&usart2.serial);
/* leave interrupt */
rt_interrupt_leave();
}
开发者ID:david1mdavis,项目名称:SAM4N,代码行数:10,代码来源:drv_usart.c
示例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);
}
开发者ID:DigFarmer,项目名称:rt-thread,代码行数:10,代码来源:drv_uart.c
示例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();
}
开发者ID:RT-Thread,项目名称:rtthread_fsl,代码行数:11,代码来源:fsl_uart_irq_rt.c
示例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)
{
}
}
开发者ID:DigFarmer,项目名称:rt-thread,代码行数:11,代码来源:drv_uart.c
示例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
}
开发者ID:Manish-cimcon,项目名称:micro,代码行数:20,代码来源:stm32f10x_it.c
示例16: UART0_UART1_UART2_UART3_IRQHandler
/* Implementation of UART5 handler named in startup code. */
void UART0_UART1_UART2_UART3_IRQHandler(void)
{
rt_interrupt_enter();
rt_hw_serial_isr((struct rt_serial_device*)&_kinetis_serial, RT_SERIAL_EVENT_RX_IND);
for(uint32_t i=0; i < UART_INSTANCE_COUNT; i++)
{
if (CLOCK_SYS_GetUartGateCmd(i))
{
UART_DRV_IRQHandler(i);
}
}
rt_interrupt_leave();
}
开发者ID:RT-Thread,项目名称:rtthread_fsl,代码行数:14,代码来源:fsl_uart_irq_rt.c
示例17: rt_hw_serial_isr
/**/void USART2_IRQHandler(void)
{
extern struct rt_device uart2_device;
extern void rt_hw_serial_isr(struct rt_device *device);
// enter interrupt
rt_interrupt_enter();
rt_hw_serial_isr(&uart2_device);
// leave interrupt
rt_interrupt_leave();
}
开发者ID:TIMCHENY,项目名称:STM32F107Board-rttproject,代码行数:13,代码来源:stm32f10x_it.c
示例18: USART3_IRQHandler
/*******************************************************************************
* Function Name : USART3_IRQHandler
* Description : This function handles USART3 global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void USART3_IRQHandler(void)
{
#ifdef RT_USING_UART3
extern struct rt_device uart3_device;
extern void rt_hw_serial_isr(struct rt_device *device);
// enter interrupt
rt_interrupt_enter();
rt_hw_serial_isr(&uart3_device);
// leave interrupt
rt_interrupt_leave();
#endif
}
开发者ID:dengkuanchina,项目名称:STM32F107Board-rttproject,代码行数:22,代码来源:stm32f10x_it.c
示例19: 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 gd32_uart *uart = (struct gd32_uart *) serial->parent.user_data;
RT_ASSERT(uart != RT_NULL);
/* UART in mode Receiver */
if ((usart_interrupt_flag_get(uart->uart_periph, USART_INT_FLAG_RBNE) != RESET) &&
(usart_flag_get(uart->uart_periph, USART_FLAG_RBNE) != RESET))
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
/* Clear RXNE interrupt flag */
usart_flag_clear(uart->uart_periph, USART_FLAG_RBNE);
}
}
开发者ID:BernardXiong,项目名称:rt-thread,代码行数:20,代码来源:drv_usart.c
示例20: uart_isr
/**
* 中断处理函数
*/
static void uart_isr(usart_t serial)
{
// 获取串口基地址
UART_T *uart_base = ((usart_t)serial)->usart_base;
// 获取中断事件
uint32_t u32IntSts= uart_base->INTSTS;
// 接收中断
if(u32IntSts & (UART_INTSTS_RDAINT_Msk | UART_INTSTS_RXTOINT_Msk))
{
rt_hw_serial_isr(&serial->dev, RT_SERIAL_EVENT_RX_IND);
}
}
开发者ID:heyuanjie87,项目名称:rt-thread,代码行数:18,代码来源:drv_uart.c
注:本文中的rt_hw_serial_isr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论