You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zephyr: device: uart: Implement a blocking transmit
There are a lot of comments here trying to explain how this
implementation works. This is complicated by the fact that the
interface described in zephyr/drivers/uart.h doesn't actually allow data
to ever be transmitted.
I make a few assumptions here:
- The part about not being able to call `fifo_fill` outside of the
interrupt is just plain wrong. Since the irq isn't called until a
transmit has finished, keeping this constaint would mean no data could
ever be transmitted.
- Rather than come up with come complex way of sharing the transmitted
data with the irq handler (which we do with receive), we assume that
it is permissible to just disable the tx irq from the handler, and can
turn it back on when writes to the fifo fill it up completely.
I've tested this with an CDC/ACM endpoint, and probably should come up
with a better test for at least some kind of real UART.
It looks like the pl011 uart driver actually tries to implement a
workaround for this nonsensically described interface, and given that,
it maybe actually be the case that this current implementation will just
get spammed with these software irqs.
There is also an async interface, but I don't seem to have any uarts
that actually implement it.
All in all, uart.h in Zephyr needs major work, as these interfaces are
ill-defined.
Signed-off-by: David Brown <[email protected]>
0 commit comments