#[macro_export]
macro_rules! impl_one_byte_write_command {
    ($type:ty, $address:expr) => {
        impl $crate::communications::traits::WriteOneByteCommand for $type {
            fn raw_value(&self) -> u8 {
                self.raw_value()
            }

            fn get_command(&self) -> Command {
                $address
            }
        }
    };
}

#[macro_export]
macro_rules! impl_one_byte_read_command {
    ($type:ty, $address:expr) => {
        impl $crate::communications::traits::ReadOneByteCommand for $type {
            fn new_with_raw_value(raw_value: u8) -> Self {
                Self::new_with_raw_value(raw_value)
            }
            fn command() -> Command {
                $address
            }
        }
    };
}

#[macro_export]
macro_rules! impl_two_byte_write_command {
    ($type:ty, $address:expr) => {
        impl $crate::communications::traits::WriteTwoByteCommand for $type {
            fn raw_value(&self) -> u16 {
                self.raw_value()
            }
            fn get_command(&self) -> Command {
                $address
            }
        }
    };
}

#[macro_export]
macro_rules! impl_two_byte_read_command {
    ($type:ty, $address:expr) => {
        impl $crate::communications::traits::ReadTwoByteCommand for $type {
            fn new_with_raw_value(raw_value: u16) -> Self {
                Self::new_with_raw_value(raw_value)
            }
            fn command() -> Command {
                $address
            }
        }
    };
}
