Larus glider flight sensor system 3.9.2024
Software-In-The-Loop test and validation system
Loading...
Searching...
No Matches
embedded_math.h File Reference

defines platform-dependent algorithms and constants More...

#include "math.h"
#include "stdint.h"
#include "float.h"
#include "assert.h"

Go to the source code of this file.

Macros

#define TARGET_MACHINE   PC
 
#define ftype   float
 
#define ZERO   0.0f
 
#define ONE   1.0f
 
#define TWO   2.0f
 
#define HALF   0.5f
 
#define QUARTER   0.25f
 
#define M_PI_F   M_PI
 
#define SQR(x)   ((x)*(x))
 
#define SQRT(x)   sqrtf(x)
 
#define COS(x)   cosf(x)
 
#define SIN(x)   sinf(x)
 
#define ASIN(x)   asinf(x)
 
#define ATAN2(y, x)   atan2f(y, x)
 

Typedefs

typedef float float32_t
 

Functions

charitoa (int value, char *result, int base=10)
 
template<typename type >
type CLIP (type x, type min, type max)
 

Detailed Description

defines platform-dependent algorithms and constants

Author
Dr. Klaus Schaefer

<Larus Flight Sensor Firmware>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file embedded_math.h.

Macro Definition Documentation

◆ ASIN

#define ASIN (   x)    asinf(x)

Definition at line 60 of file embedded_math.h.

◆ ATAN2

#define ATAN2 (   y,
 
)    atan2f(y, x)

Definition at line 61 of file embedded_math.h.

◆ COS

#define COS (   x)    cosf(x)

Definition at line 58 of file embedded_math.h.

◆ ftype

#define ftype   float

Definition at line 46 of file embedded_math.h.

◆ HALF

#define HALF   0.5f

Definition at line 52 of file embedded_math.h.

◆ M_PI_F

#define M_PI_F   M_PI

Definition at line 54 of file embedded_math.h.

◆ ONE

#define ONE   1.0f

Definition at line 50 of file embedded_math.h.

◆ QUARTER

#define QUARTER   0.25f

Definition at line 53 of file embedded_math.h.

◆ SIN

#define SIN (   x)    sinf(x)

Definition at line 59 of file embedded_math.h.

◆ SQR

#define SQR (   x)    ((x)*(x))

Definition at line 56 of file embedded_math.h.

◆ SQRT

#define SQRT (   x)    sqrtf(x)

Definition at line 57 of file embedded_math.h.

◆ TARGET_MACHINE

#define TARGET_MACHINE   PC

Definition at line 44 of file embedded_math.h.

◆ TWO

#define TWO   2.0f

Definition at line 51 of file embedded_math.h.

◆ ZERO

#define ZERO   0.0f

Definition at line 49 of file embedded_math.h.

Typedef Documentation

◆ float32_t

Definition at line 47 of file embedded_math.h.

Function Documentation

◆ CLIP()

template<typename type >
type CLIP ( type  x,
type  min,
type  max 
)

Definition at line 63 of file embedded_math.h.

Referenced by navigator_t::set_density_data().

◆ itoa()

char * itoa ( int  value,
char result,
int  base = 10 
)

Definition at line 32 of file ascii_support.cpp.

Referenced by serial_output::puti().