CRC CCITT UPDATE in Python

pythoneiro at gmail.com pythoneiro at gmail.com
Sat Mar 31 22:15:27 EDT 2007


Please,

      Please, is there here some good soul that understand this
functions hi8 and lo8 (from GCC AVR) and can help me to port it to
Python?

uint16_t
crc_ccitt_update (uint16_t crc, uint8_t data)
{
   data ˆ= lo8 (crc);
   data ˆ= data << 4;
   return ((((uint16_t)data << 8) | hi8 (crc)) ˆ (uint8_t)(data >> 4)
ˆ ((uint16_t)data << 3));
}

Source: http://tldp.tuxhilfe.de/linuxfocus/common/src2/article352/avr-libc-user-manual-1.0.4.pdf

     Reason, I would like to code in Python one simulator from one
code C++ AVR

Thanks.,

./Fã  -Py -Thorneiro




More information about the Python-list mailing list