From accac99f48628dd8f8fb9ffd2c609710c13ade14 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 11 Feb 2022 13:53:58 +0800 Subject: [PATCH] updated zynq-rs with pca9547 support (#165) Co-authored-by: mwojcik Co-committed-by: mwojcik --- flake.lock | 34 ++++++++++++++++---------------- src/Cargo.lock | 12 +++++------ src/libboard_artiq/Cargo.toml | 4 ++-- src/libboard_artiq/src/si5324.rs | 6 +++--- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/flake.lock b/flake.lock index 92c3c94b..a711f0b9 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "src-sipyco": "src-sipyco" }, "locked": { - "lastModified": 1643542736, - "narHash": "sha256-SXOAQ2hxwoT+zTrMZCtjlcf/i8phN4AwwCAwUlhufzc=", + "lastModified": 1644375232, + "narHash": "sha256-jd8sAlAz6xGQoxiRUV5ChtEjdjh4pdIksUPsqftcK5s=", "ref": "master", - "rev": "dd3279e50622b5ceb1c24b4d1891f442cc0acce3", - "revCount": 7947, + "rev": "a0070d4396136b84e0a50a1c57ee72bcf4e7f6f9", + "revCount": 7961, "type": "git", "url": "https://github.com/m-labs/artiq.git" }, @@ -26,11 +26,11 @@ "mozilla-overlay": { "flake": false, "locked": { - "lastModified": 1638887313, - "narHash": "sha256-FMYV6rVtvSIfthgC1sK1xugh3y7muoQcvduMdriz4ag=", + "lastModified": 1643634764, + "narHash": "sha256-EcFlgzZnZSHwZixELYV1pa267t+u5mCeLhSNBeAA/+c=", "owner": "mozilla", "repo": "nixpkgs-mozilla", - "rev": "7c1e8b1dd6ed0043fb4ee0b12b815256b0b9de6f", + "rev": "f233fdc4ff6ba2ffeb1e3e3cd6d63bb1297d6996", "type": "github" }, "original": { @@ -42,11 +42,11 @@ "mozilla-overlay_2": { "flake": false, "locked": { - "lastModified": 1638887313, - "narHash": "sha256-FMYV6rVtvSIfthgC1sK1xugh3y7muoQcvduMdriz4ag=", + "lastModified": 1643634764, + "narHash": "sha256-EcFlgzZnZSHwZixELYV1pa267t+u5mCeLhSNBeAA/+c=", "owner": "mozilla", "repo": "nixpkgs-mozilla", - "rev": "7c1e8b1dd6ed0043fb4ee0b12b815256b0b9de6f", + "rev": "f233fdc4ff6ba2ffeb1e3e3cd6d63bb1297d6996", "type": "github" }, "original": { @@ -73,11 +73,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1642522226, - "narHash": "sha256-m/j9U8KYuwwxjwgRCjmEj8ejftvdMLJ+NGXh/L2I4FU=", + "lastModified": 1643503720, + "narHash": "sha256-tJic20ufuRnG8V+fTCd3YU6xl1ImxNspoEkXHct0AG4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "610d4ea2750e064bf34b33fa38cb671edd893d3d", + "rev": "0f316e4d72daed659233817ffe52bf08e081b5de", "type": "github" }, "original": { @@ -169,11 +169,11 @@ ] }, "locked": { - "lastModified": 1643971355, - "narHash": "sha256-kaVxTtgdoEwB+PEorp72MXcaaaAh5U/LDnF3QKjsCco=", + "lastModified": 1644558411, + "narHash": "sha256-PC/gVlVLmtZCv1Tw8Xz5ZCTxqmS2osncg5hlt9BoJ/8=", "ref": "master", - "rev": "e5e646f40eae3c04898266310a64c09b8c03dfbc", - "revCount": 597, + "rev": "3e95df1f640aa761740feaf9eec797acb58dd942", + "revCount": 604, "type": "git", "url": "https://git.m-labs.hk/m-labs/zynq-rs" }, diff --git a/src/Cargo.lock b/src/Cargo.lock index ab744cfe..a3f5a45d 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -224,7 +224,7 @@ dependencies = [ [[package]] name = "libasync" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#57d8d8fbc7087863305721bcb8fdbdd13d65bd65" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#3e95df1f640aa761740feaf9eec797acb58dd942" dependencies = [ "embedded-hal", "libcortex_a9", @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "libboard_zynq" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#57d8d8fbc7087863305721bcb8fdbdd13d65bd65" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#3e95df1f640aa761740feaf9eec797acb58dd942" dependencies = [ "bit_field", "embedded-hal", @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "libconfig" version = "0.1.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#57d8d8fbc7087863305721bcb8fdbdd13d65bd65" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#3e95df1f640aa761740feaf9eec797acb58dd942" dependencies = [ "core_io", "fatfs", @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "libcortex_a9" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#57d8d8fbc7087863305721bcb8fdbdd13d65bd65" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#3e95df1f640aa761740feaf9eec797acb58dd942" dependencies = [ "bit_field", "libregister", @@ -308,7 +308,7 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libregister" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#57d8d8fbc7087863305721bcb8fdbdd13d65bd65" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#3e95df1f640aa761740feaf9eec797acb58dd942" dependencies = [ "bit_field", "vcell", @@ -318,7 +318,7 @@ dependencies = [ [[package]] name = "libsupport_zynq" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#57d8d8fbc7087863305721bcb8fdbdd13d65bd65" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#3e95df1f640aa761740feaf9eec797acb58dd942" dependencies = [ "cc", "compiler_builtins", diff --git a/src/libboard_artiq/Cargo.toml b/src/libboard_artiq/Cargo.toml index 8b9f7b8a..be08bac2 100644 --- a/src/libboard_artiq/Cargo.toml +++ b/src/libboard_artiq/Cargo.toml @@ -8,8 +8,8 @@ edition = "2018" name = "libboard_artiq" [features] -target_zc706 = [] -target_kasli_soc = [] +target_zc706 = ["libboard_zynq/target_zc706", "libconfig/target_zc706"] +target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libconfig/target_kasli_soc"] [build-dependencies] build_zynq = { path = "../libbuild_zynq" } diff --git a/src/libboard_artiq/src/si5324.rs b/src/libboard_artiq/src/si5324.rs index c083faec..574fec0b 100644 --- a/src/libboard_artiq/src/si5324.rs +++ b/src/libboard_artiq/src/si5324.rs @@ -188,12 +188,12 @@ fn init(i2c: &mut I2c, timer: &mut GlobalTimer) -> Result<()> { #[cfg(feature = "target_kasli_soc")] { - i2c.pca9548_select(0x70, 0)?; - i2c.pca9548_select(0x71, 1 << 3)?; + i2c.pca954x_select(0x70, None)?; + i2c.pca954x_select(0x71, Some(3))?; } #[cfg(feature = "target_zc706")] { - i2c.pca9548_select(0x74, 1 << 4)?; + i2c.pca954x_select(0x74, Some(4))?; } if ident(i2c)? != 0x0182 {