Comments (6)
What is missing in this API?
I'd say get_baud_rate
and set_baud_rate
but are those useful to build higher level abstractions? They feel more like configuration-style APIs that you are more likely to do once, specially in the case of set_baud_rate
.
from embedded-hal.
I think Serial should, like SPI, have a Word
associated type rather than using u8. It's not at all uncommon to have 9-bit serial and that's supported by all the embedded UARTs I've seen.
On the other hand, if you did find a UART that didn't support 9-bit serial, you could just not impl for Word=u16, which I think neatly communicates to the user that you can't do 9-bit serial here.
from embedded-hal.
@adamgreig Sounds good.
from embedded-hal.
I'm not sure how generally applicable and useful this is, but in my own serial code I have a flush
method that blocks until the transmitter has become idle. I'm currently converting my code into an implementation of embedded-hal, and since serial::Write
doesn't have such a method, I've decided I don't actually need it. However, I thought I'd mention this here, as something that the hardware is capable of, that isn't represented in the serial traits.
from embedded-hal.
@hannobraun Adding a flush method to write makes sense to me.
from embedded-hal.
The serial::{Read,Write}
traits are now part of a crates.io release so I'm going to close this. If you encounter any problem implementing / using those traits feel free to open a new issue!
from embedded-hal.
Related Issues (20)
- Why do all `Error` traits need to implement `Debug`? HOT 4
- Document SemVer hazards of `spi::Operation::DelayNs` HOT 1
- Add `discard` to `BufRead`. HOT 5
- spi: specify expectations regarding peripheral state between transactions HOT 2
- embedded-io: API stability and 1.0.0 release
- Zero-length I2c transfers HOT 3
- embedded-hal-bus shared i2c usage HOT 5
- embedded-hal-bus does not impliment embedded-hal-async traits, despite claiming to HOT 5
- The SPI sharing utilities are broken for fallible chipselect pins HOT 3
- guidance on error handling/propagation of drivers HOT 3
- Handling of parity and framing errors in embedded-io / embedded-io-async
- CAN FD support HOT 1
- unable to return error with embedded hal i2c example HOT 1
- HAL-Bus SPI Exclusive Device Unsatisfied Traits HOT 5
- i2c: Merging of consecutive operations in transaction contract
- SpiDevice's interface can't be used for streaming transactions HOT 6
- SpiDevice implementations in embedded-hal-bus don't provide a way to use active-high chip select HOT 3
- Create an I3C Trait
- Read not implemented for &mut [u8] HOT 1
- README: Links to LICENSE-APACHE and LICENSE-MIT are not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embedded-hal.