Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for lpc55-hal 0.4 and release v0.1.7 #20

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ SPDX-License-Identifier: CC0-1.0

# Changelog

## [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][])
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
name = "se05x"
version = "0.1.6"
version = "0.1.7"
authors = ["Nitrokey GmbH <info@nitrokey.com>"]

edition = "2021"
Expand All @@ -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 }
Expand All @@ -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"]
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 18 additions & 2 deletions src/t1/i2cimpl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
}
}
}