-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
1 changed file
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters