IIO_DECLARE_QUATERNION(9)
π IIO_DECLARE_QUATERNION π
okay bestie, welcome to the kernel API manual β this one is IIO_DECLARE_QUATERNION, and it's honestly a little icon of a macro. it lives in the IIO corner of the kernel and it's here to make your structs look correct. let's go π«Ά
β¨ SYNOPSIS β¨
IIO_DECLARE_QUATERNION (type , name );
like, that's it. two args, one macro, zero drama. π
π ARGUMENTS π
typeβ the element type of the individual vectors. yeah, the individual ones β this macro is built out of vectors, so you tell it what each of those little guys is made of. π§nameβ the identifier name. literally just what you wanna call the thing. your struct member's whole identity, no cap. β¨
πΈ DESCRIPTION πΈ
okay so, a quaternion? it's a vector composed of 4 elements: W, X, Y, Z. all four, together, as a unit. π
use this macro to declare a quaternion element in a struct β that's the whole job, that's the assignment β and it makes sure you get proper alignment in an IIO buffer. the way that alignment matters is genuinely not a joke, so pls don't hand-roll this one, bestie. π₯
π¦ SEE ALSO π¦
this is the part where the page goes full main-character and name-drops, like, the entire friend group. no gatekeeping here, iykyk π
kernel file ./include/linux/iio/iio.h
struct iio_chan_spec_ext_info(9)struct iio_enum(9)IIO_ENUM(9)IIO_ENUM_AVAILABLE(9)struct iio_mount_matrix(9)IIO_MOUNT_MATRIX(9)struct iio_event_spec(9)IIO_SCAN_FORMAT_SIGNED_INT(9)IIO_SCAN_FORMAT_UNSIGNED_INT(9)IIO_SCAN_FORMAT_FLOAT(9)struct iio_scan_type(9)struct iio_chan_spec(9)iio_channel_has_info(9)iio_channel_has_available(9)struct iio_info(9)struct iio_buffer_setup_ops(9)struct iio_dev(9)iio_device_register(9)devm_iio_device_register(9)iio_device_claim_direct(9)iio_device_release_direct(9)iio_device_try_claim_buffer_mode(9)iio_device_release_buffer_mode(9)IIO_DEV_ACQUIRE_DIRECT_MODE(9)IIO_DEV_ACQUIRE_FAILED(9)IIO_DEV_GUARD_CURRENT_MODE(9)iio_device_put(9)dev_to_iio_dev(9)iio_device_get(9)iio_device_set_parent(9)iio_device_set_drvdata(9)iio_device_get_drvdata(9)IIO_DECLARE_BUFFER_WITH_TS(9)IIO_DECLARE_DMA_BUFFER_WITH_TS(9)iio_get_debugfs_dentry(9)iio_device_suspend_triggering(9)iio_device_resume_triggering(9)iio_get_current_scan_type(9)iio_get_masklength(9)iio_for_each_active_channel(9)IIO_DEGREE_TO_RAD(9)IIO_RAD_TO_DEGREE(9)IIO_G_TO_M_S_2(9)IIO_M_S_2_TO_G(9)
like i said. the whole group chat. π
fr fr the only thing you actually have to remember: 4 elements,WXYZ, declared in a struct, aligned properly in an IIO buffer. slay that and you're done. π
and that's the page, bestie! this one came out of ./include/linux/iio, dated October 2026 β so go forth, declare your quaternions, and remember who told you about the alignment. periodt. ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms