MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.10.00.09
 All Data Structures Functions Variables Modules Pages
mpy32

Functions

void MPY32_setWriteDelay (uint16_t writeDelaySelect)
 Sets the write delay setting for the MPY32 module. More...
 
void MPY32_enableSaturationMode (void)
 Enables Saturation Mode. More...
 
void MPY32_disableSaturationMode (void)
 Disables Saturation Mode. More...
 
uint8_t MPY32_getSaturationMode (void)
 Gets the Saturation Mode. More...
 
void MPY32_enableFractionalMode (void)
 Enables Fraction Mode. More...
 
void MPY32_disableFractionalMode (void)
 Disables Fraction Mode. More...
 
uint8_t MPY32_getFractionalMode (void)
 Gets the Fractional Mode. More...
 
void MPY32_setOperandOne8Bit (uint8_t multiplicationType, uint8_t operand)
 Sets an 8-bit value into operand 1. More...
 
void MPY32_setOperandOne16Bit (uint8_t multiplicationType, uint16_t operand)
 Sets an 16-bit value into operand 1. More...
 
void MPY32_setOperandOne24Bit (uint8_t multiplicationType, uint32_t operand)
 Sets an 24-bit value into operand 1. More...
 
void MPY32_setOperandOne32Bit (uint8_t multiplicationType, uint32_t operand)
 Sets an 32-bit value into operand 1. More...
 
void MPY32_setOperandTwo8Bit (uint8_t operand)
 Sets an 8-bit value into operand 2, which starts the multiplication. More...
 
void MPY32_setOperandTwo16Bit (uint16_t operand)
 Sets an 16-bit value into operand 2, which starts the multiplication. More...
 
void MPY32_setOperandTwo24Bit (uint32_t operand)
 Sets an 24-bit value into operand 2, which starts the multiplication. More...
 
void MPY32_setOperandTwo32Bit (uint32_t operand)
 Sets an 32-bit value into operand 2, which starts the multiplication. More...
 
uint64_t MPY32_getResult (void)
 Returns an 64-bit result of the last multiplication operation. More...
 
uint16_t MPY32_getSumExtension (void)
 Returns the Sum Extension of the last multiplication operation. More...
 
uint16_t MPY32_getCarryBitValue (void)
 Returns the Carry Bit of the last multiplication operation. More...
 
void MPY32_clearCarryBitValue (void)
 Clears the Carry Bit of the last multiplication operation. More...
 
void MPY32_preloadResult (uint64_t result)
 Preloads the result register. More...
 

Detailed Description

Function Documentation

void MPY32_clearCarryBitValue ( void  )

Clears the Carry Bit of the last multiplication operation.

This function clears the Carry Bit of the MPY module

Returns
The value of the MPY32 module Carry Bit 0x0 or 0x1.
void MPY32_disableFractionalMode ( void  )

Disables Fraction Mode.

This function disables fraction mode.

Returns
None
void MPY32_disableSaturationMode ( void  )

Disables Saturation Mode.

This function disables saturation mode, which allows the raw result of the MPY result registers to be returned.

Returns
None
void MPY32_enableFractionalMode ( void  )

Enables Fraction Mode.

This function enables fraction mode.

Returns
None
void MPY32_enableSaturationMode ( void  )

Enables Saturation Mode.

This function enables saturation mode. When this is enabled, the result read out from the MPY result registers is converted to the most-positive number in the case of an overflow, or the most-negative number in the case of an underflow. Please note, that the raw value in the registers does not reflect the result returned, and if the saturation mode is disabled, then the raw value of the registers will be returned instead.

Returns
None
uint16_t MPY32_getCarryBitValue ( void  )

Returns the Carry Bit of the last multiplication operation.

This function returns the Carry Bit of the MPY module, which either gives the sign after a signed operation or shows a carry after a multiply- and- accumulate operation.

Returns
The value of the MPY32 module Carry Bit 0x0 or 0x1.
uint8_t MPY32_getFractionalMode ( void  )

Gets the Fractional Mode.

This function gets the current fractional mode.

Returns
Gets the fractional mode Return one of the following:
  • MPY32_FRACTIONAL_MODE_DISABLED
  • MPY32_FRACTIONAL_MODE_ENABLED
    Gets the Fractional Mode
uint64_t MPY32_getResult ( void  )

Returns an 64-bit result of the last multiplication operation.

This function returns all 64 bits of the result registers

Returns
The 64-bit result is returned as a uint64_t type
uint8_t MPY32_getSaturationMode ( void  )

Gets the Saturation Mode.

This function gets the current saturation mode.

Returns
Gets the Saturation Mode Return one of the following:
  • MPY32_SATURATION_MODE_DISABLED
  • MPY32_SATURATION_MODE_ENABLED
    Gets the Saturation Mode
uint16_t MPY32_getSumExtension ( void  )

Returns the Sum Extension of the last multiplication operation.

This function returns the Sum Extension of the MPY module, which either gives the sign after a signed operation or shows a carry after a multiply- and-accumulate operation. The Sum Extension acts as a check for overflows or underflows.

