dds: name consistently

master
Robert Jördens 2021-07-28 07:37:10 +00:00
parent 251bebdc6d
commit bf0afc8a88
2 changed files with 10 additions and 10 deletions

View File

@ -528,7 +528,7 @@ pub struct DdsConfig {
impl DdsConfig { impl DdsConfig {
/// Create a serializer that can be used for generating a serialized DDS profile for writing to /// Create a serializer that can be used for generating a serialized DDS profile for writing to
/// a QSPI stream. /// a QSPI stream.
pub fn builder(&self) -> ProfileSerializer { pub fn serializer(&self) -> ProfileSerializer {
ProfileSerializer::new(self.mode) ProfileSerializer::new(self.mode)
} }
} }
@ -585,7 +585,7 @@ impl ProfileSerializer {
} }
if let Some(acr) = acr { 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..]);
} }
} }

View File

@ -76,15 +76,15 @@ impl DdsOutput {
/// # Args /// # Args
/// * `qspi` - The QSPI interface to the run the stream on. /// * `qspi` - The QSPI interface to the run the stream on.
/// * `io_update_trigger` - The HighResTimerE used to generate IO_Update pulses. /// * `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( pub fn new(
mut qspi: QspiInterface, mut qspi: QspiInterface,
io_update_trigger: HighResTimerE, io_update_trigger: HighResTimerE,
dds_config: DdsConfig, config: DdsConfig,
) -> Self { ) -> Self {
qspi.start_stream().unwrap(); qspi.start_stream().unwrap();
Self { Self {
config: dds_config, config,
_qspi: qspi, _qspi: qspi,
io_update_trigger, io_update_trigger,
} }
@ -93,10 +93,10 @@ impl DdsOutput {
/// Get a builder for serializing a Pounder DDS profile. /// Get a builder for serializing a Pounder DDS profile.
#[allow(dead_code)] #[allow(dead_code)]
pub fn builder(&mut self) -> ProfileBuilder { pub fn builder(&mut self) -> ProfileBuilder {
let builder = self.config.builder(); let serializer = self.config.serializer();
ProfileBuilder { ProfileBuilder {
dds_stream: self, dds_output: self,
serializer: builder, serializer,
} }
} }
@ -135,7 +135,7 @@ impl DdsOutput {
/// A temporary builder for serializing and writing profiles. /// A temporary builder for serializing and writing profiles.
pub struct ProfileBuilder<'a> { pub struct ProfileBuilder<'a> {
dds_stream: &'a mut DdsOutput, dds_output: &'a mut DdsOutput,
serializer: ProfileSerializer, serializer: ProfileSerializer,
} }
@ -164,6 +164,6 @@ impl<'a> ProfileBuilder<'a> {
#[allow(dead_code)] #[allow(dead_code)]
pub fn write_profile(mut self) { pub fn write_profile(mut self) {
let profile = self.serializer.finalize(); let profile = self.serializer.finalize();
self.dds_stream.write_profile(profile); self.dds_output.write_profile(profile);
} }
} }