pub struct LedDriverMemory {
pub leds: [Led; 12],
/* private fields */
}Expand description
Memory interface for the Crazyflie LED ring
Provides methods to control the 12 LEDs in the Crazyflie LED ring by writing RGB values to the LED driver memory. Colors are compressed to RGB565 format with intensity applied before writing.
Fields§
§leds: [Led; 12]The 12 LEDs in the ring
Implementations§
Source§impl LedDriverMemory
impl LedDriverMemory
Sourcepub async fn write_leds(&self) -> Result<()>
pub async fn write_leds(&self) -> Result<()>
Write the current LED values to the Crazyflie LED ring
Converts each LED’s RGB values to RGB565 format with intensity applied, and writes the 24-byte result to address 0x00 of the LED driver memory.
Trait Implementations§
Source§impl Debug for LedDriverMemory
impl Debug for LedDriverMemory
Source§impl FromMemoryBackend for LedDriverMemory
impl FromMemoryBackend for LedDriverMemory
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 LedDriverMemory
impl RefUnwindSafe for LedDriverMemory
impl Send for LedDriverMemory
impl Sync for LedDriverMemory
impl Unpin for LedDriverMemory
impl UnsafeUnpin for LedDriverMemory
impl UnwindSafe for LedDriverMemory
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