49 volatile uint16_t p33c_CrcModule_Dispose(
void)
51 volatile uint16_t retval=1;
53 retval = p33c_CrcModule_ConfigWrite(crcModuleConfigClear);
79 crc = p33c_CrcModule_GetHandle();
103 volatile uint16_t p33c_CrcModule_ConfigWrite(
106 volatile uint16_t retval=1;
110 crc = p33c_CrcModule_GetHandle();
111 *crc = crcModuleConfig;
118 volatile uint16_t p33c_CrcModule_Initialize(
void){
120 volatile uint16_t retval=1;
124 crc = p33c_CrcModule_GetHandle();
127 retval &= p33c_CrcModule_ConfigWrite(crcModuleConfigClear);
149 volatile uint16_t p33c_CrcModule_Polynomial_Config(
volatile uint8_t lendian,
volatile uint8_t data_width,
150 volatile uint8_t poly_length,
volatile enum CRC_POLYNOMIAL_e poly,
volatile uint16_t seed){
152 volatile uint16_t retval=1;
156 crc = p33c_CrcModule_GetHandle();
159 retval &= p33c_CrcModule_ConfigWrite(crcModuleConfigClear);
197 volatile uint16_t p33c_CrcModule_Get_Data8_CRC16(
198 volatile uint8_t *data,
volatile uint8_t start,
volatile uint8_t size)
200 volatile uint16_t i=0;
201 volatile uint16_t fifo_buf=0;
202 volatile uint16_t crc_buf=0;
203 volatile uint16_t data_size=0;
204 volatile uint16_t is_odd=
false;
205 volatile uint16_t rev_poly=0;
209 crc = p33c_CrcModule_GetHandle();
214 is_odd = (bool) (size & 0x01);
217 data_size = (size & 0xFE);
224 for(i=start; i < (start + data_size); i+=2)
227 fifo_buf = ((data[i + 1]) << 8 | data[i]);
243 crc_buf = ReverseBitOrder16b(crc_buf);
251 crc_buf ^= data[start + size - 1];
253 for (i = 0; i < 8; ++i)
255 if (crc_buf & 0x0001)
256 crc_buf = (crc_buf >> 1) ^ rev_poly;
258 crc_buf = (crc_buf >> 1);
290 .CrcConh.value = 0x0000,
291 .CrcDath.value = 0x0000,
292 .CrcDatl.value = 0x0000,
293 .CrcWdath.value= 0x0000,
294 .CrcWdatl.value= 0x0000,
295 .CrcXorh.value = 0x0000,
296 .CrcXorl.value = 0x0000,
314 .CrcConl.bits.MOD = 1,
315 .CrcConl.bits.CRCISEL = 0,
316 .CrcConl.bits.LENDIAN = 1,
318 .CrcConh.bits.DWIDTH = (16-1),
322 .CrcConl.bits.CRCGO = 0,
323 .CrcXorl.value = CRC16_PVIZ_POLYNOMIAL,
325 .CrcWdatl.value= CRC16_PVIZ_SEED_VALUE,
volatile struct tagCRCCONLBITS bits
union P33C_CRC_MODULE_s::@48 CrcDatl
union P33C_CRC_MODULE_s::@44 CrcConl
union P33C_CRC_MODULE_s::@50 CrcWdatl
union P33C_CRC_MODULE_s::@46 CrcXorl
union P33C_CRC_MODULE_s::@49 CrcDath
union P33C_CRC_MODULE_s::@47 CrcXorh
union P33C_CRC_MODULE_s::@45 CrcConh