pub struct EEPROMConfigMemory { /* private fields */ }Expand description
Describes the content of the I2C EEPROM used for configuration on the Crazyflie platform.
Implementations§
Source§impl EEPROMConfigMemory
impl EEPROMConfigMemory
Sourcepub async fn commit(&self) -> Result<()>
pub async fn commit(&self) -> Result<()>
Commit the current configuration back to the EEPROM. This will overwrite the existing configuration.
Returns Ok(()) if the operation is successful, or an Error if it fails.
§Errors
This function will return an error if the write operation to the EEPROM fails.
Sourcepub fn get_radio_channel(&self) -> u8
pub fn get_radio_channel(&self) -> u8
Gets the radio frequency channel.
Sourcepub fn set_radio_channel(&mut self, channel: u8) -> Result<()>
pub fn set_radio_channel(&mut self, channel: u8) -> Result<()>
Sets the radio frequency channel (0-125).
Sourcepub fn get_radio_speed(&self) -> &RadioSpeed
pub fn get_radio_speed(&self) -> &RadioSpeed
Gets the radio speed.
Sourcepub fn set_radio_speed(&mut self, speed: RadioSpeed)
pub fn set_radio_speed(&mut self, speed: RadioSpeed)
Sets the radio speed.
Sourcepub fn get_pitch_trim(&self) -> f32
pub fn get_pitch_trim(&self) -> f32
Gets the pitch trim value.
Sourcepub fn set_pitch_trim(&mut self, trim: f32)
pub fn set_pitch_trim(&mut self, trim: f32)
Sets the pitch trim value.
Sourcepub fn get_roll_trim(&self) -> f32
pub fn get_roll_trim(&self) -> f32
Gets the roll trim value.
Sourcepub fn set_roll_trim(&mut self, trim: f32)
pub fn set_roll_trim(&mut self, trim: f32)
Sets the roll trim value.
Sourcepub fn get_radio_address(&self) -> &[u8; 5]
pub fn get_radio_address(&self) -> &[u8; 5]
Gets the radio address.
Sourcepub fn set_radio_address(&mut self, address: [u8; 5])
pub fn set_radio_address(&mut self, address: [u8; 5])
Sets the radio address.
Trait Implementations§
Source§impl Debug for EEPROMConfigMemory
impl Debug for EEPROMConfigMemory
Source§impl FromMemoryBackend for EEPROMConfigMemory
impl FromMemoryBackend for EEPROMConfigMemory
Source§async fn from_memory_backend(memory: MemoryBackend) -> Result<Self>
async fn from_memory_backend(memory: MemoryBackend) -> Result<Self>
Create a memory-specific type from a
MemoryBackend. When created the
memory is automatically read to populate the fields of the type. Read moreSource§async fn initialize_memory_backend(memory: MemoryBackend) -> Result<Self>
async fn initialize_memory_backend(memory: MemoryBackend) -> Result<Self>
Get a specific memory by its ID and initialize it according to the defaults. Note that the
values will not be written to the memory by default, the user needs to handle this. Read more
Source§fn close_memory(self) -> MemoryBackend
fn close_memory(self) -> MemoryBackend
Close the memory and return the backend to the subsystem Read more
Auto Trait Implementations§
impl Freeze for EEPROMConfigMemory
impl RefUnwindSafe for EEPROMConfigMemory
impl Send for EEPROMConfigMemory
impl Sync for EEPROMConfigMemory
impl Unpin for EEPROMConfigMemory
impl UnwindSafe for EEPROMConfigMemory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more