ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
yae has quit [Ping timeout: 260 seconds]
crabbedhaloablut has quit []
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]
<jannic[m]> <onkoe[m]> "thanks for the links! I’ve..." <- > <@onkoe:matrix.org> thanks for the links! I’ve read through the issues but can’t seem to find a ‘replacement’ for my new library.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/MMmujtYFKUIOcypuzMyYBuPO>)
<jannic[m]> If you are writing a library that should be usable on different MCUs, you can define some ADC trait yourself, like the one suggested in the ticket:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/xYWZTqDSXkxecZjfgkkDjBpo>)
<Lumpio-> idk having that in e-h wouldn't hurt IMO
<Lumpio-> I know in a lot of cases it might not be enough just by itself
<Lumpio-> But would it hurt to have it
IlPalazzo-ojiisa has joined #rust-embedded
stgl has quit [Quit: ZNC 1.8.2 - https://znc.in]
stgl has joined #rust-embedded
<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?
IlPalazzo-ojiisa has quit [Quit: Leaving.]
U007D[m] has joined #rust-embedded
<U007D[m]> Does anyone know if it's possible to specify the build target via cargo features?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/VKANLqqkKaNjaQtnHCpyGieV>)
AdamHott[m] has quit [Quit: Idle timeout reached: 172800s]
<firefrommoonligh> (My thought is this is a good question and I am curious what/if the answer is)
<dirbaio[m]> No, it's not possible. 
<U007D[m]> Aw, that’s too bad. But thank you—good to know.
<JamesMunns[m]> My suggestions here would be:
<JamesMunns[m]> * Use a tool like just or xtask to handle the details like this
<JamesMunns[m]> * Have separate, thin bin crates for each target, with the bulk of details in a shared lib
<U007D[m]> Thanks, @jamesmunns:beeper.com, good suggestions
ChristianHeussy[ has joined #rust-embedded
<ChristianHeussy[> U007D: Here's an example that switches out logic based on target. Not sure if it's helpful but I found it interesting the first time I looked it over: https://github.com/Infineon/gpio-access-t2g-bodyentry-starterkit/tree/main/src
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 your lib.rs would likely look like that
<firefrommoonligh> maybe with hard-set range_out values
<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> * /// Map output voltage of the LPPS-22 to output distance, in mm.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/VJMpslkqhBvRQgiaMIjdVGxm>)
<firefrommoonligh> * /// Map output voltage of the LPPS-22 to measured distance, in mm.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/GEYGxpKGfEDQPFLTxGiUDmQV>)
<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] has joined #rust-embedded
<jamwaffles[m]> Is there a way to see what the actual size of the image written to an MCU flash is? I can see the output of `cargo size -q --release -- -A` is e.g.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/KduSxgXxWsYZiMJihesARWNO>)
<jamwaffles[m]> s///, s/out/into flash/
<JamesMunns[m]> s///, s/bin/binary/
<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
<adamgreig[m]> (-B is also the default)
<JamesMunns[m]> I think dec includes ram
<JamesMunns[m]> I do think that by default `.text` includes "everything in flash"
<JamesMunns[m]> (e.g. .rodata and .vector_table get smooshed into that column)
<onkoe[m]> <firefrommoonligh> "For your cal, you could adjust..." <- Woah, thank you so much for the detail and assistance! 🥹
<StephenD[m]> <sourcebox[m]> "What are you trying to do? I'..." <- Where do you get the windows drivers for this?