servicepoint_binding_c 0.15.0

C bindings for the servicepoint crate.
Documentation
use crate::macros::wrap;
use servicepoint::{
    BinaryOperation, BitVecCommand, CompressionCode, DisplayBitVec, Offset,
};
use std::ptr::NonNull;

wrap!(
    BitVecCommand {
    derives: crate::commands::derive_command[BitVec];
    properties:
        prop bitvec: DisplayBitVec { get mut; set move; };
        prop offset: Offset { get; set; };
        prop operation: BinaryOperation { get; set; };
        prop compression: CompressionCode { get; set; };
    functions:
        /// Set pixel data starting at the pixel offset on screen.
        ///
        /// The screen will continuously overwrite more pixel data without regarding the offset, meaning
        /// once the starting row is full, overwriting will continue on column 0.
        ///
        /// The [`BinaryOperation`] will be applied on the display comparing old and sent bit.
        ///
        /// `new_bit = old_bit op sent_bit`
        ///
        /// For example, [`BinaryOperation::Or`] can be used to turn on some pixels without affecting other pixels.
        ///
        /// The contained [`DisplayBitVec`] is always uncompressed.
        fn new(
            bitvec: move NonNull<DisplayBitVec>,
            offset: val usize,
            operation: val BinaryOperation,
            compression: val CompressionCode,
        ) -> move NonNull<BitVecCommand> {
            BitVecCommand {
                bitvec,
                offset,
                operation,
                compression,
            }
        };
    }
);