MSP430 DriverLib for MSP430i2xx Devices  2.91.13.01
mpy

Functions

void MPY_setOperandOne8Bit (uint8_t multiplicationType, uint8_t operand)
 Sets an 8-bit value into operand 1. More...
 
void MPY_setOperandOne16Bit (uint8_t multiplicationType, uint16_t operand)
 Sets an 16-bit value into operand 1. More...
 
void MPY_setOperandTwo8Bit (uint8_t operand)
 Sets an 8-bit value into operand 2, which starts the multiplication. More...
 
void MPY_setOperandTwo16Bit (uint16_t operand)
 Sets an 16-bit value into operand 2, which starts the multiplication. More...
 
uint32_t MPY_getResult (void)
 Returns an 64-bit result of the last multiplication operation. More...
 
uint16_t MPY_getSumExtension (void)
 Returns the Sum Extension of the last multiplication operation. More...
 

Detailed Description

Function Documentation

§ MPY_getResult()

uint32_t MPY_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

§ MPY_getSumExtension()

uint16_t MPY_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 MPY module Sum Extension.

§ MPY_setOperandOne16Bit()

void MPY_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:
  • MPY_MULTIPLY_UNSIGNED
  • MPY_MULTIPLY_SIGNED
  • MPY_MULTIPLYACCUMULATE_UNSIGNED
  • MPY_MULTIPLYACCUMULATE_SIGNED
operandis the 16-bit value to load into the 1st operand.
Returns
None

§ MPY_setOperandOne8Bit()

void MPY_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:
  • MPY_MULTIPLY_UNSIGNED
  • MPY_MULTIPLY_SIGNED
  • MPY_MULTIPLYACCUMULATE_UNSIGNED
  • MPY_MULTIPLYACCUMULATE_SIGNED
operandis the 8-bit value to load into the 1st operand.
Returns
None

§ MPY_setOperandTwo16Bit()

void MPY_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

§ MPY_setOperandTwo8Bit()

void MPY_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

Copyright 2020, Texas Instruments Incorporated