Skip to content

Humidity API#30

Closed
DanutAldea wants to merge 8 commits into
UPB-CS-OpenSourceUpstream:masterfrom
DanutAldea:humidity_api
Closed

Humidity API#30
DanutAldea wants to merge 8 commits into
UPB-CS-OpenSourceUpstream:masterfrom
DanutAldea:humidity_api

Conversation

@DanutAldea
Copy link
Copy Markdown

Fixes #12

Based on alex's previous work from here
Heavily inspired from the work done #5
This PR would ad the api, an exemple, fake driver and tests.

Comment thread apis/humidity/src/lib.rs Outdated

/// Initiate a synchronous humidity measurement.
/// Returns Ok(humidity_value) if the operation was successful
/// humidity_value is returned in hundreds of centigrades
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the measurement unit returned?

Comment thread apis/humidity/src/lib.rs Outdated
pub fn read_sync() -> Result<u32, ErrorCode> {
let listener: Cell<Option<(u32,)>> = Cell::new(None);
share::scope(|subscribe| {
if let Ok(()) = Self::register_listener(&listener, subscribe) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. This function should return the error that either subscribe or read return.

Comment thread src/lib.rs Outdated
Error, GpioInterruptListener, GpioState, InputPin, OutputPin, PinInterruptEdge, Pull,
PullDown, PullNone, PullUp,
};
pub use gpio::{Error, GpioInterruptListener, GpioState, InputPin, OutputPin, PinInterruptEdge, Pull, PullDown, PullNone, PullUp};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub use gpio::{Error, GpioInterruptListener, GpioState, InputPin, OutputPin, PinInterruptEdge, Pull, PullDown, PullNone, PullUp};
pub use gpio::{
Error, GpioInterruptListener, GpioState, InputPin, OutputPin, PinInterruptEdge, Pull,
PullDown, PullNone, PullUp,
};

I ran cargo fmt and this is the formatted source.

Comment thread apis/humidity/src/lib.rs Outdated
@DanutAldea DanutAldea closed this by deleting the head repository Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Humidity API

2 participants