mpy32.h
Go to the documentation of this file.
00001 #ifndef __MSP430WARE_MPY32_H__
00002 #define __MSP430WARE_MPY32_H__
00003 
00004 //*****************************************************************************
00005 //
00006 //The following are the defines to include the required modules for this
00007 //peripheral in msp430xgeneric.h file
00008 //
00009 //*****************************************************************************
00010 #define __MSP430_HAS_MPY32__
00011 
00012 
00013 //*****************************************************************************
00014 //
00015 //The following is a struct that can be returned by MPY32_getResult64Bit()
00016 //
00017 //*****************************************************************************
00018 typedef struct {
00019     unsigned int RES0;
00020     unsigned int RES1;
00021     unsigned int RES2;
00022     unsigned int RES3;
00023 } uint64;
00024 
00025 //*****************************************************************************
00026 //
00027 //The following are values that can be passed to MPY32_setWriteDelay() in the
00028 //delaySelect parameter.
00029 //
00030 //*****************************************************************************
00031 #define MPY32_WRITEDELAY_OFF   ( !(MPYDLY32 + MPYDLYWRTEN) )
00032 #define MPY32_WRITEDELAY_32BIT (MPYDLYWRTEN)
00033 #define MPY32_WRITEDELAY_64BIT (MPYDLY32 + MPYDLYWRTEN)
00034 
00035 //*****************************************************************************
00036 //
00037 //The following are values that can be passed to MPY32_setOperandOne8Bit(),
00038 //MPY32_setOperandOne8Bit(), MPY32_setOperandOne8Bit(), and
00039 //MPY32_setOperandOne8Bit() in the multiplicationType parameter.
00040 //
00041 //*****************************************************************************
00042 #define MPY32_MULTIPLY_UNSIGNED           (0x00)
00043 #define MPY32_MULTIPLY_SIGNED             (0x02)
00044 #define MPY32_MULTIPLYACCUMULATE_UNSIGNED (0x04)
00045 #define MPY32_MULTIPLYACCUMULATE_SIGNED   (0x06)
00046 
00047 //*****************************************************************************
00048 //
00049 //Prototypes for the APIs.
00050 //
00051 //*****************************************************************************
00052 
00053 extern void MPY32_setWriteDelay (unsigned int baseAddress,
00054     unsigned int writeDelaySelect);
00055 
00056 extern void MPY32_setSaturationMode (unsigned int baseAddress);
00057 
00058 extern void MPY32_resetSaturationMode (unsigned int baseAddress);
00059 
00060 extern void MPY32_setFractionMode (unsigned int baseAddress);
00061 
00062 extern void MPY32_resetFractionMode (unsigned int baseAddress);
00063 
00064 extern void MPY32_setOperandOne8Bit (unsigned int baseAddress,
00065     unsigned char multiplicationType,
00066     unsigned char operand);
00067 
00068 extern void MPY32_setOperandOne16Bit (unsigned int baseAddress,
00069     unsigned char multiplicationType,
00070     unsigned int operand);
00071 
00072 extern void MPY32_setOperandOne24Bit (unsigned int baseAddress,
00073     unsigned char multiplicationType,
00074     unsigned long operand);
00075 
00076 extern void MPY32_setOperandOne32Bit (unsigned int baseAddress,
00077     unsigned char multiplicationType,
00078     unsigned long operand);
00079 
00080 extern void MPY32_setOperandTwo8Bit (unsigned int baseAddress,
00081     unsigned char operand);
00082 
00083 extern void MPY32_setOperandTwo16Bit (unsigned int baseAddress,
00084     unsigned int operand);
00085 
00086 extern void MPY32_setOperandTwo24Bit (unsigned int baseAddress,
00087     unsigned long operand);
00088 
00089 extern void MPY32_setOperandTwo32Bit (unsigned int baseAddress,
00090     unsigned long operand);
00091 
00092 extern unsigned char MPY32_getResult8Bit (unsigned int baseAddress);
00093 
00094 extern unsigned int MPY32_getResult16Bit (unsigned int baseAddress);
00095 
00096 extern unsigned long MPY32_getResult24Bit (unsigned int baseAddress);
00097 
00098 extern unsigned long MPY32_getResult32Bit (unsigned int baseAddress);
00099 
00100 extern uint64 MPY32_getResult64Bit (unsigned int baseAddress);
00101 
00102 extern unsigned int MPY32_getSumExtension (unsigned int baseAddress);
00103 
00104 extern unsigned short MPY32_getCarryBitValue (unsigned int baseAddress);
00105 
00106 #endif

Copyright 2012, Texas Instruments Incorporated