James Munns
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Embedded-HAL Meeting - 2020-03-10 ## Final Summary We agreed on 5 things to do NOW (e.g. aiming for a 1.0 or pre-1.0 release), and two things we MIGHT do in the future, if necessary. The things that we WILL do NOW/ASAP, that will constitute a BREAKING change on next release: 1. We will KEEP the "monolithic" embedded-hal crate, where all traits are exposed and developed in a single crate. * This has the impact of closing/rejecting https://github.com/rust-embedded/embedded-hal/pull/169. 2. We will REMOVE versioned traits within the same repo (e.g. `digital::V2`/`digital::V3`). Instead, all breaking changes will be made by making semver changes to the `embedded-hal` crate directly, e.g. going from `0.9.x` to `0.10.0` or `2.x.y` to `3.0.0`. * This has the impact of closing/rejecting https://github.com/rust-embedded/wg/pull/393 3. For the next major release, we will ONLY be offering *Fallible* traits, e.g. traits that return `Result`s. All trait method names will be prefixed with `try_` for consistency, e.g. `try_send`. 4. We will not be providing backwards compatibility/blanket impls/semver tricks. We instead are aiming for "one simple breaking change", instead of trying to make things as gentle as possible. 5. We will remove the `unproven` feature. In the future, new traits will only be added when they are already "proven stable", outside of the `embedded-hal` crate. The things that we MAY do in the future, if necessary, but NOT for the initial release: 6. Reintroduce `Infallible` traits on a case-by-case basis, if there is demand. In particular these may be applied to `Digital*` traits, where it is a very common demand. 7. Split up the embedded-hal traits into separate crates, e.g. one for `embedded-hal-uart`, one for `embedded-hal-spi` ### Justification/Reasoning #### 1 - Monolithic Crate In general, we saw this choice of balancing two options: * A monolithic crate that is tightly versioned, offering: * Preventing N-to-M version mismatches between individual components of embedded-hal traits * No complicated crate structure, workspaces, submodules, etc. * Many individual crates (`embedded-hal-serial`, `-spi`, `-digital`), with MAYBE re-exporting all traits from a top level convenience crate (`embedded-hal`). This could be one repo (with or without a workspace), or multiple separate repos. This would offer: * Ability to make breaking changes on a single-domain item, e.g. `-serial` could have a breaking change while `-spi` wouldn't. We decided in favor of the former, for the sake of initial simplicity. If this becomes an issue in practice, e.g. many breaking changes in individual traits causing frequent breaking changes to `embedded-hal` as a crate, we may decide to implement [optional item 7](#7-OPTIONAL---Broken-up-repos). #### 2 - Removing multiple version in one crate While well intentioned, having multiple version of a trait (particularly with the same Trait/trait method names) seemed to cause problems in practice, particularly in the `digital::(v1|v2|v3)` transitions. Instead, we decided to use Rust's semantic versioning to manage breaking changes. #### 3 - Only Fallible Traits This was a point of extensive discussion. In general, it is difficult to consistently handle (either at the target driver, application, or library driver level) a mix of Fallible and Infallible traits. We would likely have problems where: * A microcontroller driver implements one flavor of a trait, while a library driver requires the other flavor of a trait, OR * There would be hard to see "unwraps" implicit in the code when providing compatibility In order to support the general case of "handle errors explicitly", we decided to only offer Fallible traits to start. If this is TOO painful in practice, in particular with types that almost never are fallible, such as GPIOs using `Digital` traits, we may decide to implement [optional item 6](#6-OPTIONAL---Infallible-traits). #### 4 - No mitigations for breaking changes This was also a point of extensive discussion. In practice, all attempts in the past to "mitigate" breaking changes through semver tricks, blanket impls, or other approaches have generally had unforseen negative side effects, either immediately, or when later changes were desired. Instead, we decided to "keep it simple", which would require many crates to change in a breaking way, but also hopefully in a very simple way. We also discussed tooling to discover and propose changes/PRs across the ecosystem to help mitigate usage issues. #### 5 - No more `unproven` feature In the past, managing `unproven` features, and having "sort of breaking" changes have been a struggling point. Also, people tended to adopt `unproven` features quickly, but the features would take a very long time to stabilize. Instead, we would like to push experimentation OUT of the embedded-hal crate, allowing people to experiment externally, and merge when some kind of feasability had been proven. We don't plan to specify exhaustively *HOW* to achieve this, but instead provide some examples that could make sense. Examples of how to do this include: * For standalone traits, e.g. for CAN, you could make a standalone "trait crate". Once it hits community acceptance/"1.0 status", then we can merge it into embedded-hal * For additions/modifications to existing traits, this could be done by forking embedded-hal, and providing an example impl or two across different targets/drivers to demonstrate feasability. These could be breaking or non-breaking changes Acceptance of new traits/modules/functions, it would be up to the `embedded-hal` team to discuss and approve changes. These discussions should be "lighter" for non-breaking changes, and breaking changes should be considered carefully. #### 6 (OPTIONAL) - Infallible traits See [required item 3](#3---Only-Fallible-Traits). #### 7 (OPTIONAL) - Broken up repos See [required item 1](#1---Monolithic-Crate). ## Meeting Notes: ## Topics - digital:v3 https://github.com/rust-embedded/wg/pull/393 - Make automatic conversion opt-in - Re-Organizing Repo: https://github.com/rust-embedded/embedded-hal/pull/169 - Criteria to actually accept things into embedded hal? https://github.com/rust-embedded/wg/pull/415 - Remove unproven config gate James' meta proposal: - embedded-hal as a top level item - All independent areas as standalone crates - No more "proven", we merge things to the meta for approval problems: - NxM compatibility problem Choices: - Monorepo + Crate - Monometacrate, individual parts Splitting crates into pieces: - Makes workspaces harder to manage - Submodules can be bad Two options: - Workspaces - Problem publishing - Totally separate crates - Have to pull them in, compilation time Can't get things done, because tedious ```rust trait Uart { type Error; fn try_send(&mut self, u8) -> Result<(), Self::Error>; // Default, but overridable impl fn send(&mut self, foo: u8) { self.try_send(foo).unwrap(); } } // in nrf52-hal impl Uart for nUart { type Error = Infallible; fn try_send(&mut self, u8) -> Result<(), Self::Error> { unimplemented!() } } ``` https://github.com/ryankurte/rust-embedded-driver

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully