sbgECom Library
4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
|
Header file that contains all common definitions. More...
#include <assert.h>
#include <errno.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "sbgConfig.h"
Go to the source code of this file.
Macros | |
#define | SBG_COMMON_LIB_API |
#define | SBG_CONST_CAST_AA(x) x |
#define | __BASE_FILE__ __FILE__ |
#define | SBG_INLINE static inline |
#define | SBG_UNUSED_PARAMETER(x) (void)(x) |
#define | SBG_FALLTHROUGH |
#define | SBG_DEPRECATED(func) func |
#define | SBG_DEPRECATED_MACRO(func) func |
#define | SBG_CONFIG_WARN_ABOUT_DEPRECATED_TYPES (1) |
#define | SBG_DEPRECATED_TYPEDEF(decl) decl |
#define | sbgAbs(x) (((x) < 0) ? -(x) : (x)) |
#define | sbgMax(a, b) (((a) > (b)) ? (a) : (b)) |
#define | sbgMin(a, b) (((a) < (b)) ? (a) : (b)) |
#define | sbgClamp(value, minValue, maxValue) (((value) < (minValue))?(minValue): ((value) > (maxValue)?maxValue:value)) |
#define | sbgDivCeil(n, d) (((n) + (d) - 1) / (d)) |
Functions | |
SBG_INLINE double | sbgRadToDegd (double angle) |
SBG_INLINE double | sbgDegToRadd (double angle) |
SBG_INLINE float | sbgRadToDegf (float angle) |
SBG_INLINE float | sbgDegToRadf (float angle) |
SBG_INLINE bool | sbgAlmostEqualsFloat (float leftValue, float rightValue) |
SBG_INLINE bool | sbgAlmostEqualsDouble (double leftValue, double rightValue) |
Header file that contains all common definitions.
The MIT license
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SBG_COMMON_LIB_API |
Macro used to handle export and import methods of the sbgCommon library
#define SBG_CONST_CAST_AA | ( | x | ) | x |
GCC typeof C extension
XXX Visual C (not C++) doesn't provide anything to implement typeof(). As a result, this macro is private and shouldn't be relied on.
#define __BASE_FILE__ __FILE__ |
BASE_FILE is gcc specific
#define SBG_INLINE static inline |
Macro used to abstract the compiler specific inline keyword.
#define SBG_UNUSED_PARAMETER | ( | x | ) | (void)(x) |
Macro used to avoid compiler warning when a variable is not used.
#define SBG_FALLTHROUGH |
Compiler independent switch/case fallthrough attribute
The fallthrough attribute is used to avoid compiler warning in swith case statements when an intentional break is missing
#define SBG_DEPRECATED | ( | func | ) | func |
Compiler independent struct members packing attribute
This macro is used to define a new section of packed structures. All structures defined after this macro will be packed.
Compiler independent struct members packing attribute
This macro is used to specify that a structure is packed.
Compiler independent struct members packing attribute
This macro is used to close the section of packed structures and return to the default packing.
Macro used to indicate that a function is deprecated.
#define SBG_DEPRECATED_MACRO | ( | func | ) | func |
Macro used to indicate that a macro is deprecated.
#define SBG_CONFIG_WARN_ABOUT_DEPRECATED_TYPES (1) |
Set the default value of SBG_CONFIG_WARN_ABOUT_DEPRECATED_TYPES.
#define SBG_DEPRECATED_TYPEDEF | ( | decl | ) | decl |
Macro used to indicate that a type definition is deprecated.
XXX In order to avoid excessive noise caused by deprecation warnings, the attribute may currently be disabled by defining SBG_CONFIG_WARN_ABOUT_DEPRECATED_TYPES to 0.
#define sbgAbs | ( | x | ) | (((x) < 0) ? -(x) : (x)) |
Returns the absolute value of x.
[in] | x | Signed integer value. |
#define sbgMax | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
Returns the maximum between a and b
[in] | a | First operand. |
[in] | b | Second operand. |
#define sbgMin | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
Returns the minimum between a and b
[in] | a | First operand. |
[in] | b | Second operand. |
#define sbgClamp | ( | value, | |
minValue, | |||
maxValue | |||
) | (((value) < (minValue))?(minValue): ((value) > (maxValue)?maxValue:value)) |
Clamp a value between minValue and maxValue ie minValue <= value <= maxValue
[in] | value | First operand. |
[in] | minValue | First operand. |
[in] | maxValue | Second operand. |
#define sbgDivCeil | ( | n, | |
d | |||
) | (((n) + (d) - 1) / (d)) |
Integer division with a result rounded up.
[in] | n | Dividend. |
[in] | d | Divisor. |
SBG_INLINE double sbgRadToDegd | ( | double | angle | ) |
Convert an angle from radians to degrees using double precision.
[in] | angle | The angle to convert in radians. |
SBG_INLINE double sbgDegToRadd | ( | double | angle | ) |
Convert an angle from degrees to radians using double precision.
[in] | angle | The angle to convert in degrees. |
SBG_INLINE float sbgRadToDegf | ( | float | angle | ) |
Convert an angle from radians to degrees using single (float) precision.
[in] | angle | The angle to convert in radians. |
SBG_INLINE float sbgDegToRadf | ( | float | angle | ) |
Convert an angle from degrees to radians using single (float) precision.
[in] | angle | The angle to convert in degrees. |
SBG_INLINE bool sbgAlmostEqualsFloat | ( | float | leftValue, |
float | rightValue | ||
) |
Test if two floating single-point numbers are equals or not.
[in] | leftValue | The first operand to test for equality. |
[in] | rightValue | The second operand to test for equality. |
SBG_INLINE bool sbgAlmostEqualsDouble | ( | double | leftValue, |
double | rightValue | ||
) |
Test if two floating double-point numbers are equals or not using the epsilon technique
[in] | leftValue | The first operand to test for equality. |
[in] | rightValue | The second operand to test for equality. |