Using break condition on serial port in MQX

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Using break condition on serial port in MQX

跳至解决方案
1,899 次查看
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 解答
1,887 次查看
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 回复数
1,879 次查看
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;

 

 

1,888 次查看
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 项奖励
回复