Using break condition on serial port in MQX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using break condition on serial port in MQX

Jump to solution
1,603 Views
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 Kudos
1 Solution
1,591 Views
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

 

View solution in original post

0 Kudos
2 Replies
1,583 Views
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,592 Views
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 Kudos