Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sdo_write_array method to bulk-configure SDOs #234

Merged
merged 5 commits into from
Aug 15, 2024
Merged

Conversation

jamwaffles
Copy link
Collaborator

@jamwaffles jamwaffles commented Aug 15, 2024

Also handles indexing and setting the SDO length automatically, preventing a common mistake

// New:
subdevice
    .sdo_write_array(0x1c13, &[0x1a00u16, 0x1a02, 0x1a04, 0x1a06])
    .await?;

// Equivalent to:
subdevice.sdo_write(0x1c13, 0, 0u8).await?;
subdevice.sdo_write(0x1c13, 1, 0x1a00u16).await?;
subdevice.sdo_write(0x1c13, 2, 0x1a02u16).await?;
subdevice.sdo_write(0x1c13, 3, 0x1a04u16).await?;
subdevice.sdo_write(0x1c13, 4, 0x1a06u16).await?;
subdevice.sdo_write(0x1c13, 0, 4u8).await?;

@jamwaffles jamwaffles changed the title Add sdo_write_subindices method to bulk-configure SDOs Add sdo_write_array method to bulk-configure SDOs Aug 15, 2024
@jamwaffles jamwaffles merged commit e2a4602 into master Aug 15, 2024
10 checks passed
@jamwaffles jamwaffles deleted the bulk_configure branch August 15, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant