03.08.2013 Views

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8.342.1 Macro Definition<br />

#define F32_SQRT2_DIVBY_2 ((tFrac32) 0x5A82799A)<br />

8.342.2 Description<br />

Sqrt(2) divided by two with a 32-bit result, the result rounded <strong>for</strong> a better precision, i.e.<br />

round( √(2)/2*2 31 ).<br />

8.343 Define FRAC16<br />

#include <br />

8.343.1 Macro Definition<br />

#define FRAC16 ((tFrac16) ((x) < (SFRACT_MAX) ? ((x) >= SFRACT_MIN ? (x)*0x8000 :<br />

INT16_MIN) : INT16_MAX))<br />

8.343.2 Description<br />

Macro converting a signed fractional [-1,1) number into a 16-bit fixed point number in<br />

<strong>for</strong>mat Q1.15.<br />

8.344 Define FRAC32<br />

#include <br />

8.344.1 Macro Definition<br />

#define FRAC32 ((tFrac32) ((x) < (FRACT_MAX) ? ((x) >= FRACT_MIN ? (x)*0x80000000 :<br />

INT32_MIN) : INT32_MAX))<br />

<strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> <strong>PXR40xx</strong>, Rev. 1.0<br />

Chapter 8 Macro References<br />

Freescale Semiconductor, Inc. 917

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!