Skip to content

Commit 599d44f

Browse files
author
Luo Jia
authored
Merge branch 'master' into new-watchdog-design
2 parents 8a7500b + b46d300 commit 599d44f

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010

1111
### Changed
1212

13+
- The method `try_write` from the trait `blocking::i2c::WriteIter` trait
14+
has been renamed `try_write_iter` for consistency.
15+
- Updated `nb` dependency to version `1`.
1316
- The watchdog API now uses move semantics. See [PR](https://github.com/rust-embedded/embedded-hal/pull/222).
1417

1518
## [v1.0.0-alpha.1] - 2020-06-16
@@ -28,7 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2831
- Void has been replaced with `core::convert::Infallible` which should be used
2932
in trait implementations where methods cannot fail.
3033
- A new [process](https://github.com/rust-embedded/embedded-hal#how-to-add-a-new-trait)
31-
has been adopted for the addition of traits to the embedded-hal.
34+
has been adopted for the addition of traits to the embedded-hal.
3235
- The minimum supported Rust version is 1.35 due to [this issue](https://github.com/rust-lang/rust/issues/54973).
3336

3437
## [v0.2.3] - 2019-05-09

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repository = "https://github.com/rust-embedded/embedded-hal"
1515
version = "1.0.0-alpha.1"
1616

1717
[dependencies]
18-
nb = { version = "0.1.1", features = ["unstable"] }
18+
nb = "1"
1919

2020
[dev-dependencies]
2121
stm32f3 = { version = "0.8", features = ["stm32f303", "rt"] }

src/blocking/i2c.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub trait Write {
3636
/// Error type
3737
type Error;
3838

39-
/// Sends bytes to slave with address `addr`
39+
/// Sends bytes to slave with address `address`
4040
///
4141
/// # I2C Events (contract)
4242
///
@@ -52,20 +52,20 @@ pub trait Write {
5252
/// - `SAK` = slave acknowledge
5353
/// - `Bi` = ith byte of data
5454
/// - `SP` = stop condition
55-
fn try_write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error>;
55+
fn try_write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Self::Error>;
5656
}
5757

5858
/// Blocking write (iterator version)
5959
pub trait WriteIter {
6060
/// Error type
6161
type Error;
6262

63-
/// Sends bytes to slave with address `addr`
63+
/// Sends bytes to slave with address `address`
6464
///
6565
/// # I2C Events (contract)
6666
///
6767
/// Same as `Write`
68-
fn try_write<B>(&mut self, addr: u8, bytes: B) -> Result<(), Self::Error>
68+
fn try_write_iter<B>(&mut self, address: u8, bytes: B) -> Result<(), Self::Error>
6969
where
7070
B: IntoIterator<Item = u8>;
7171
}
@@ -75,7 +75,7 @@ pub trait WriteRead {
7575
/// Error type
7676
type Error;
7777

78-
/// Sends bytes to slave with address `addr` and then reads enough bytes to fill `buffer` *in a
78+
/// Sends bytes to slave with address `address` and then reads enough bytes to fill `buffer` *in a
7979
/// single transaction*
8080
///
8181
/// # I2C Events (contract)
@@ -110,7 +110,7 @@ pub trait WriteIterRead {
110110
/// Error type
111111
type Error;
112112

113-
/// Sends bytes to slave with address `addr` and then reads enough bytes to fill `buffer` *in a
113+
/// Sends bytes to slave with address `address` and then reads enough bytes to fill `buffer` *in a
114114
/// single transaction*
115115
///
116116
/// # I2C Events (contract)

src/prelude.rs

+7
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,26 @@
33
//! The traits have been renamed to avoid collisions with other items when
44
//! performing a glob import.
55
6+
pub use crate::adc::Channel as _embedded_hal_adc_Channel;
67
pub use crate::adc::OneShot as _embedded_hal_adc_OneShot;
78
pub use crate::blocking::delay::DelayMs as _embedded_hal_blocking_delay_DelayMs;
89
pub use crate::blocking::delay::DelayUs as _embedded_hal_blocking_delay_DelayUs;
910
pub use crate::blocking::i2c::{
1011
Read as _embedded_hal_blocking_i2c_Read, Write as _embedded_hal_blocking_i2c_Write,
12+
WriteIter as _embedded_hal_blocking_i2c_WriteIter,
13+
WriteIterRead as _embedded_hal_blocking_i2c_WriteIterRead,
1114
WriteRead as _embedded_hal_blocking_i2c_WriteRead,
1215
};
1316
pub use crate::blocking::rng::Read as _embedded_hal_blocking_rng_Read;
1417
pub use crate::blocking::serial::Write as _embedded_hal_blocking_serial_Write;
1518
pub use crate::blocking::spi::{
1619
Transfer as _embedded_hal_blocking_spi_Transfer, Write as _embedded_hal_blocking_spi_Write,
20+
WriteIter as _embedded_hal_blocking_spi_WriteIter,
1721
};
1822
pub use crate::capture::Capture as _embedded_hal_Capture;
1923
pub use crate::digital::InputPin as _embedded_hal_digital_InputPin;
2024
pub use crate::digital::OutputPin as _embedded_hal_digital_OutputPin;
25+
pub use crate::digital::StatefulOutputPin as _embedded_hal_digital_StatefulOutputPin;
2126
pub use crate::digital::ToggleableOutputPin as _embedded_hal_digital_ToggleableOutputPin;
2227
pub use crate::pwm::Pwm as _embedded_hal_Pwm;
2328
pub use crate::pwm::PwmPin as _embedded_hal_PwmPin;
@@ -26,7 +31,9 @@ pub use crate::rng::Read as _embedded_hal_rng_Read;
2631
pub use crate::serial::Read as _embedded_hal_serial_Read;
2732
pub use crate::serial::Write as _embedded_hal_serial_Write;
2833
pub use crate::spi::FullDuplex as _embedded_hal_spi_FullDuplex;
34+
pub use crate::timer::Cancel as _embedded_hal_timer_Cancel;
2935
pub use crate::timer::CountDown as _embedded_hal_timer_CountDown;
36+
pub use crate::timer::Periodic as _embedded_hal_timer_Periodic;
3037
pub use crate::watchdog::Disable as _embedded_hal_watchdog_Disable;
3138
pub use crate::watchdog::Enable as _embedded_hal_watchdog_Enable;
3239
pub use crate::watchdog::Watchdog as _embedded_hal_watchdog_Watchdog;

0 commit comments

Comments
 (0)