Giter Club home page Giter Club logo

Comments (6)

japaric avatar japaric commented on July 17, 2024

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.

adamgreig avatar adamgreig commented on July 17, 2024

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.

japaric avatar japaric commented on July 17, 2024

@adamgreig Sounds good.

from embedded-hal.

hannobraun avatar hannobraun commented on July 17, 2024

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.

japaric avatar japaric commented on July 17, 2024

@hannobraun Adding a flush method to write makes sense to me.

from embedded-hal.

japaric avatar japaric commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.