Firmware Functions
FXTH87xx11 and FXTH87xx12 Embedded Firmware User Guide, Rev. 2.1
Freescale Semiconductor, Inc.
43
3.2.45
void TPMS_MULT_SIGN_INT16(INT16 i16Mult1, INT16 i16Mult2,
INT32* pi32Result)
•
Description:
This function will multiply two signed 16-bit numbers together.
•
Stack size:
17 bytes
•
Approx. Duration:
60 usec
•
Power Management:
This function executes entirely in RUN mode.
•
Interrupt Management:
This function does not await any interrupts. It should not be affected by
interrupts.
•
Resources:
N/A
•
Input Parameters:
— INT16 i16Mult1: First multiplier.
— INT16 i16Mult2: Second multiplier.
— INT32* pi32Result: Pointer to a 32-bit variable where the result will be stored.
•
Returns:
— void
3.2.46
UINT16 TPMS_WAVG(UINT8 u8PNew, UINT16 u16POld, UINT8
u8Avg)
•
Description:
This subroutine calculates a new weighed average value for a given new and old
measurement readings by using the following equation:
Eqn. 1
•
Stack size:
12 bytes
•
Approx. Duration:
38 usec (average of 2), 43 usec (average of 4), 48 usec (average of 8), 53 usec
(average of 16), 56 usec (average of 32).
•
Power Management:
This function executes entirely in RUN mode.
•
Interrupt Management:
This function does not await any interrupts. It will not be affected by
interrupts.
•
Resources:
N/A
•
Input Parameters:
— UINT8 u8PNew: new value to include in average.
— UINT16 u16Pold: Old average.
— UINT8 u8Avg: Weight of the average. This value can be 2, 4, 8, 16, 32; any other value will
return an incorrect response.
•
Returns
:
— UINT16 u8NewAverage: resulting weighed average of both old average and the new value
(refer to
).
u16NewAverage
u16POld
u8AVG
1
–
u8PNew
+
u8Avg
=