Skip to content

Commit be1bf6d

Browse files
committed
Update nix and bitflags
1 parent 6ab8417 commit be1bf6d

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
99
## [Unreleased]
1010

1111
- Hide nix from the public api such that it can be updated without resulting in a breaking change.
12-
- Updated nix to version `0.25`.
13-
- Updated nix to version `0.24`; only use the `ioctl` feature.
12+
- Updated nix to version `0.26`; only use the `ioctl` feature.
13+
- Updated `bitflags` to version `2.3`.
1414
- Use `File.read_exact` instead of `File.read` in `LinuxI2CDevice.read` so that the buffer is filled.
1515
- Fix the lifetime parameter on `LinuxI2CMessage` to ensure that it does not outlive the buffer it points to.
1616
- Updated MSRV to 1.60.0.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Provides API for safe access to Linux i2c device interface.
1616

1717
[dependencies]
1818
libc = "0.2"
19-
bitflags = "1.3"
19+
bitflags = "2.3"
2020
byteorder = "1"
21-
nix = { version = "0.25", default-features = false, features = ["ioctl"] }
21+
nix = { version = "0.26", default-features = false, features = ["ioctl"] }
2222

2323
[dev-dependencies]
2424
docopt = "1"

src/ffi.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,24 @@ bitflags! {
5555
const I2C_FUNC_SMBUS_READ_I2C_BLOCK = 0x0400_0000; /* I2C-like block xfer */
5656
const I2C_FUNC_SMBUS_WRITE_I2C_BLOCK = 0x0800_0000; /* w/ 1-byte reg. addr. */
5757

58-
const I2C_FUNC_SMBUS_BYTE = (I2CFunctions::I2C_FUNC_SMBUS_READ_BYTE.bits |
59-
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BYTE.bits);
60-
const I2C_FUNC_SMBUS_BYTE_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_BYTE_DATA.bits |
61-
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BYTE_DATA.bits);
62-
const I2C_FUNC_SMBUS_WORD_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_WORD_DATA.bits |
63-
I2CFunctions::I2C_FUNC_SMBUS_WRITE_WORD_DATA.bits);
64-
const I2C_FUNC_SMBUS_BLOCK_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_BLOCK_DATA.bits |
65-
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BLOCK_DATA.bits);
66-
const I2C_FUNC_SMBUS_I2C_BLOCK = (I2CFunctions::I2C_FUNC_SMBUS_READ_I2C_BLOCK.bits |
67-
I2CFunctions::I2C_FUNC_SMBUS_WRITE_I2C_BLOCK.bits);
68-
const I2C_FUNC_SMBUS_EMUL = (I2CFunctions::I2C_FUNC_SMBUS_QUICK.bits |
69-
I2CFunctions::I2C_FUNC_SMBUS_BYTE.bits |
70-
I2CFunctions::I2C_FUNC_SMBUS_BYTE_DATA.bits |
71-
I2CFunctions::I2C_FUNC_SMBUS_WORD_DATA.bits |
72-
I2CFunctions::I2C_FUNC_SMBUS_PROC_CALL.bits |
73-
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BLOCK_DATA.bits |
74-
I2CFunctions::I2C_FUNC_SMBUS_I2C_BLOCK.bits |
75-
I2CFunctions::I2C_FUNC_SMBUS_PEC.bits);
58+
const I2C_FUNC_SMBUS_BYTE = (I2CFunctions::I2C_FUNC_SMBUS_READ_BYTE.bits() |
59+
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BYTE.bits());
60+
const I2C_FUNC_SMBUS_BYTE_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_BYTE_DATA.bits() |
61+
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BYTE_DATA.bits());
62+
const I2C_FUNC_SMBUS_WORD_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_WORD_DATA.bits() |
63+
I2CFunctions::I2C_FUNC_SMBUS_WRITE_WORD_DATA.bits());
64+
const I2C_FUNC_SMBUS_BLOCK_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_BLOCK_DATA.bits() |
65+
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BLOCK_DATA.bits());
66+
const I2C_FUNC_SMBUS_I2C_BLOCK = (I2CFunctions::I2C_FUNC_SMBUS_READ_I2C_BLOCK.bits() |
67+
I2CFunctions::I2C_FUNC_SMBUS_WRITE_I2C_BLOCK.bits());
68+
const I2C_FUNC_SMBUS_EMUL = (I2CFunctions::I2C_FUNC_SMBUS_QUICK.bits() |
69+
I2CFunctions::I2C_FUNC_SMBUS_BYTE.bits() |
70+
I2CFunctions::I2C_FUNC_SMBUS_BYTE_DATA.bits() |
71+
I2CFunctions::I2C_FUNC_SMBUS_WORD_DATA.bits() |
72+
I2CFunctions::I2C_FUNC_SMBUS_PROC_CALL.bits() |
73+
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BLOCK_DATA.bits() |
74+
I2CFunctions::I2C_FUNC_SMBUS_I2C_BLOCK.bits() |
75+
I2CFunctions::I2C_FUNC_SMBUS_PEC.bits());
7676
}
7777
}
7878

0 commit comments

Comments
 (0)