Comments (8)
I'm wondering how useful are the get_period
and set_period
methods get it comes to building other abstractions, or in even in generic programming. cf. #3 (comment)
from embedded-hal.
Update: this trait is available in release v0.1.0 behind the "unproven" Cargo feature. But there's also a PwmPin
trait that's not feature gated.
from embedded-hal.
I could not implement either of the PWM traits for the PCA9685 driver because all the methods are infallible. I did not feel like starting another digital::v2
debacle so I've just dropped it.
About set_period
/get_period
I think it would be cumbersome to implement since it depends on the "real world" frequency on which everything is running, which may be simply an external input and thus subject to external change plus configurable through a prescaler or power configuration or so.
Even when solving this, the driver will need to calculate an approximation to a combination of prescaler and/or other configs and I feel this is something that the driver user would rather determine themselves so that the authoritatively provided frequency is followed exactly.
Additionally, choosing a Time type seems difficult because of precision and conversion issues.
from embedded-hal.
@eldruin i believe the fallible component is resolved, do you still have concerns with the current implementation?
from embedded-hal.
Indeed. I believe I could implement a split
yielding PwmPin
s in the PCA9685 driver using the embedded-hal
1.0.0 alpha. I will have a try at this soon and see how it works. It will probably be similar to the pcf857x I/O expander driver.
Regarding set_period
/get_period
for the Pwm
trait, my concerns about the frequency calculation still stand.
from embedded-hal.
Can you describe your API concerns in a separate issue for better visibility so we can close this ticket and avoid the impression PWM still doesn't exist? 😅
from embedded-hal.
Sure. I filed #226. This can be closed now.
from embedded-hal.
Thank you!
from embedded-hal.
Related Issues (20)
- Document SemVer hazards of `spi::Operation::DelayNs` HOT 1
- Add `discard` to `BufRead`. HOT 5
- spi: specify expectations regarding peripheral state between transactions HOT 2
- embedded-io: API stability and 1.0.0 release
- Zero-length I2c transfers HOT 3
- embedded-hal-bus shared i2c usage HOT 5
- embedded-hal-bus does not impliment embedded-hal-async traits, despite claiming to HOT 5
- The SPI sharing utilities are broken for fallible chipselect pins HOT 3
- guidance on error handling/propagation of drivers HOT 3
- Handling of parity and framing errors in embedded-io / embedded-io-async
- CAN FD support HOT 1
- unable to return error with embedded hal i2c example HOT 1
- HAL-Bus SPI Exclusive Device Unsatisfied Traits HOT 5
- i2c: Merging of consecutive operations in transaction contract
- SpiDevice's interface can't be used for streaming transactions HOT 6
- SpiDevice implementations in embedded-hal-bus don't provide a way to use active-high chip select HOT 3
- Create an I3C Trait
- Read not implemented for &mut [u8] HOT 1
- README: Links to LICENSE-APACHE and LICENSE-MIT are not found
- How do I share an I2c bus between tasks? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embedded-hal.