1.4.3.31 _LIBQ_ToStringQ15 Function

_Q15 to ASCII conversion.

Description

void _LIBQ_ToStringQ15(_Q15 x, char *s);

Convert a _Q15 fixed point value to an ASCII string representation in a -N.NNNNNN format.

Preconditions

The character string "s" must be at least 10 characters long, including the Null string terminator.

Parameters

x The fixed point value to be converted into an ASCII string (_Q15)

s A pointer to the output string of at least 10 characters

Returns

An ASCII string that represents the _Q15 fixed point value in -N.NNNNNN format. The output string will be terminated by a Null (0x00) character.

Remarks

Execution Time (cycles): 118 typical (28 to 132)

Program Memory 200 bytes

Example

char s[10];

_LIBQ_ToStringQ15((_Q15)0x1000, s); _// s will equal "0.125000"_

_LIBQ_ToStringQ15((_Q15)0x8000, s); _// s will equal "-1.000000"_

_LIBQ_ToStringQ15((_Q15)0x7FFF, s); _// s will equal "0.999969"_

C

void  _LIBQ_ToStringQ15 (_Q15 x , char * s );