USART RX開啟及shell
內文有+簡單的介紹
Github
 

GPIO Memory Map

  • reg.h裡面已有定義
  • base address及register offset
 
 
 
------------------------------------------------------------------------------------------------------

將GPIOA可設定為USART RX的PA3設定為RX

  • PA=Port A,如果去看USART3可以看到它可以使用RX/TX的腳位會"類似"(自己去查)PB11/PB10
  • USART2的TX/RX分別對應:TX:PA2 ; RX:PA3,要給其相對應的模式
 
 
----------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
 
 

USART2 Memory Map

  • reg.h裡面已有定義
  • USART2的base address及offset
-------------------------------------------------------------------------------------
 

Enable USART RX

  • 步驟(P662)
------------------------------------------------------------
  • 需要注意的register
  • RXNE
  • This bit is set by hardware when the content of the RDR shift register has been transferred to the USART_DR register. An interrupt is generated if RXNEIE=1 in the USART_CR1 register. It is cleared by a read to the USART_DR register. The RXNE flag can also be cleared by writing a zero to it. This clearing sequence is recommended only for multibuffer communication.
  • 0: Data is not received
  • 1: Received data is ready to be read.
  • if(*(USART2_SR) & USART_FLAG_RXNE)
=================================================================

實做:mini-shell

  • 實做功能
  • UASRT2 RX
  • ps
  • help