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 imxrt1050 support #12

Merged
merged 1 commit into from
Feb 1, 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
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
feature: ["imxrt1010", "imxrt1020", "imxrt1060", "imxrt1064", "imxrt1170"]
feature: ["imxrt1010", "imxrt1020", "imxrt1050", "imxrt1060", "imxrt1064", "imxrt1170"]

runs-on: ubuntu-latest

Expand All @@ -20,7 +20,7 @@ jobs:
clippy:
strategy:
matrix:
feature: ["imxrt1010", "imxrt1020", "imxrt1060", "imxrt1170"]
feature: ["imxrt1010", "imxrt1020", "imxrt1050", "imxrt1060", "imxrt1170"]

runs-on: ubuntu-latest

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ packages maintained within this repository.

## [Unreleased]

Add support for the 1050 family.

## [0.3.1] - 2023-01-14

Add support for the 1020 family.
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ keywords = [
[features]
imxrt1010 = []
imxrt1020 = []
imxrt1050 = []
imxrt1060 = []
imxrt1064 = []
imxrt1170 = []
Expand Down
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::env;
static SUPPORTED_FEATURES: &[&str] = &[
"imxrt1010",
"imxrt1020",
"imxrt1050",
"imxrt1060",
"imxrt1064",
"imxrt1170",
Expand Down
8 changes: 4 additions & 4 deletions src/flexspi/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ pub enum SerialClockFrequency {
MHz75,
MHz80,
MHz100,
#[cfg(not(feature = "imxrt1020"))]
MHz120,
MHz133,
#[cfg(any(
feature = "imxrt1020",
feature = "imxrt1010",
feature = "imxrt1060",
feature = "imxrt1064",
feature = "imxrt1170"
))]
MHz120,
MHz133,
#[cfg(not(feature = "imxrt1010"))]
MHz166,
}

Expand Down
2 changes: 1 addition & 1 deletion src/serial_flash/nor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum SerialClockFrequency {
#[cfg(any(feature = "imxrt1060", feature = "imxrt1064", feature = "imxrt1170"))]
MHz120,
MHz133,
#[cfg(any(feature = "imxrt1060", feature = "imxrt1064"))]
#[cfg(any(feature = "imxrt1050", feature = "imxrt1060", feature = "imxrt1064"))]
MHz166,
}

Expand Down
34 changes: 34 additions & 0 deletions tests/imxrt1050.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//! Tests specific to 1050 family.

#![cfg(any(feature = "imxrt1050"))]

#[test]
fn serial_clock_frequency() {
use imxrt_boot_gen::flexspi::SerialClockFrequency;

assert_eq!(SerialClockFrequency::MHz30 as u32, 1);
assert_eq!(SerialClockFrequency::MHz50 as u32, 2);
assert_eq!(SerialClockFrequency::MHz60 as u32, 3);
assert_eq!(SerialClockFrequency::MHz75 as u32, 4);
assert_eq!(SerialClockFrequency::MHz80 as u32, 5);
assert_eq!(SerialClockFrequency::MHz100 as u32, 6);
assert_eq!(SerialClockFrequency::MHz133 as u32, 7);
assert_eq!(SerialClockFrequency::MHz166 as u32, 8);
}

#[test]
fn ip_serial_clock_frequency() {
use imxrt_boot_gen::serial_flash::nor::SerialClockFrequency;

assert_eq!(SerialClockFrequency::NoChange as u32, 0);

assert_eq!(SerialClockFrequency::MHz30 as u32, 1);
assert_eq!(SerialClockFrequency::MHz50 as u32, 2);
assert_eq!(SerialClockFrequency::MHz60 as u32, 3);
assert_eq!(SerialClockFrequency::MHz75 as u32, 4);
assert_eq!(SerialClockFrequency::MHz80 as u32, 5);
assert_eq!(SerialClockFrequency::MHz100 as u32, 6);
// No 120MHz here...
assert_eq!(SerialClockFrequency::MHz133 as u32, 7);
assert_eq!(SerialClockFrequency::MHz166 as u32, 8);
}
Loading