Returns
The value of the MPY32 module Sum Extension.
void MPY32_preloadResult ( uint64_t  result)

Preloads the result register.

This function Preloads the result register

Parameters
resultvalue to preload the result register to
Returns
None
void MPY32_setOperandOne16Bit ( uint8_t  multiplicationType,
uint16_t  operand 
)

Sets an 16-bit value into operand 1.

This function sets the first operand for multiplication and determines what type of operation should be performed. Once the second operand is set, then the operation will begin.

Parameters
multiplicationTypeis the type of multiplication to perform once the second operand is set. Valid values are:
  • MPY32_MULTIPLY_UNSIGNED
  • MPY32_MULTIPLY_SIGNED
  • MPY32_MULTIPLYACCUMULATE_UNSIGNED
  • MPY32_MULTIPLYACCUMULATE_SIGNED
operandis the 16-bit value to load into the 1st operand.
Returns
None
void MPY32_setOperandOne24Bit ( uint8_t  multiplicationType,
uint32_t  operand 
)

Sets an 24-bit value into operand 1.

This function sets the first operand for multiplication and determines what type of operation should be performed. Once the second operand is set, then the operation will begin.

Parameters
multiplicationTypeis the type of multiplication to perform once the second operand is set. Valid values are:
  • MPY32_MULTIPLY_UNSIGNED
  • MPY32_MULTIPLY_SIGNED
  • MPY32_MULTIPLYACCUMULATE_UNSIGNED
  • MPY32_MULTIPLYACCUMULATE_SIGNED
operandis the 24-bit value to load into the 1st operand.
Returns
None
void MPY32_setOperandOne32Bit ( uint8_t  multiplicationType,
uint32_t  operand 
)

Sets an 32-bit value into operand 1.

This function sets the first operand for multiplication and determines what type of operation should be performed. Once the second operand is set, then the operation will begin.

Parameters
multiplicationTypeis the type of multiplication to perform once the second operand is set. Valid values are:
  • MPY32_MULTIPLY_UNSIGNED
  • MPY32_MULTIPLY_SIGNED
  • MPY32_MULTIPLYACCUMULATE_UNSIGNED
  • MPY32_MULTIPLYACCUMULATE_SIGNED
operandis the 32-bit value to load into the 1st operand.
Returns
None
void MPY32_setOperandOne8Bit ( uint8_t  multiplicationType,
uint8_t  operand 
)

Sets an 8-bit value into operand 1.

This function sets the first operand for multiplication and determines what type of operation should be performed. Once the second operand is set, then the operation will begin.

Parameters
multiplicationTypeis the type of multiplication to perform once the second operand is set. Valid values are:
  • MPY32_MULTIPLY_UNSIGNED
  • MPY32_MULTIPLY_SIGNED
  • MPY32_MULTIPLYACCUMULATE_UNSIGNED
  • MPY32_MULTIPLYACCUMULATE_SIGNED
operandis the 8-bit value to load into the 1st operand.
Returns
None
void MPY32_setOperandTwo16Bit ( uint16_t  operand)

Sets an 16-bit value into operand 2, which starts the multiplication.

This function sets the second operand of the multiplication operation and starts the operation.

Parameters
operandis the 16-bit value to load into the 2nd operand.
Returns
None
void MPY32_setOperandTwo24Bit ( uint32_t  operand)

Sets an 24-bit value into operand 2, which starts the multiplication.

This function sets the second operand of the multiplication operation and starts the operation.

Parameters
operandis the 24-bit value to load into the 2nd operand.
Returns
None
void MPY32_setOperandTwo32Bit ( uint32_t  operand)

Sets an 32-bit value into operand 2, which starts the multiplication.

This function sets the second operand of the multiplication operation and starts the operation.

Parameters
operandis the 32-bit value to load into the 2nd operand.
Returns
None
void MPY32_setOperandTwo8Bit ( uint8_t  operand)

Sets an 8-bit value into operand 2, which starts the multiplication.

This function sets the second operand of the multiplication operation and starts the operation.

Parameters
operandis the 8-bit value to load into the 2nd operand.
Returns
None
void MPY32_setWriteDelay ( uint16_t  writeDelaySelect)

Sets the write delay setting for the MPY32 module.

This function sets up a write delay to the MPY module's registers, which holds any writes to the registers until all calculations are complete. There are two different settings, one which waits for 32-bit results to be ready, and one which waits for 64-bit results to be ready. This prevents unpredicatble results if registers are changed before the results are ready.

Parameters
writeDelaySelectdelays the write to any MPY32 register until the selected bit size of result has been written. Valid values are:
  • MPY32_WRITEDELAY_OFF [Default] - writes are not delayed
  • MPY32_WRITEDELAY_32BIT - writes are delayed until a 32-bit result is available in the result registers
  • MPY32_WRITEDELAY_64BIT - writes are delayed until a 64-bit result is available in the result registers
    Modified bits are MPYDLY32 and MPYDLYWRTEN of MPY32CTL0 register.
Returns
None

Copyright 2015, Texas Instruments Incorporated