Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify HAL usage #9

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ wasi-i2c is currently in [Phase 1](https://github.com/WebAssembly/WASI/blob/main

### Portability Criteria

WASI-I2C must have at least two complete independent implementations. One implementation must be implemented on a microcontroller.
WASI-I2C must have at least an independent implementation for the following platforms:
- Linux (ARM)
- Linux (RISC-V)
- RTOS (Zephyr or FreeRTOS)
- Microcontroller implementation (Cortex M4 as a lowerbound)

### Introduction

The WASI-I2C proposal defines an API for the I2C protocol. The API of [embedded_hal](https://github.com/rust-embedded/embedded-hal) is closely followed.
The WASI-I2C proposal defines an API for the I2C protocol. The API of [embedded_hal](https://github.com/rust-embedded/embedded-hal) is taken as an inspiration, but it is not necessary to make use of this library to implement this proposal.

Reference implementations can be found in [i2c-wasm-components](https://github.com/Zelzahn/i2c-wasm-components). Furthermore, there is also a [wasi-embedded-hal](https://crates.io/crates/wasi-embedded-hal) crate that implements the `embedded-hal` traits for the generated bindings.

Expand All @@ -30,6 +34,8 @@ The primary goal is to provide an interface that WASI programs can use to read a

Although I2C is in some aspects not that different from SPI, the purpose of this proposal is to solely focus on I2C.

Currently, behaviour that is not specified by this API is seen as undefined and, unless there's sufficient interest, is regarded as out-of-scope.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you expand on what kind of behavior this is meant to cover?

My thought is, we don't need to specify the full semantics of the I2C protocol in WASI; we just need to specify how the WASI APIs map to I2C operations. With that understanding, it seems like a lot of places where there's ambiguity in terms of what the exact behavior is can be left to the I2C standards to figure out.


### API walk-through

The full API documentation can be found [here](wasi-proposal-template.md).
Expand Down