pub struct RadarConfig { /* private fields */ }Expand description
Radar configuration structure to manage the settings of a radar sensor.
Implementations§
Source§impl RadarConfig
impl RadarConfig
Sourcepub unsafe fn mut_ptr(&mut self) -> *mut acc_config_t
pub unsafe fn mut_ptr(&mut self) -> *mut acc_config_t
Returns a mutable pointer to the internal radar configuration structure
§Safety
This function is unsafe because it returns a raw pointer.
Sourcepub fn ptr(&self) -> *const acc_config_t
pub fn ptr(&self) -> *const acc_config_t
Returns a pointer to the internal radar configuration structure
Sourcepub fn set_sweep_mode(
&mut self,
sweep_mode: SweepMode,
) -> Result<(), ConfigError>
pub fn set_sweep_mode( &mut self, sweep_mode: SweepMode, ) -> Result<(), ConfigError>
Sourcepub fn set_start_point(&mut self, start_point: i32)
pub fn set_start_point(&mut self, start_point: i32)
Sets the starting point of the sweep.
§Arguments
start_point- The starting point of the sweep in millimeters.
Sourcepub fn start_point(&self) -> i32
pub fn start_point(&self) -> i32
Get the starting point of the sweep.
Sourcepub fn set_num_points(&mut self, num_points: u16)
pub fn set_num_points(&mut self, num_points: u16)
Set the number of data points to measure in a sweep.
§Arguments
num_points- Number of data points to measure.
Sourcepub fn num_points(&self) -> u16
pub fn num_points(&self) -> u16
Get the number of data points set to measure in a sweep.
Sourcepub fn set_step_length(&mut self, step_length: u16)
pub fn set_step_length(&mut self, step_length: u16)
Sourcepub fn step_length(&self) -> u16
pub fn step_length(&self) -> u16
Get the current step length between each data point in a sweep.
Sourcepub fn set_profile(&mut self, profile: RadarProfile)
pub fn set_profile(&mut self, profile: RadarProfile)
Sourcepub fn profile(&self) -> RadarProfile
pub fn profile(&self) -> RadarProfile
Get the currently used radar profile
Sourcepub fn set_hwaas(&mut self, hwaas: Hwaas) -> Result<(), ConfigError>
pub fn set_hwaas(&mut self, hwaas: Hwaas) -> Result<(), ConfigError>
Set the hardware accelerated average samples (HWAAS).
Each data point can be sampled several times, and the sensor hardware produces an average value of those samples. The time needed to measure a sweep is roughly proportional to the number of averaged samples. Decreasing HWAAS can increase the update rate but may lead to lower SNR.
HWAAS must be between 1 and 511 inclusive.
§Arguments
hwaas- Number of hardware accelerated average samples.
Sourcepub fn hwaas(&self) -> Hwaas
pub fn hwaas(&self) -> Hwaas
Get the hardware accelerated average samples (HWAAS).
Returns the number of hardware accelerated average samples currently set.
Sourcepub fn receiver_gain_set(&mut self, receiver_gain: u8)
pub fn receiver_gain_set(&mut self, receiver_gain: u8)
Set the receiver gain setting.
Must be a value between 0 and 23 inclusive where 23 is the highest gain and 0 the lowest. Lower gain gives higher SNR. However, too low gain may result in quantization, lowering SNR. Too high gain may result in saturation, corrupting the data.
§Arguments
receiver_gain- Receiver gain setting.
Sourcepub fn receiver_gain(&self) -> u8
pub fn receiver_gain(&self) -> u8
Get the current receiver gain setting.
Returns the receiver gain setting. The range is between 0 (lowest gain) and 23 (highest gain).
Sourcepub fn set_sweeps_per_frame(&mut self, sweeps_per_frame: u16)
pub fn set_sweeps_per_frame(&mut self, sweeps_per_frame: u16)
Set the number of sweeps captured in each frame (measurement).
§Arguments
sweeps_per_frame- Number of sweeps per frame.
Sourcepub fn sweeps_per_frame(&self) -> u16
pub fn sweeps_per_frame(&self) -> u16
Get the number of sweeps captured in each frame (measurement).
Sourcepub fn set_prf(&mut self, prf: PulseRepetitionFrequency)
pub fn set_prf(&mut self, prf: PulseRepetitionFrequency)
Set the Pulse Repetition Frequency (PRF)
See @ref acc_config_prf_t for details.
§Arguments
prf- The Pulse Repetition Frequency to use
Sourcepub fn prf(&self) -> PulseRepetitionFrequency
pub fn prf(&self) -> PulseRepetitionFrequency
Get the Pulse Repetition Frequency
Returns the currently set Pulse Repetition Frequency.
Sourcepub fn set_phase_enhancement(&mut self, enable: bool)
pub fn set_phase_enhancement(&mut self, enable: bool)
Enable or disable phase enhancement
If enabled, the data phase will be enhanced such that coherent distance filtering can be applied.
§Arguments
enable- true to enable phase enhancement, false to disable
Sourcepub fn is_phase_enhancement_enabled(&self) -> bool
pub fn is_phase_enhancement_enabled(&self) -> bool
Check if phase enhancement is enabled
Returns true if phase enhancement is enabled.
Sourcepub fn set_loopback(&mut self, enable: bool)
pub fn set_loopback(&mut self, enable: bool)
Enable or disable loopback
Loopback can’t be enabled together with profile 2.
§Arguments
enable- true to enable loopback, false otherwise
Sourcepub fn is_loopback_enabled(&self) -> bool
pub fn is_loopback_enabled(&self) -> bool
Get the enable loopback configuration
Returns true if loopback is enabled.
Sourcepub fn set_double_buffering(&mut self, enable: bool)
pub fn set_double_buffering(&mut self, enable: bool)
Enable or disable double buffering
If enabled, the sensor buffer will be split in two halves reducing the maximum number of samples.
§Arguments
enable- true to enable double buffering, false otherwise
Sourcepub fn is_double_buffering_enabled(&self) -> bool
pub fn is_double_buffering_enabled(&self) -> bool
Get the double buffering configuration
Returns true if double buffering is enabled.
Sourcepub fn set_frame_rate(&mut self, frame_rate: FrameRate)
pub fn set_frame_rate(&mut self, frame_rate: FrameRate)
Set the frame rate
Sets the frame rate.
§Arguments
frame_rate- Frame rate in Hz. 0 is interpreted as unlimited
Sourcepub fn frame_rate(&self) -> FrameRate
pub fn frame_rate(&self) -> FrameRate
Get the frame rate
Returns the currently set frame rate in Hz.
Sourcepub fn set_transmitter_enabled(&mut self, enable: bool)
pub fn set_transmitter_enabled(&mut self, enable: bool)
Enable or disable the transmitter
§Arguments
enable- true to enable the transmitter, false to disable it
Sourcepub fn is_transmitter_enabled(&self) -> bool
pub fn is_transmitter_enabled(&self) -> bool
Get transmitter enable configuration
Returns true if the transmitter is enabled.
Sourcepub fn set_inter_frame_idle_state(&mut self, idle_state: RadarIdleState)
pub fn set_inter_frame_idle_state(&mut self, idle_state: RadarIdleState)
Sourcepub fn inter_frame_idle_state(&self) -> RadarIdleState
pub fn inter_frame_idle_state(&self) -> RadarIdleState
Get inter frame idle state
Returns the currently set idle state used between frames.
Sourcepub fn set_inter_sweep_idle_state(&mut self, idle_state: RadarIdleState)
pub fn set_inter_sweep_idle_state(&mut self, idle_state: RadarIdleState)
Set inter sweep idle state
§Arguments
idle_state- The idle state to use between sweeps within a frame
Sourcepub fn inter_sweep_idle_state(&self) -> RadarIdleState
pub fn inter_sweep_idle_state(&self) -> RadarIdleState
Get inter sweep idle state
Returns the currently set idle state used between sweeps within a frame.
Sourcepub fn is_continuous_sweep_mode_enabled(&self) -> bool
pub fn is_continuous_sweep_mode_enabled(&self) -> bool
Get continuous sweep mode
Returns true if continuous sweep mode is enabled.
Sourcepub fn sweep_rate(&self) -> f32
pub fn sweep_rate(&self) -> f32
Get the sweep rate
Returns the currently set sweep rate in Hz.
Sourcepub fn set_num_subsweep(&mut self, num_subsweep: u8) -> Result<(), ConfigError>
pub fn set_num_subsweep(&mut self, num_subsweep: u8) -> Result<(), ConfigError>
Set the number of subsweeps in the radar configuration.
§Arguments
num_subsweep- The number of subsweeps to set
Sourcepub fn num_subsweep(&self) -> u8
pub fn num_subsweep(&self) -> u8
Get the number of subsweeps in the radar configuration.
Sourcepub fn get_subsweep(&self, index: u8) -> Option<Subsweep>
pub fn get_subsweep(&self, index: u8) -> Option<Subsweep>
Sourcepub fn config_buffer_size(&self) -> Result<u32, ConfigError>
pub fn config_buffer_size(&self) -> Result<u32, ConfigError>
Get the buffer size needed for the current configuration
§Returns
Ok(u32)- The buffer size needed for the current configurationErr(ConfigError::BufferSize)- If the buffer size could not be determined