Using break condition on serial port in MQX

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

Using break condition on serial port in MQX

ソリューションへジャンプ
2,498件の閲覧回数
sudhanshumehta
Contributor IV

Hello Everyone, 

 

RTOS used: 4.2

IDE kinetics Design studio

Microcontroller K22

 

Question: I want to start/set break condition at serial port and then after some time I want to stop break condition at serial port. 

 

I see IO_IOCTL_SERIAL_START_BREAK option but it is not used in BSP.

Any suggestion how can i use this for example UART 1

Thanks

Sudhanshu

0 件の賞賛
返信
1 解決策
2,486件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi @sudhanshumehta :

 

For the send break, I would suggest you modify mqx/source/io/serial/polled/serl_pol_kuart.c

 

ioctl turns SBK on using sci_ptr->C2 |= UART_C2_SBK_MASK;

ioctl turns SDB off using sci_ptr->C2 &= ~UART_C2_SBK_MASK;

 

Regards

Daniel

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,478件の閲覧回数
sudhanshumehta
Contributor IV

This worked for me Thanks Daniel.

ioctl(YourFDname_FD,      IO_IOCTL_SERIAL_START_BREAK,    1);

ioctl(YourFDname_FD,      IO_IOCTL_SERIAL_STOP_BREAK,     1);

You can type cast last parameter

Added following 2 case statements.

case IO_IOCTL_SERIAL_START_BREAK:
sci_ptr->C2 |= UART_C2_SBK_MASK;
break;

case IO_IOCTL_SERIAL_STOP_BREAK:
sci_ptr->C2 &= ~UART_C2_SBK_MASK;
break;

 

 

2,487件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi @sudhanshumehta :

 

For the send break, I would suggest you modify mqx/source/io/serial/polled/serl_pol_kuart.c

 

ioctl turns SBK on using sci_ptr->C2 |= UART_C2_SBK_MASK;

ioctl turns SDB off using sci_ptr->C2 &= ~UART_C2_SBK_MASK;

 

Regards

Daniel

 

0 件の賞賛
返信