macro_rules! crc8 {
(fn $function_name:ident, $poly:expr, $initial_value:expr, $doc:expr) => { ... };
}
Expand description
Define public function implementing the CRC-8 algorithm for the given polynomial and initial value.
A function name and some documentation for it must be provided. For example:
use embedded_crc_macros::crc8;
crc8!(fn smbus_pec, 7 /* x^8+x^2+x+1 */, 0, "SMBus Packet Error Code");