34 #ifndef _UTIL_CRC16_H_
35 #define _UTIL_CRC16_H_
116 __asm__ __volatile__ (
121 "mov __tmp_reg__,%1" "\n\t"
124 "eor %1,__tmp_reg__" "\n\t"
125 "mov __tmp_reg__,%1" "\n\t"
127 "eor %1,__tmp_reg__" "\n\t"
128 "andi %1,0x07" "\n\t"
129 "mov __tmp_reg__,%A0" "\n\t"
132 "ror __tmp_reg__" "\n\t"
134 "mov %B0,__tmp_reg__" "\n\t"
136 "lsr __tmp_reg__" "\n\t"
138 "eor %B0,__tmp_reg__" "\n\t"
140 :
"=r" (__ret),
"=d" (__tmp)
141 :
"r" (__data),
"0" (__crc)
184 __asm__ __volatile__ (
186 "mov __tmp_reg__,%B0" "\n\t"
187 "swap __tmp_reg__" "\n\t"
190 "mov %1,__tmp_reg__" "\n\t"
191 "andi %1,0x0f" "\n\t"
194 "eor %2,__tmp_reg__" "\n\t"
196 "andi %2,0xe0" "\n\t"
200 "mov %2,__tmp_reg__" "\n\t"
202 "andi %2,0xf0" "\n\t"
204 "mov __tmp_reg__,%B0" "\n\t"
205 "lsl __tmp_reg__" "\n\t"
210 "andi %B0,0x1f" "\n\t"
214 :
"=d" (__ret),
"=d" (__tmp1),
"=d" (__tmp2)
215 :
"r" (__data),
"0" (__crc)
255 __asm__ __volatile__ (
258 "mov __tmp_reg__,%A0" "\n\t"
260 "andi %A0,0xf0" "\n\t"
261 "eor %A0,__tmp_reg__" "\n\t"
263 "mov __tmp_reg__,%B0" "\n\t"
268 "andi %A0,0x0f" "\n\t"
269 "eor __tmp_reg__,%A0" "\n\t"
278 "eor %A0,__tmp_reg__"
281 :
"r" (__data),
"0" (__crc)
321 __asm__ __volatile__ (
324 " ldi %2, 0x8C" "\n\t"
330 :
"=r" (__crc),
"=d" (__i),
"=d" (__pattern)
331 :
"0" (__crc),
"r" (__data));
static __inline__ uint16_t _crc_ccitt_update(uint16_t __crc, uint8_t __data)
Definition: crc16.h:251
static __inline__ uint16_t _crc16_update(uint16_t __crc, uint8_t __data)
Definition: crc16.h:111
static __inline__ uint16_t _crc_xmodem_update(uint16_t __crc, uint8_t __data)
Definition: crc16.h:177
static __inline__ uint8_t _crc_ibutton_update(uint8_t __crc, uint8_t __data)
Definition: crc16.h:318
unsigned char uint8_t
Definition: stdint.h:79
unsigned int uint16_t
Definition: stdint.h:89