Skip to content

README template for stm32yyxx-hal crates #1

@marcoieni

Description

@marcoieni

At the moment every hal crate (i.e. l4xx, f4xx and so on) has its own README format.

we should define a standard template.

For example:

# stm32yyxx-hal

[![Crates.io](https://img.shields.io/crates/v/stm32yyxx-hal.svg)](https://crates.io/crates/stm32yyxx-hal)
[![Docs](https://docs.rs/stm32yyxx-hal/badge.svg)](https://docs.rs/stm32yyxx-hal)

## About

- Minimum rustc version 1.xx

## Setting up your project

Check if the BSP for your board exists in the
[stm32-rs](https://github.com/stm32-rs) page.
If it exists, the `stm32yyxx-hal` crate should be already included, so you can
use the bsp as BSP for your project.

Otherwise, create a new Rust project as you usually do with `cargo init`. The
"hello world" of embedded development is usually to blink a LED. The code to do
so is available in [examples/delay-blinky.rs](examples/delay-blinky.rs).
Copy that file to the `main.rs` of your project.

You also need to add some dependencies to your `Cargo.toml`:

toml
[dependencies]
embedded-hal = "0.2"
nb = "0.1.2"
cortex-m = "0.6"
cortex-m-rt = "0.6"
# Panic behaviour, see https://crates.io/keywords/panic-impl for alternatives
panic-halt = "0.2"

[dependencies.stm32yyxx-hal]
version = "0.8"
features = ["rt", "stm32yyxx"] # replace the model of your microcontroller here


## License

I will not go more in detail because defining the template in this issue is not very convenient. Let's just choose the path of this file I will make a pull request where we talk about it.
I propose: hal_template/README.md
In the future in this directory I would like to place also template for issues and pull requests, contributing guidelines, github actions and so on.

EDIT: we could also create a template repository instead of a subdirectory of this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions