From bf0afc8a8859962181067026abf343904a69a8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 28 Jul 2021 07:37:10 +0000 Subject: [PATCH] dds: name consistently --- ad9959/src/lib.rs | 4 ++-- src/hardware/pounder/dds_output.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ad9959/src/lib.rs b/ad9959/src/lib.rs index cafe4fe..e83eda7 100644 --- a/ad9959/src/lib.rs +++ b/ad9959/src/lib.rs @@ -528,7 +528,7 @@ pub struct DdsConfig { impl DdsConfig { /// Create a serializer that can be used for generating a serialized DDS profile for writing to /// a QSPI stream. - pub fn builder(&self) -> ProfileSerializer { + pub fn serializer(&self) -> ProfileSerializer { ProfileSerializer::new(self.mode) } } @@ -585,7 +585,7 @@ impl ProfileSerializer { } if let Some(acr) = acr { - self.add_write(Register::ACR, &acr.to_be_bytes()[1..=3]); + self.add_write(Register::ACR, &acr.to_be_bytes()[1..]); } } diff --git a/src/hardware/pounder/dds_output.rs b/src/hardware/pounder/dds_output.rs index bf7acc0..eddb306 100644 --- a/src/hardware/pounder/dds_output.rs +++ b/src/hardware/pounder/dds_output.rs @@ -76,15 +76,15 @@ impl DdsOutput { /// # Args /// * `qspi` - The QSPI interface to the run the stream on. /// * `io_update_trigger` - The HighResTimerE used to generate IO_Update pulses. - /// * `dds_config` - The frozen DDS configuration. + /// * `config` - The frozen DDS configuration. pub fn new( mut qspi: QspiInterface, io_update_trigger: HighResTimerE, - dds_config: DdsConfig, + config: DdsConfig, ) -> Self { qspi.start_stream().unwrap(); Self { - config: dds_config, + config, _qspi: qspi, io_update_trigger, } @@ -93,10 +93,10 @@ impl DdsOutput { /// Get a builder for serializing a Pounder DDS profile. #[allow(dead_code)] pub fn builder(&mut self) -> ProfileBuilder { - let builder = self.config.builder(); + let serializer = self.config.serializer(); ProfileBuilder { - dds_stream: self, - serializer: builder, + dds_output: self, + serializer, } } @@ -135,7 +135,7 @@ impl DdsOutput { /// A temporary builder for serializing and writing profiles. pub struct ProfileBuilder<'a> { - dds_stream: &'a mut DdsOutput, + dds_output: &'a mut DdsOutput, serializer: ProfileSerializer, } @@ -164,6 +164,6 @@ impl<'a> ProfileBuilder<'a> { #[allow(dead_code)] pub fn write_profile(mut self) { let profile = self.serializer.finalize(); - self.dds_stream.write_profile(profile); + self.dds_output.write_profile(profile); } }