36 #ifndef _UTIL_CRC16_H_
37 #define _UTIL_CRC16_H_
118 __asm__ __volatile__ (
123 "mov __tmp_reg__,%1" "\n\t"
126 "eor %1,__tmp_reg__" "\n\t"
127 "mov __tmp_reg__,%1" "\n\t"
129 "eor %1,__tmp_reg__" "\n\t"
130 "andi %1,0x07" "\n\t"
131 "mov __tmp_reg__,%A0" "\n\t"
134 "ror __tmp_reg__" "\n\t"
136 "mov %B0,__tmp_reg__" "\n\t"
138 "lsr __tmp_reg__" "\n\t"
140 "eor %B0,__tmp_reg__" "\n\t"
142 :
"=r" (__ret),
"=d" (__tmp)
143 :
"r" (__data),
"0" (__crc)
186 __asm__ __volatile__ (
188 "mov __tmp_reg__,%B0" "\n\t"
189 "swap __tmp_reg__" "\n\t"
192 "mov %1,__tmp_reg__" "\n\t"
193 "andi %1,0x0f" "\n\t"
196 "eor %2,__tmp_reg__" "\n\t"
198 "andi %2,0xe0" "\n\t"
202 "mov %2,__tmp_reg__" "\n\t"
204 "andi %2,0xf0" "\n\t"
206 "mov __tmp_reg__,%B0" "\n\t"
207 "lsl __tmp_reg__" "\n\t"
212 "andi %B0,0x1f" "\n\t"
216 :
"=d" (__ret),
"=d" (__tmp1),
"=d" (__tmp2)
217 :
"r" (__data),
"0" (__crc)
257 __asm__ __volatile__ (
260 "mov __tmp_reg__,%A0" "\n\t"
262 "andi %A0,0xf0" "\n\t"
263 "eor %A0,__tmp_reg__" "\n\t"
265 "mov __tmp_reg__,%B0" "\n\t"
270 "andi %A0,0x0f" "\n\t"
271 "eor __tmp_reg__,%A0" "\n\t"
280 "eor %A0,__tmp_reg__"
283 :
"r" (__data),
"0" (__crc)
323 __asm__ __volatile__ (
326 " ldi %2, 0x8C" "\n\t"
332 :
"=r" (__crc),
"=d" (__i),
"=d" (__pattern)
333 :
"0" (__crc),
"r" (__data));
389 __asm__ __volatile__ (
392 " ldi %2, 0x07" "\n\t"
398 :
"=r" (__crc),
"=d" (__i),
"=d" (__pattern)
399 :
"0" (__crc),
"r" (__data));
static __inline__ uint8_t _crc8_ccitt_update(uint8_t __crc, uint8_t __data)
Definition: crc16.h:386
static __inline__ uint16_t _crc_ccitt_update(uint16_t __crc, uint8_t __data)
Definition: crc16.h:253
static __inline__ uint16_t _crc16_update(uint16_t __crc, uint8_t __data)
Definition: crc16.h:113
static __inline__ uint16_t _crc_xmodem_update(uint16_t __crc, uint8_t __data)
Definition: crc16.h:179
static __inline__ uint8_t _crc_ibutton_update(uint8_t __crc, uint8_t __data)
Definition: crc16.h:320
unsigned char uint8_t
Definition: stdint.h:80
unsigned int uint16_t
Definition: stdint.h:90