utility.h
00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __UTILITY_H__
00010 #define __UTILITY_H__
00011
00012
00020 typedef signed long int fixed;
00021 #define FIXED_ONE (0x01<<16)
00022 #define FIXED_MAX ((fixed)0x7FFFFFFF)
00023 #define FIXED_FLOAT (1.0/FIXED_ONE)
00024 //Fixed Point Functions
00025 fixed float_to_fixed(float m);
00026 fixed int_to_fixed(int m);
00027 float fixed_to_float(fixed m);
00028 int fixed_to_int(fixed m);
00029 fixed fixed_mult(fixed a, fixed b);
00030 fixed fixed_div(fixed a, fixed b);
00031 long long int fixed_mult_to_long(fixed a, fixed b);
00032 fixed linear_to_fixed(int offset, float coeff, int value);
00033 fixed fixed_abs(fixed f);
00034
00035 typedef void(*VOID_VOID_F)(void);
00036 typedef void(*VOID_INT_F)(int);
00037 typedef int(*INT_VOID_F)(void);
00038 typedef float(*FLOAT_VOID_F)(void);
00039 typedef fixed(*FIXED_VOID_F)(void);
00041 void voidvoid(void);
00042 void voidint(int a);
00043 int intvoid(void);
00044 float floatvoid(void);
00045 void voidvoid_noerror(void);
00046 void voidint_noerror(int a);
00047 int intvoid_noerror(void);
00048 float floatvoid_noerror(void);
00049
00050
00051 void tic_toc_init(VOID_INT_F print_f);
00052 void tic(void);
00053 void toc(void);
00054
00055 #endif
00056