Skip to content

Commit

Permalink
Update nix and bitflags
Browse files Browse the repository at this point in the history
  • Loading branch information
eldruin committed Aug 1, 2023
1 parent 6ab8417 commit be1bf6d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]

- Hide nix from the public api such that it can be updated without resulting in a breaking change.
- Updated nix to version `0.25`.
- Updated nix to version `0.24`; only use the `ioctl` feature.
- Updated nix to version `0.26`; only use the `ioctl` feature.
- Updated `bitflags` to version `2.3`.
- Use `File.read_exact` instead of `File.read` in `LinuxI2CDevice.read` so that the buffer is filled.
- Fix the lifetime parameter on `LinuxI2CMessage` to ensure that it does not outlive the buffer it points to.
- Updated MSRV to 1.60.0.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Provides API for safe access to Linux i2c device interface.

[dependencies]
libc = "0.2"
bitflags = "1.3"
bitflags = "2.3"
byteorder = "1"
nix = { version = "0.25", default-features = false, features = ["ioctl"] }
nix = { version = "0.26", default-features = false, features = ["ioctl"] }

[dev-dependencies]
docopt = "1"
36 changes: 18 additions & 18 deletions src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ bitflags! {
const I2C_FUNC_SMBUS_READ_I2C_BLOCK = 0x0400_0000; /* I2C-like block xfer */
const I2C_FUNC_SMBUS_WRITE_I2C_BLOCK = 0x0800_0000; /* w/ 1-byte reg. addr. */

const I2C_FUNC_SMBUS_BYTE = (I2CFunctions::I2C_FUNC_SMBUS_READ_BYTE.bits |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BYTE.bits);
const I2C_FUNC_SMBUS_BYTE_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_BYTE_DATA.bits |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BYTE_DATA.bits);
const I2C_FUNC_SMBUS_WORD_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_WORD_DATA.bits |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_WORD_DATA.bits);
const I2C_FUNC_SMBUS_BLOCK_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_BLOCK_DATA.bits |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BLOCK_DATA.bits);
const I2C_FUNC_SMBUS_I2C_BLOCK = (I2CFunctions::I2C_FUNC_SMBUS_READ_I2C_BLOCK.bits |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_I2C_BLOCK.bits);
const I2C_FUNC_SMBUS_EMUL = (I2CFunctions::I2C_FUNC_SMBUS_QUICK.bits |
I2CFunctions::I2C_FUNC_SMBUS_BYTE.bits |
I2CFunctions::I2C_FUNC_SMBUS_BYTE_DATA.bits |
I2CFunctions::I2C_FUNC_SMBUS_WORD_DATA.bits |
I2CFunctions::I2C_FUNC_SMBUS_PROC_CALL.bits |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BLOCK_DATA.bits |
I2CFunctions::I2C_FUNC_SMBUS_I2C_BLOCK.bits |
I2CFunctions::I2C_FUNC_SMBUS_PEC.bits);
const I2C_FUNC_SMBUS_BYTE = (I2CFunctions::I2C_FUNC_SMBUS_READ_BYTE.bits() |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BYTE.bits());
const I2C_FUNC_SMBUS_BYTE_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_BYTE_DATA.bits() |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BYTE_DATA.bits());
const I2C_FUNC_SMBUS_WORD_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_WORD_DATA.bits() |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_WORD_DATA.bits());
const I2C_FUNC_SMBUS_BLOCK_DATA = (I2CFunctions::I2C_FUNC_SMBUS_READ_BLOCK_DATA.bits() |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BLOCK_DATA.bits());
const I2C_FUNC_SMBUS_I2C_BLOCK = (I2CFunctions::I2C_FUNC_SMBUS_READ_I2C_BLOCK.bits() |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_I2C_BLOCK.bits());
const I2C_FUNC_SMBUS_EMUL = (I2CFunctions::I2C_FUNC_SMBUS_QUICK.bits() |
I2CFunctions::I2C_FUNC_SMBUS_BYTE.bits() |
I2CFunctions::I2C_FUNC_SMBUS_BYTE_DATA.bits() |
I2CFunctions::I2C_FUNC_SMBUS_WORD_DATA.bits() |
I2CFunctions::I2C_FUNC_SMBUS_PROC_CALL.bits() |
I2CFunctions::I2C_FUNC_SMBUS_WRITE_BLOCK_DATA.bits() |
I2CFunctions::I2C_FUNC_SMBUS_I2C_BLOCK.bits() |
I2CFunctions::I2C_FUNC_SMBUS_PEC.bits());
}
}

Expand Down

0 comments on commit be1bf6d

Please sign in to comment.