Guest7282 has left #rust-embedded [Error from remote client]
emerent_ has joined #rust-embedded
emerent is now known as Guest8342
emerent_ is now known as emerent
Guest8342 has quit [Ping timeout: 276 seconds]
<onkoe[m]>
<jannic[m]> "Here is some explanation: https:..." <- thanks for the links! I’ve read through the issues but can’t seem to find a ‘replacement’ for my new library.
<onkoe[m]>
would it suffice to just take a pin from the caller and hope they’re not wrong? does a DigitalPin work for this?
<onkoe[m]>
s/a/an/, s/DigitalPin/OutputPin/
notgull has quit [Ping timeout: 240 seconds]
notgull has joined #rust-embedded
<korken89[m]>
<sourcebox[m]> "korken89: After having a..." <- Ah that's a bit harder, but having a f32 only nice with that sounds fine as well :)
notgull has quit [Ping timeout: 255 seconds]
notgull has joined #rust-embedded
notgull has quit [Ping timeout: 264 seconds]
notgull has joined #rust-embedded
m3vict[m] has quit [Quit: Idle timeout reached: 172800s]
danielb[m] has quit [Quit: Idle timeout reached: 172800s]
henrik_alser[m] has quit [Quit: Idle timeout reached: 172800s]
yae has joined #rust-embedded
FreeKill[m] has quit [Quit: Idle timeout reached: 172800s]
notgull has quit [Ping timeout: 240 seconds]
yae has quit [Ping timeout: 255 seconds]
crabbedhaloablut has joined #rust-embedded
Guest7282 has joined #rust-embedded
djdisodo[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7282 has left #rust-embedded [Error from remote client]
eZioPan[m] has quit [Quit: Idle timeout reached: 172800s]
<JamesMunns[m]>
I don't think the decision was "e-hal shouldn't have one", it was "nobody could agree what would cover all/most bases in a portable way"
<JamesMunns[m]>
I'm sure that discussion will start again after 1.0 ships :D
<jannic[m]>
It wouldn't add much, either. The old API was removed because it wasn't working well, and the ticket for adding a new one is still open because nobody considered it important enough to work on it pre-1.0.
<jannic[m]>
And there are a lot of details to be defined: What does the result mean? Should the ADC value be scaled so that `0..u32::MAX` is the full range of possible values? What `Error` values can be returned? etc.
vollbrecht[m] has quit [Quit: Idle timeout reached: 172800s]
<Lumpio->
I think the error question should be solved exactly the same way as the other traits
<Lumpio->
If Arduino manages to have an analogRead having an equivalent wouldn't hurt even if it's not perfect!
Guest7282 has joined #rust-embedded
<Lumpio->
Although, hm
<Lumpio->
What kind of abstract drivers would one build with an adc hmm
<firefrommoonligh>
onkoe: What is your specific use case/project req?
diondokter[m] has quit [Quit: Idle timeout reached: 172800s]
<U007D[m]>
<ChristianHeussy[> "U007D: Here's an example that..." <- Yes, this is similar to what I am doing. The desire to set the target by specifying the target is improving developer ergonomics—no need to specify (and possibly mess up) redundant pieces of information. Not possible, sadly, so I’ll take James’ suggestion and codify the combinations of required features. ty!
<onkoe[m]>
<firefrommoonligh> "onkoe: What is your specific use..." <- My apologies - I should have led with that! I’m developing a library for the LPPS-22 analog linear potentiometer. However, I’m not sure how to take its inputs without using a 0.3 channel.
<onkoe[m]>
Since embedded-hal 1.0 doesn’t have the `adc` module, I don’t know if any crate retains this ADC functionality 😅
IlPalazzo-ojiisa has joined #rust-embedded
<firefrommoonligh>
I looked it up. I would use a function that is a linear map between excitation voltage and motion range. Likely a one-liner fn body
<firefrommoonligh>
* For something that small, I would not use a lib, but if you go that route, your lib.rs would likely look like that.
<firefrommoonligh>
* maybe with configurablerange_out and excitation_voltage values, vice fn params.
notgull has joined #rust-embedded
<firefrommoonligh>
Obtaining voltage_read will be specific to the ADC used. Ie if it's one onboard MCU A, MCU B, an I2C one etc etc; not the role of the LPPS-22 lib. There is an interface here: the voltage reading, between ADC, and LPPS-22. LPPS-22 is only relevant to things downstream of this interface.
<firefrommoonligh>
* Obtaining
<firefrommoonligh>
voltage_read will be specific to the ADC used. Ie if it's one onboard MCU A, MCU B, an I2C one etc etc; not the role of the LPPS-22 lib. There is an interface here: the voltage reading, between ADC, and LPPS-22.
<firefrommoonligh>
I would probably also include some sort of calibration
<firefrommoonligh>
For your cal, you could adjust the input and output ranges, or if you want to get fancy, model as a polynomial to eliminate the slight non-linearity
StephenD[m] has joined #rust-embedded
<StephenD[m]>
I asked about this a while ago but then my power went out and I got busy, so sorry for reviving this. But does anyone know anything about using dfu on linux with the zadig libusb driver? It just gives me permission issues
<StephenD[m]>
I also tried dfu-buddy but it's saying it can't find the memory region. I am wondering if this is just the permissions issue bubbling up as something else though
<StephenD[m]>
I'm open to changing to a different driver, just having trouble sourcing one
<jamwaffles[m]>
Hacky way is good way! I just want to see if some refactors are bloating the final image so I'm not looking for too much detail/accuracy. Thanks!
adamgreig[m] has joined #rust-embedded
<adamgreig[m]>
Or use -B instead of -A and then "dec" is everything written to flash iirc