STM32/STM8技术论坛
直播中

richthoffen

13年用户 2745经验值
擅长:嵌入式技术 控制/MCU
私信 关注
[问答]

这一句的意思是允许USART_IT_RXNE中断,还是产生USART_IT_RXNE中断.

USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
这一句的意思是允许USART_IT_RXNE中断,还是产生USART_IT_RXNE中断.

回帖(5)

扑街仔

2017-3-22 08:02:13
当接受到数据时是否进入接收中断,,你说是允许还是产生
举报

刘旭

2017-3-22 08:02:40
是使能中断,按照你的理解 就是允许
举报

看山还是山123

2017-3-22 09:36:34
允许。
举报

大熊现在很幸福

2017-3-22 10:10:54
如果你是stm32初学者,建议你查看STM32固件库使用手册的中文翻译版.pdf
关于这个函数有如下解释:
捕获1.PNG
如果你有一定的stm32基础,建议你直接查看库函数源代码:
这个里面是官方原版解释,如下图:
捕获.PNG
2 举报

叶子心

2017-9-7 09:58:38
本帖最后由 叶子心 于 2017-9-7 10:08 编辑

允许USART_IT_RXNE中断。。。
/**
  * @brief  Checks whether the specified USART interrupt has occurred or not.
  * @param  USARTx: Select the USART or the UART peripheral.
  *   This parameter can be one of the following values:
  *   USART1, USART2, USART3, UART4 or UART5.
  * @param  USART_IT: specifies the USART interrupt source to check.
  *   This parameter can be one of the following values:
  *     @arg USART_IT_CTS:  CTS change interrupt (not available for UART4 and UART5)
  *     @arg USART_IT_LBD:  LIN Break detection interrupt
  *     @arg USART_IT_TXE:  Tansmit Data Register empty interrupt
  *     @arg USART_IT_TC:   Transmission complete interrupt
  *     @arg USART_IT_RXNE: Receive Data register not empty interrupt
  *     @arg USART_IT_IDLE: Idle line detection interrupt
  *     @arg USART_IT_ORE:  OverRun Error interrupt
  *     @arg USART_IT_NE:   Noise Error interrupt
  *     @arg USART_IT_FE:   Framing Error interrupt
  *     @arg USART_IT_PE:   Parity Error interrupt
  * @retval The new state of USART_IT (SET or RESET).
  */
ITStatus USART_GetITStatus(USART_TypeDef* USARTx, uint16_t USART_IT)
举报

更多回帖

发帖
×
20
完善资料,
赚取积分