Trying to use 2 serial ports with MQX. Need commands similar to Interniche.

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

Trying to use 2 serial ports with MQX. Need commands similar to Interniche.

ソリューションへジャンプ
1,041件の閲覧回数
terryt
Contributor I

I'm using MQX 3.5 and a M52259demo board. I having trouble simply adding another serial port (polling type) while having the existing terminal functionality on ttya. I'm an Interniche user that finds the Interniche code easier to follow.

 

With Interniche there are two commands:    uart_putc( int unit, unsigned char ch) & uart_getc( int unit). I'm using two serial ports just fine. I'm trying to port code over to MQX and can't find a similar command.

 

The only commands I come across is putchar & getchar. That works for one serial port, but I want to use two serial ports. Is there a similar command like in MQX like the ones above from Interniche?

タグ(3)
0 件の賞賛
1 解決策
376件の閲覧回数
DavidS
NXP Employee
NXP Employee

Attaching an example that can be copied and pasted into the MQX4.x/mqx/examples/io project to play with a second UART of your choice.

Regards,

David

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
376件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Terry,

You need to enable the appropriate #define for the second UART you want to use in the user_config.h header file and then re-compile the build_libs.mcp for the demo board.

Then reference the enclose example. It is simple modified/enhanced version of the examples/io project.

Regards,

David

 

0 件の賞賛
377件の閲覧回数
DavidS
NXP Employee
NXP Employee

Attaching an example that can be copied and pasted into the MQX4.x/mqx/examples/io project to play with a second UART of your choice.

Regards,

David

0 件の賞賛