Giter Site home page Giter Site logo

tkerber / stm32-usbd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stm32-rs/stm32-usbd

0.0 2.0 0.0 189 KB

usb-device implementation for STM32 microcontrollers

Home Page: https://crates.io/crates/usb-device

License: MIT License

Shell 0.35% Logos 0.09% Rust 99.56%

stm32-usbd's Introduction

crates.io crates.io Build Status

stm32-usbd

usb-device implementation for STM32 microcontrollers.

This repository is a fork for the mvirkkunen/stm32f103xx-usb crate.

Supported microcontrollers

  • STM32F042xx
  • STM32F048xx
  • STM32F072xx
  • STM32F078xx
  • STM32F103xx
  • STM32F303xC
  • STM32F401xx
  • STM32L4x2xx
  • And others...

Feature flags

To use this crate you need to set proper feature flags. All the feature flags are listed in Cargo.toml under different sections.

If your target MCU matches one of the feature flags listed under the Known devices section of Cargo.toml, you can use just that feature flag. For example:

[dependencies]
stm32-usbd = { version = "0.2", features = ["stm32f103xx"] }

For other cases, you have to figure out different properties of your MCU and USB peripheral implemented in it. Each property has a corresponding feature flag that you should set to indicate that property.

Device family:

  • stm32f0
  • stm32f1
  • stm32f3
  • stm32f4
  • stm32l4

Size of dedicated packet buffer memory SRAM:

  • ram_size_512
  • ram_size_1024

Dedicated packet buffer memory SRAM access scheme:

  • ram_access_1x16 - for "1x16 bits/word" access scheme
  • ram_access_2x16 - for "2x16 bits/word" access scheme

USB peripheral features:

  • lpm_support - USB 2.0 Link Power Management (LPM) support
  • bcd_support - Battery Charging Detection (BCD) support
  • dp_pull_up_support - Embedded pull-up resistor on USB_DP line

Various hacks:

  • ram_addr_40006c00 if dedicated SRAM address is equal to 0x4000_6c00 instead of 0x4000_6000
[dependencies]
# An example feature set for STM32F303CB MCU
stm32-usbd = { version = "0.2", features = ["stm32f3", "ram_size_512", "ram_access_1x16"] }
stm32f3xx-hal = { version = "0.1.4", features = ["rt", "stm32f3xx-hal/stm32f303"] }

Note that you also need to set the device feature for stm32*-hal crate.

Examples

See the examples directory for an example of a custom class and a minimalistic USB serial port device.

See the stm32-usbd-examples repo for different device-specific examples.

stm32-usbd's People

Contributors

dfrankland avatar disasm avatar fooker avatar jrobsonchase avatar lichtfeind avatar mvirkkunen avatar texitoi avatar tkerber avatar

Watchers

 avatar  avatar

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.