stm32f1xx-hal | Rust embedded-hal HAL impl
kandi X-RAY | stm32f1xx-hal Summary
kandi X-RAY | stm32f1xx-hal Summary
HAL for the STM32F1 family of microcontrollers.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of stm32f1xx-hal
stm32f1xx-hal Key Features
stm32f1xx-hal Examples and Code Snippets
Community Discussions
Trending Discussions on stm32f1xx-hal
QUESTION
For a hobby project using the stm32f1xx-hal, I'm wanting to periodically read a sensor and then push the values such that I can graph them realtime in a webUSB app.
I have found an example in webusb_blinky by mvirkkunen which demonstrates the connectivity portion, but it's not clear to me how I would adapt it to publish sensor values. Should I be overriding control_in
?
Any suggestions/help would be appreciated. Thanks!
...ANSWER
Answered 2020-Mar-23 at 18:44You could define a control transfer that requested the device respond with the current sensor values but the more natural USB mechanism for publishing sensor updates is with an IN endpoint.
The usbd-serial module is the best example I can find of creating and using endpoints with this framework. A serial port consists of both an IN and OUT endpoint for bidirectional streaming of data. For your application you would only need the IN endpoint since the device only generates data.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install stm32f1xx-hal
Create a new Rust project as you usually do with cargo init. The hello world of embedded development is usually to blink an LED and code to do so is available in examples/blinky.rs. Copy that file to the main.rs of your project.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page