You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "PetervdPerk-NXP (via GitHub)" <gi...@apache.org> on 2024/05/07 19:48:40 UTC
[PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
PetervdPerk-NXP opened a new pull request, #12299:
URL: https://github.com/apache/nuttx/pull/12299
## Summary
LPUART peripheral supports single-wire but requires manual switching of duplex.
This PR introduces the TIOCSSINGLEWIREDUPLEX ioctl and the implementation for IMXRT & S32K3XX
## Impact
S32K3XX/IMXRT
## Testing
MR-CANHUBK344
FMU-V6X-RT
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "PetervdPerk-NXP (via GitHub)" <gi...@apache.org>.
PetervdPerk-NXP commented on PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#issuecomment-2104168660
Supersedes by #12318 which removes the need for an ioctl
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#discussion_r1593553958
##########
include/nuttx/serial/tioctl.h:
##########
@@ -198,6 +198,14 @@
#define SER_SWAP_ENABLED (1 << 0) /* Enable/disable RX/TX swap */
+/* Single-wire UART Duplex */
+
+#define TIOCSSINGLEWIREDUPLEX _TIOC(0x0037) /* Set single-wire duplex mode */
+#define TIOCGSINGLEWIREDUPLEX _TIOC(0x0038) /* Get single-wire duplex mode */
Review Comment:
so, the user need call two ioctl to enable singlewire mode?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#discussion_r1593496785
##########
include/nuttx/serial/tioctl.h:
##########
@@ -202,6 +202,14 @@
#define TIOCSLINID _TIOC(0x0037) /* Master send one LIN header with specified LIN identifier: uint8_t */
+/* Single-wire UART Duplex */
+
+#define TIOCSSINGLEWIREDUPLEX _TIOC(0x0038) /* Set single-wire duplex mode */
Review Comment:
I fund the name confusing, it is the opposite of what it is. It is HALFDUPLEX, but, I would call it TIOCSSINGLEWIREUNIDIRECTIONAL.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#discussion_r1593491650
##########
arch/arm/src/imxrt/imxrt_serial.c:
##########
@@ -2629,7 +2629,7 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg)
if ((arg & SER_SINGLEWIRE_ENABLED) != 0)
{
- uint32_t gpio_val = IOMUX_OPENDRAIN;
+ uint32_t gpio_val = 0;
Review Comment:
Why re-move the information?
##########
include/nuttx/serial/tioctl.h:
##########
@@ -202,6 +202,14 @@
#define TIOCSLINID _TIOC(0x0037) /* Master send one LIN header with specified LIN identifier: uint8_t */
+/* Single-wire UART Duplex */
+
+#define TIOCSSINGLEWIREDUPLEX _TIOC(0x0038) /* Set single-wire duplex mode */
Review Comment:
I fund the name confusing, it is the opposite of what it is. It is SIMPLEX, but, I would call it TIOCSSINGLEWIREUNIDIRECTIONAL.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "PetervdPerk-NXP (via GitHub)" <gi...@apache.org>.
PetervdPerk-NXP commented on code in PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#discussion_r1593482765
##########
include/nuttx/serial/tioctl.h:
##########
@@ -198,6 +198,14 @@
#define SER_SWAP_ENABLED (1 << 0) /* Enable/disable RX/TX swap */
+/* Single-wire UART Duplex */
+
+#define TIOCSSINGLEWIREDUPLEX _TIOC(0x0037) /* Set single-wire duplex mode */
+#define TIOCGSINGLEWIREDUPLEX _TIOC(0x0038) /* Get single-wire duplex mode */
Review Comment:
I've looked at that before, but re-using `TIOCSSINGLEWIRE` requires state tracking whether `SER_SINGLEWIRE_ENABLED` is enabled. Using `TIOCSSINGLEWIREDUPLEX` we can keep it simple and stateless.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#discussion_r1593245173
##########
include/nuttx/serial/tioctl.h:
##########
@@ -198,6 +198,14 @@
#define SER_SWAP_ENABLED (1 << 0) /* Enable/disable RX/TX swap */
+/* Single-wire UART Duplex */
+
+#define TIOCSSINGLEWIREDUPLEX _TIOC(0x0037) /* Set single-wire duplex mode */
+#define TIOCGSINGLEWIREDUPLEX _TIOC(0x0038) /* Get single-wire duplex mode */
Review Comment:
why not continue use TIOCSSINGLEWIRE?
##########
include/nuttx/serial/tioctl.h:
##########
@@ -198,6 +198,14 @@
#define SER_SWAP_ENABLED (1 << 0) /* Enable/disable RX/TX swap */
+/* Single-wire UART Duplex */
+
+#define TIOCSSINGLEWIREDUPLEX _TIOC(0x0037) /* Set single-wire duplex mode */
Review Comment:
0x48 dup with TIOCSLINID
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "PetervdPerk-NXP (via GitHub)" <gi...@apache.org>.
PetervdPerk-NXP commented on code in PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#discussion_r1593503687
##########
arch/arm/src/imxrt/imxrt_serial.c:
##########
@@ -2629,7 +2629,7 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg)
if ((arg & SER_SINGLEWIRE_ENABLED) != 0)
{
- uint32_t gpio_val = IOMUX_OPENDRAIN;
+ uint32_t gpio_val = 0;
Review Comment:
That would put the IMXRT in opendrain mode. But this is problematic for sending at high rate because only the internal pull-ups would make the signal high. Hence changing to push-pull for TX.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "PetervdPerk-NXP (via GitHub)" <gi...@apache.org>.
PetervdPerk-NXP closed pull request #12299: serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex
URL: https://github.com/apache/nuttx/pull/12299
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "PetervdPerk-NXP (via GitHub)" <gi...@apache.org>.
PetervdPerk-NXP commented on PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#issuecomment-2099179554
FYI @davids5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] serial: Add TIOCSSINGLEWIREDUPLEX for LPUART singleduplex [nuttx]
Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #12299:
URL: https://github.com/apache/nuttx/pull/12299#discussion_r1593515048
##########
arch/arm/src/imxrt/imxrt_serial.c:
##########
@@ -2629,7 +2629,7 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg)
if ((arg & SER_SINGLEWIRE_ENABLED) != 0)
{
- uint32_t gpio_val = IOMUX_OPENDRAIN;
+ uint32_t gpio_val = 0;
Review Comment:
Maybe it is appropriate for the IMX, but we have seen multiple drivers on the line and thresholding issues so the control was added for the PU control.
But in any case use IOMUX_PUSHPULL so there is not loss of information.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org