no-OS
no_os_units.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef _NO_OS_UNITS_H_
34 #define _NO_OS_UNITS_H_
35 
36 /******************************************************************************/
37 /********************** Macros and Constants Definitions **********************/
38 /******************************************************************************/
39 #define PETA 1000000000000000ULL
40 #define TERA 1000000000000ULL
41 #define GIGA 1000000000UL
42 #define MEGA 1000000UL
43 #define KILO 1000UL
44 #define HECTO 100UL
45 #define DECA 10UL
46 #define DECI 10UL
47 #define CENTI 100UL
48 #define MILLI 1000UL
49 #define MICRO 1000000UL
50 #define NANO 1000000000UL
51 #define PICO 1000000000000ULL
52 #define FEMTO 1000000000000000ULL
53 
54 #define HZ_PER_KHZ 1000UL
55 #define KHZ_PER_MHZ 1000UL
56 #define HZ_PER_MHZ 1000000UL
57 
58 #define MILLIVOLT_PER_VOLT 1000UL
59 #define MICROVOLT_PER_VOLT 1000000UL
60 #define NANOVOLT_PER_VOLT 1000000000ULL
61 
62 #define MILLIAMPER_PER_AMPER 1000UL
63 #define MICROAMPER_PER_MILLIAMPER 1000UL
64 #define MICROAMPER_PER_AMPER 1000000UL
65 #define NANOAMPER_PER_AMPER 1000000000ULL
66 
67 #define MILLIWATT_PER_WATT 1000UL
68 #define MICROWATT_PER_MILLIWATT 1000UL
69 #define MICROWATT_PER_WATT 1000000UL
70 
71 #define MILLIDEGREE_PER_DEGREE 1000UL
72 
73 /* Returns the given value converted from degree to rad */
74 #define DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL)
75 
76 /* Returns the given value converted from rad to degree */
77 #define RAD_TO_DEGREE(rad) \
78  (((rad) * 18000000ULL + 314159ULL / 2) / 314159ULL)
79 
80 /* Returns the given value converted from g to meter / second**2 */
81 #define G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL)
82 
83 /* Returns the given value converted from meter / second**2 to g */
84 #define M_S_2_TO_G(ms2) (((ms2) * 100000ULL + 980665ULL / 2) / 980665ULL)
85 
86 #endif // _NO_OS_UNITS_H_