Git Product home page Git Product logo

stm32f30x's Introduction

stm32f30x

Peripheral access API for STM32F30X microcontrollers

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

stm32f30x's People

Contributors

bors[bot] avatar brandonedens avatar homunkulus avatar japaric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32f30x's Issues

Updating cortex-m crate dependency to v0.6+

I encountered a bug (in the USART section of the embedded discovery book) where cortex_m::Peripherals::take().unwrap(); was hanging, around the Peripherals::steal() function.
Updating the cortex_m crate from version 0.5.6 to 0.6.3 solved the problem,
However, I did not find a sensible way to force-update the dependency in crates I depend upon such as this, leading to conflicts.

Can we update the dependency here so other people won't have this bug?

Also, as a workaround, is there a way to override the dependency version in packages, without downloading them locally? something like this:

cortex-m = "!0.6.3" #force updates to 0.6.3, regardless of what the package says.

SPI data register needs option for 8-bit access

The STM32F3 SPI data register DR can respond to reads and writes differently, based on whether the access is 8 bits wide, or 16 (or more) bits wide. For example, when the configured SPI data frame size is 8 bits or less, a single 16-bit write to DR will be interpreted as two data frames. This is called data packing, and is described in the reference manual (see STM32F303x/328x Reference Manual, RM0316, DM00043574, p.965 "Data Packing").

The stm32f30x crate currently has no way of performing a DR register read or write that is not 32 bits, so e.g. a write using

let data_out: u8 = 0xa5;
(*SPI2.get()).dr.write(|w| w.dr().bits(data_out as u16));

results in two data frames being loaded into the transmit FIFO. As a work-around, one may write

core::ptr::write_volatile(&(*SPI2.get()).dr as *const _ as *mut u8, data_out);

to write a single data frame, but at that point, one may as well be using C. :)

I don't recall, nor could I find in a quick search, any other instances of STM32 peripherals behaving this way, but there may be other circumstances where the access width is important. Since the stm32f30x crate is auto-generated from SVD, maybe support for SPI belongs in a higher-level HAL or BSP. But at minimum, it would be nice if the SVD patch added a bit of documentation on the DR register making note of this.

Setting GPIO_MODE_IT_RISING

Sorry for potentially stupid question, but how do I set GPIO_MODE_IT_RISING (0x10110000U) if the API is defined using u8?
EDIT: I'm working off the older version used by your tutorial... which seems to look slightly different from the current implementation.

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.