X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=include%2Fmsp430%2Fcrc16.h;fp=include%2Fmsp430%2Fcrc16.h;h=2c922c64923ec965c75bddd751b0c0a8ea10e304;hb=6f720ff00773571c2fa2d35e67bff68547617639;hp=0000000000000000000000000000000000000000;hpb=807b2dd5b7365eb87b482197af3b4a3f520c14f7;p=msp430-libc.git diff --git a/include/msp430/crc16.h b/include/msp430/crc16.h new file mode 100644 index 0000000..2c922c6 --- /dev/null +++ b/include/msp430/crc16.h @@ -0,0 +1,40 @@ +#ifndef __MSP430_HEADERS_CRC16_H +#define __MSP430_HEADERS_CRC16_H + +/* crc16.h + * + * mspgcc project: MSP430 device headers + * hardware CRC module + * + * (c) 2009 by J.M.Gross + * Originally based on MSP430x5xx Family User's Guide (slau208b). + * + * $Id: crc16.h,v 1.0 2009/10/08 23:00:38 Exp $ + */ + +/* Switches: + +__MSP430_CRC16_BASE__ - base address of CRC16 module. + +*/ + +#if defined(__MSP430_CRC16_BASE__) +#define CRCDI_ __MSP430_CRC16_BASE__ + 0x00 /* CRC Data in (word) */ +sfrw(CRCDI, CRCDI_); +sfrb(CRCDI_L, CRCDI_); +sfrb(CRCDI_H, CRCDI_+1); +#define CRCDIRB_ __MSP430_CRC16_BASE__ + 0x02 /* CRC Data in reverse bit(word) */ +sfrw(CRCDIRB, CRCDIRB_); +sfrb(CRCDIRB_L, CRCDIRB_); +sfrb(CRCDIRB_H, CRCDIRB_+1); +#define CRCINIRES_ __MSP430_CRC16_BASE__ + 0x04 /* CRC initialisation and result */ +sfrw(CRCINIRES, CRCINIRES_); +sfrb(CRCINIRES_L, CRCINIRES_); +sfrb(CRCINIRES_H, CRCINIRES_+1); +#define CRCRESR_ __MSP430_CRC16_BASE__ + 0x06 /* CRC result reverse */ +sfrw(CRCRESR, CRCRESR_); +sfrb(CRCRESR_L, CRCRESR_); +sfrb(CRCRESR_H, CRCRESR_+1); +#endif + +#endif /* __MSP430_HEADERS_CRC16_H */