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
已解决! 转到解答。
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
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;
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