MKV31F512VLH12使用UART2

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MKV31F512VLH12使用UART2

ソリューションへジャンプ
543件の閲覧回数
shuangda228
Contributor I

在MKV31F512VLH12的SIM_SOPT5中,只有UART0/UART1的TXSRC/RXSRC,而UART2的SOPT没有找到,请问如何处理UART2的SOPT。

下面代码是对UART0/UART1有效

/*! @name SOPT5 - System Options Register 5 */
/*! @{ */
#define SIM_SOPT5_UART0TXSRC_MASK (0x3U)
#define SIM_SOPT5_UART0TXSRC_SHIFT (0U)
/*! UART0TXSRC - UART 0 transmit data source select
* 0b00..UART0_TX pin
* 0b01..UART0_TX pin modulated with FTM1 channel 0 output
* 0b10..UART0_TX pin modulated with FTM2 channel 0 output
* 0b11..Reserved
*/
#define SIM_SOPT5_UART0TXSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_UART0TXSRC_SHIFT)) & SIM_SOPT5_UART0TXSRC_MASK)
#define SIM_SOPT5_UART0RXSRC_MASK (0xCU)
#define SIM_SOPT5_UART0RXSRC_SHIFT (2U)
/*! UART0RXSRC - UART 0 receive data source select
* 0b00..UART0_RX pin
* 0b01..CMP0
* 0b10..CMP1
* 0b11..Reserved
*/
#define SIM_SOPT5_UART0RXSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_UART0RXSRC_SHIFT)) & SIM_SOPT5_UART0RXSRC_MASK)
#define SIM_SOPT5_UART1TXSRC_MASK (0x30U)
#define SIM_SOPT5_UART1TXSRC_SHIFT (4U)
/*! UART1TXSRC - UART 1 transmit data source select
* 0b00..UART1_TX pin
* 0b01..UART1_TX pin modulated with FTM1 channel 0 output
* 0b10..UART1_TX pin modulated with FTM2 channel 0 output
* 0b11..Reserved
*/
#define SIM_SOPT5_UART1TXSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_UART1TXSRC_SHIFT)) & SIM_SOPT5_UART1TXSRC_MASK)
#define SIM_SOPT5_UART1RXSRC_MASK (0xC0U)
#define SIM_SOPT5_UART1RXSRC_SHIFT (6U)
/*! UART1RXSRC - UART 1 receive data source select
* 0b00..UART1_RX pin
* 0b01..CMP0
* 0b10..CMP1
* 0b11..Reserved
*/
#define SIM_SOPT5_UART1RXSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_UART1RXSRC_SHIFT)) & SIM_SOPT5_UART1RXSRC_MASK)
/*! @} */

 

感谢。

0 件の賞賛
返信
1 解決策
520件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

Hello @shuangda228 ,

Thanks for your post. Please refer to the reference manual of the MKV31F512VLH12.

Celeste_Liu_0-1737511864963.png

The TXSRC/RXSRC of UART0/UART1 is used to control the receive/transmit source selection/configuration.

For UART2, this kind of function is not supported, so there is no SOPT for UART2. This is normal.

Hope it can help you.

BRs,

Celeste

 

---------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
---------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
521件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

Hello @shuangda228 ,

Thanks for your post. Please refer to the reference manual of the MKV31F512VLH12.

Celeste_Liu_0-1737511864963.png

The TXSRC/RXSRC of UART0/UART1 is used to control the receive/transmit source selection/configuration.

For UART2, this kind of function is not supported, so there is no SOPT for UART2. This is normal.

Hope it can help you.

BRs,

Celeste

 

---------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
---------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信