Skip to content

gpio port not actually Floating #213

@daschl

Description

@daschl

Hi,

I'm not sure if this is expected, but it at least looks "weird" to me. The issue is that my Input, even though marked as Floating, doesn't work out of the box, only if I call into_floating_input explicitly on it.

So, consider this code:

let peripherals = Peripherals::take().unwrap();
let port1 = p1::Parts::new(peripherals.P1);
let external_temp_sensor = Tsic::new(port1.p1_08.into_floating_input().degrade());

This work as expected (my Tsic takes Pin<Input<Floating>> as an argument). But if I do it like this, it compiles, but I'll never get the high and low states of the pin:

let peripherals = Peripherals::take().unwrap();
let port1 = p1::Parts::new(peripherals.P1);
let external_temp_sensor = Tsic::new(port1.p1_08.degrade());

Would it be possible that the port on the peripheral is neither Floating, nor PullDown or PullUp but it would always have to be turned into one of these types? This would make it explicit that it needs to be called, I couldn't figure out why my sensor didn't work and only stumbled on this by trial and error. Or is there something else going on that I'm missing?

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions