From 0f64a2c9e96bbedff907d712a56f82036bc992af Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 25 Oct 2024 12:24:15 +0200 Subject: [PATCH 1/2] Add support for lpc55-hal 0.4 --- CHANGELOG.md | 4 ++++ Cargo.toml | 5 ++++- Makefile | 6 ++++-- src/t1/i2cimpl.rs | 20 ++++++++++++++++++-- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3c9595..1001b18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ SPDX-License-Identifier: CC0-1.0 # Changelog +## Unreleased + +- Add support for `lpc55-hal` 0.4 behind a `lpc55-v0.4` feature + ## [v0.1.6][] (2025-08-13) - Fix `ExportObject` for large keys (NIST-P521 and brainpoolp512) ([#16][]) diff --git a/Cargo.toml b/Cargo.toml index 002a272..ac47b48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ heapless = "0.7" hex-literal = "0.4.1" iso7816 = "0.1.1" lpc55-hal = { version = "0.3.0", optional = true } +lpc55-hal-04 = { package = "lpc55-hal", version = "0.4.0", optional = true } nrf-hal-common = { version = "0.15.0", optional = true } rand = { version = "0.8.5", optional = true, default-features = false } serde = { version = "1.0.185", default-features = false, features = ["derive"], optional = true } @@ -41,7 +42,9 @@ log-error = [] log-none = [] nrf = ["nrf-hal-common"] -lpc55 = ["lpc55-hal"] +lpc55 = ["lpc55-v0.3"] +"lpc55-v0.3" = ["dep:lpc55-hal"] +"lpc55-v0.4" = ["dep:lpc55-hal-04"] aes-session = ["aes", "cmac", "rand"] serde_bytes = ["dep:serde_bytes"] diff --git a/Makefile b/Makefile index 39833b3..c20d66c 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,8 @@ check: src/se05x/commands.rs cargo c cargo c --features builder cargo c --features nrf,nrf-hal-common/52840 --target thumbv7em-none-eabihf - cargo c --features lpc55 --target thumbv8m.main-none-eabi + cargo c --features lpc55-v0.3 --target thumbv8m.main-none-eabi + cargo c --features lpc55-v0.4 --target thumbv8m.main-none-eabi .PHONY: lint @@ -28,7 +29,8 @@ lint: src/se05x/commands.rs verify-commands cargo fmt --check cargo clippy cargo clippy --features nrf,nrf-hal-common/52840 --target thumbv7em-none-eabihf - cargo clippy --features lpc55 --target thumbv8m.main-none-eabi + cargo clippy --features lpc55-v0.3 --target thumbv8m.main-none-eabi + cargo clippy --features lpc55-v0.4 --target thumbv8m.main-none-eabi cargo doc --features aes-session,builder,serde --no-deps README.md: src/lib.rs Makefile diff --git a/src/t1/i2cimpl.rs b/src/t1/i2cimpl.rs index 54838e7..f7d8a9f 100644 --- a/src/t1/i2cimpl.rs +++ b/src/t1/i2cimpl.rs @@ -17,8 +17,8 @@ mod nrf52832 { } } -#[cfg(feature = "lpc55")] -mod lpc55 { +#[cfg(feature = "lpc55-v0.3")] +mod lpc55_03 { use crate::t1::I2CErrorNack; use lpc55_hal::drivers::i2c::Error; @@ -32,3 +32,19 @@ mod lpc55 { } } } + +#[cfg(feature = "lpc55-v0.4")] +mod lpc55_04 { + use crate::t1::I2CErrorNack; + + use lpc55_hal_04::drivers::i2c::Error; + + impl I2CErrorNack for Error { + fn is_address_nack(&self) -> bool { + matches!(self, Error::NackAddress) + } + fn is_data_nack(&self) -> bool { + matches!(self, Error::NackData) + } + } +} From 7c4632609c3863a7a533089ec2a18e93cd1058cf Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 25 Oct 2024 12:27:19 +0200 Subject: [PATCH 2/2] Release v0.1.7 --- CHANGELOG.md | 4 +++- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1001b18..7f67f83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,12 @@ SPDX-License-Identifier: CC0-1.0 # Changelog -## Unreleased +## [v0.1.7][] (2024-10-25) - Add support for `lpc55-hal` 0.4 behind a `lpc55-v0.4` feature +[v0.1.7]: https://github.com/Nitrokey/se05x/releases/tag/v0.1.7 + ## [v0.1.6][] (2025-08-13) - Fix `ExportObject` for large keys (NIST-P521 and brainpoolp512) ([#16][]) diff --git a/Cargo.toml b/Cargo.toml index ac47b48..70b4fc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "se05x" -version = "0.1.6" +version = "0.1.7" authors = ["Nitrokey GmbH "] edition = "2021"