Revision 323
more stuff
utils.h | ||
---|---|---|
15 | 15 |
/** |
16 | 16 |
* @brief Gets the most significant byte of a 16-bit variable |
17 | 17 |
* @param val 16-bit variable |
18 |
* @param lsb Pointer to a 8-bit variable to store the value of the MSB
|
|
18 |
* @param msb Pointer to a 8-bit variable to store the value of the MSB
|
|
19 | 19 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
20 | 20 |
*/ |
21 | 21 |
int(util_get_MSB)(uint16_t val, uint8_t *msb); |
... | ... | |
42 | 42 |
* @param b Second value |
43 | 43 |
* @return The minimum of the two values |
44 | 44 |
*/ |
45 |
int32_t min(int32_t a, int32_t b); |
|
45 |
int16_t min16(int16_t a, int16_t b); |
|
46 |
uint16_t umin16(uint16_t a, uint16_t b); |
|
47 |
int32_t min32(int32_t a, int32_t b); |
|
48 |
double dmin (double a, double b); |
|
46 | 49 |
|
47 | 50 |
/** |
48 | 51 |
* @brief Gets the maximum value out of two values. |
... | ... | |
50 | 53 |
* @param b Second value |
51 | 54 |
* @return The maximum of the two values |
52 | 55 |
*/ |
53 |
int32_t max(int32_t a, int32_t b); |
|
56 |
int16_t max16(int16_t a, int16_t b); |
|
57 |
uint16_t umax16(uint16_t a, uint16_t b); |
|
58 |
int32_t max32(int32_t a, int32_t b); |
|
59 |
double dmax (double a, double b); |
|
54 | 60 |
|
55 |
/** |
|
56 |
* @brief Gets the minimum value out of two doubles. |
|
57 |
* @param a First value |
|
58 |
* @param b Second value |
|
59 |
* @return The minimum of the two values |
|
60 |
*/ |
|
61 |
double min_d(double a, double b); |
|
61 |
double dabs(double a); |
|
62 | 62 |
|
63 |
/** |
|
64 |
* @brief Gets the maximum value out of two doubles. |
|
65 |
* @param a First value |
|
66 |
* @param b Second value |
|
67 |
* @return The maximum of the two values |
|
68 |
*/ |
|
69 |
double max_d(double a, double b); |
|
63 |
int deq(double a, double b); |
|
70 | 64 |
|
71 |
|
|
72 |
double abs_d(double a); |
|
73 |
|
|
74 |
|
|
75 | 65 |
#endif //UTILS_H_INCLUDED |
Also available in: Unified diff