Prusa MINI Firmware overview
types.h File Reference
#include <math.h>
#include <stddef.h>
#include "millis_t.h"

Go to the source code of this file.

Classes

struct  IF< bool, L, R >
 
struct  IF< true, L, R >
 
struct  XYval< T >
 
struct  XYZval< T >
 
struct  XYZEval< T >
 
struct  XYval< T >
 
struct  XYZval< T >
 
struct  XYZEval< T >
 

Macros

#define LOOP_S_LE_N(VAR, S, N)   for (uint8_t VAR=(S); VAR<=(N); VAR++)
 
#define LOOP_S_L_N(VAR, S, N)   for (uint8_t VAR=(S); VAR<(N); VAR++)
 
#define LOOP_LE_N(VAR, N)   LOOP_S_LE_N(VAR, 0, N)
 
#define LOOP_L_N(VAR, N)   LOOP_S_L_N(VAR, 0, N)
 
#define LOOP_XYZ(VAR)   LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS)
 
#define LOOP_XYZE(VAR)   LOOP_S_LE_N(VAR, X_AXIS, E_AXIS)
 
#define LOOP_XYZE_N(VAR)   LOOP_S_L_N(VAR, X_AXIS, XYZE_N)
 
#define LOOP_ABC(VAR)   LOOP_S_LE_N(VAR, A_AXIS, C_AXIS)
 
#define LOOP_ABCE(VAR)   LOOP_S_LE_N(VAR, A_AXIS, E_AXIS)
 
#define LOOP_ABCE_N(VAR)   LOOP_S_L_N(VAR, A_AXIS, XYZE_N)
 
#define MMM_TO_MMS(MM_M)   feedRate_t(float(MM_M) / 60.0f)
 
#define MMS_TO_MMM(MM_S)   (float(MM_S) * 60.0f)
 
#define MMS_SCALED(V)   ((V) * 0.01f * feedrate_percentage)
 
#define _RECIP(N)   ((N) ? 1.0f / float(N) : 0.0f)
 
#define _ABS(N)   ((N) < 0 ? -(N) : (N))
 
#define _LS(N)   (N = (T)(uint32_t(N) << v))
 
#define _RS(N)   (N = (T)(uint32_t(N) >> v))
 
#define FI   FORCE_INLINE
 

Typedefs

typedef float feedRate_t
 
typedef struct XYval< bool > xy_bool_t
 
typedef struct XYZval< bool > xyz_bool_t
 
typedef struct XYZEval< bool > xyze_bool_t
 
typedef struct XYval< char > xy_char_t
 
typedef struct XYZval< char > xyz_char_t
 
typedef struct XYZEval< char > xyze_char_t
 
typedef struct XYval< unsigned char > xy_uchar_t
 
typedef struct XYZval< unsigned char > xyz_uchar_t
 
typedef struct XYZEval< unsigned char > xyze_uchar_t
 
typedef struct XYval< int8_t > xy_int8_t
 
typedef struct XYZval< int8_t > xyz_int8_t
 
typedef struct XYZEval< int8_t > xyze_int8_t
 
typedef struct XYval< uint8_txy_uint8_t
 
typedef struct XYZval< uint8_txyz_uint8_t
 
typedef struct XYZEval< uint8_txyze_uint8_t
 
typedef struct XYval< int16_t > xy_int_t
 
typedef struct XYZval< int16_t > xyz_int_t
 
typedef struct XYZEval< int16_t > xyze_int_t
 
typedef struct XYval< uint16_t > xy_uint_t
 
typedef struct XYZval< uint16_t > xyz_uint_t
 
typedef struct XYZEval< uint16_t > xyze_uint_t
 
typedef struct XYval< int32_t > xy_long_t
 
typedef struct XYZval< int32_t > xyz_long_t
 
typedef struct XYZEval< int32_t > xyze_long_t
 
typedef struct XYval< uint32_t > xy_ulong_t
 
typedef struct XYZval< uint32_t > xyz_ulong_t
 
typedef struct XYZEval< uint32_t > xyze_ulong_t
 
typedef struct XYZval< volatile int32_t > xyz_vlong_t
 
typedef struct XYZEval< volatile int32_t > xyze_vlong_t
 
typedef struct XYval< float > xy_float_t
 
typedef struct XYZval< float > xyz_float_t
 
typedef struct XYZEval< float > xyze_float_t
 
typedef struct XYval< feedRate_txy_feedrate_t
 
typedef struct XYZval< feedRate_txyz_feedrate_t
 
typedef struct XYZEval< feedRate_txyze_feedrate_t
 
typedef xy_uint8_t xy_byte_t
 
typedef xyz_uint8_t xyz_byte_t
 
typedef xyze_uint8_t xyze_byte_t
 
typedef xyz_long_t abc_long_t
 
typedef xyze_long_t abce_long_t
 
typedef xyz_ulong_t abc_ulong_t
 
typedef xyze_ulong_t abce_ulong_t
 
typedef xy_float_t xy_pos_t
 
typedef xyz_float_t xyz_pos_t
 
typedef xyze_float_t xyze_pos_t
 
typedef xy_float_t ab_float_t
 
typedef xyz_float_t abc_float_t
 
typedef xyze_float_t abce_float_t
 
typedef ab_float_t ab_pos_t
 
typedef abc_float_t abc_pos_t
 
typedef abce_float_t abce_pos_t
 

Enumerations

enum  AxisEnum : uint8_t {
  X_AXIS = 0, A_AXIS = 0, Y_AXIS = 1, B_AXIS = 1,
  Z_AXIS = 2, C_AXIS = 2, E_AXIS = 3, X_HEAD = 4,
  Y_HEAD = 5, Z_HEAD = 6, E0_AXIS = 3, E1_AXIS = 4,
  E2_AXIS = 5, E3_AXIS = 6, E4_AXIS = 7, E5_AXIS = 8,
  ALL_AXES = 0xFE, NO_AXIS = 0xFF
}
 

Functions

void toLogical (xy_pos_t &raw)
 
void toLogical (xyz_pos_t &raw)
 
void toLogical (xyze_pos_t &raw)
 
void toNative (xy_pos_t &raw)
 
void toNative (xyz_pos_t &raw)
 
void toNative (xyze_pos_t &raw)
 

Variables

const xyze_char_t axis_codes { 'X', 'Y', 'Z', 'E' }
 

Macro Definition Documentation

◆ LOOP_S_LE_N

#define LOOP_S_LE_N (   VAR,
  S,
 
)    for (uint8_t VAR=(S); VAR<=(N); VAR++)

◆ LOOP_S_L_N

#define LOOP_S_L_N (   VAR,
  S,
 
)    for (uint8_t VAR=(S); VAR<(N); VAR++)

◆ LOOP_LE_N

#define LOOP_LE_N (   VAR,
 
)    LOOP_S_LE_N(VAR, 0, N)

◆ LOOP_L_N

#define LOOP_L_N (   VAR,
 
)    LOOP_S_L_N(VAR, 0, N)

◆ LOOP_XYZ

#define LOOP_XYZ (   VAR)    LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS)

◆ LOOP_XYZE

#define LOOP_XYZE (   VAR)    LOOP_S_LE_N(VAR, X_AXIS, E_AXIS)

◆ LOOP_XYZE_N

#define LOOP_XYZE_N (   VAR)    LOOP_S_L_N(VAR, X_AXIS, XYZE_N)

◆ LOOP_ABC

#define LOOP_ABC (   VAR)    LOOP_S_LE_N(VAR, A_AXIS, C_AXIS)

◆ LOOP_ABCE

#define LOOP_ABCE (   VAR)    LOOP_S_LE_N(VAR, A_AXIS, E_AXIS)

◆ LOOP_ABCE_N

#define LOOP_ABCE_N (   VAR)    LOOP_S_L_N(VAR, A_AXIS, XYZE_N)

◆ MMM_TO_MMS

#define MMM_TO_MMS (   MM_M)    feedRate_t(float(MM_M) / 60.0f)

◆ MMS_TO_MMM

#define MMS_TO_MMM (   MM_S)    (float(MM_S) * 60.0f)

◆ MMS_SCALED

#define MMS_SCALED (   V)    ((V) * 0.01f * feedrate_percentage)

◆ _RECIP

#define _RECIP (   N)    ((N) ? 1.0f / float(N) : 0.0f)

◆ _ABS

#define _ABS (   N)    ((N) < 0 ? -(N) : (N))

◆ _LS

#define _LS (   N)    (N = (T)(uint32_t(N) << v))

◆ _RS

#define _RS (   N)    (N = (T)(uint32_t(N) >> v))

◆ FI

#define FI   FORCE_INLINE

Typedef Documentation

◆ feedRate_t

typedef float feedRate_t

◆ xy_bool_t

typedef struct XYval< bool > xy_bool_t

◆ xyz_bool_t

typedef struct XYZval< bool > xyz_bool_t

◆ xyze_bool_t

typedef struct XYZEval< bool > xyze_bool_t

◆ xy_char_t

typedef struct XYval< char > xy_char_t

◆ xyz_char_t

typedef struct XYZval< char > xyz_char_t

◆ xyze_char_t

typedef struct XYZEval< char > xyze_char_t

◆ xy_uchar_t

typedef struct XYval< unsigned char > xy_uchar_t

◆ xyz_uchar_t

typedef struct XYZval< unsigned char > xyz_uchar_t

◆ xyze_uchar_t

typedef struct XYZEval< unsigned char > xyze_uchar_t

◆ xy_int8_t

typedef struct XYval< int8_t > xy_int8_t

◆ xyz_int8_t

typedef struct XYZval< int8_t > xyz_int8_t

◆ xyze_int8_t

typedef struct XYZEval< int8_t > xyze_int8_t

◆ xy_uint8_t

typedef struct XYval< uint8_t > xy_uint8_t

◆ xyz_uint8_t

typedef struct XYZval< uint8_t > xyz_uint8_t

◆ xyze_uint8_t

typedef struct XYZEval< uint8_t > xyze_uint8_t

◆ xy_int_t

typedef struct XYval< int16_t > xy_int_t

◆ xyz_int_t

typedef struct XYZval< int16_t > xyz_int_t

◆ xyze_int_t

typedef struct XYZEval< int16_t > xyze_int_t

◆ xy_uint_t

typedef struct XYval< uint16_t > xy_uint_t

◆ xyz_uint_t

typedef struct XYZval< uint16_t > xyz_uint_t

◆ xyze_uint_t

typedef struct XYZEval< uint16_t > xyze_uint_t

◆ xy_long_t

typedef struct XYval< int32_t > xy_long_t

◆ xyz_long_t

typedef struct XYZval< int32_t > xyz_long_t

◆ xyze_long_t

typedef struct XYZEval< int32_t > xyze_long_t

◆ xy_ulong_t

typedef struct XYval< uint32_t > xy_ulong_t

◆ xyz_ulong_t

typedef struct XYZval< uint32_t > xyz_ulong_t

◆ xyze_ulong_t

typedef struct XYZEval< uint32_t > xyze_ulong_t

◆ xyz_vlong_t

typedef struct XYZval< volatile int32_t > xyz_vlong_t

◆ xyze_vlong_t

typedef struct XYZEval< volatile int32_t > xyze_vlong_t

◆ xy_float_t

typedef struct XYval< float > xy_float_t

◆ xyz_float_t

typedef struct XYZval< float > xyz_float_t

◆ xyze_float_t

typedef struct XYZEval< float > xyze_float_t

◆ xy_feedrate_t

typedef struct XYval< feedRate_t > xy_feedrate_t

◆ xyz_feedrate_t

typedef struct XYZval< feedRate_t > xyz_feedrate_t

◆ xyze_feedrate_t

typedef struct XYZEval< feedRate_t > xyze_feedrate_t

◆ xy_byte_t

◆ xyz_byte_t

◆ xyze_byte_t

◆ abc_long_t

◆ abce_long_t

◆ abc_ulong_t

◆ abce_ulong_t

◆ xy_pos_t

◆ xyz_pos_t

◆ xyze_pos_t

◆ ab_float_t

◆ abc_float_t

◆ abce_float_t

◆ ab_pos_t

◆ abc_pos_t

◆ abce_pos_t

Enumeration Type Documentation

◆ AxisEnum

enum AxisEnum : uint8_t

Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]

Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm

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/.

Enumerator
X_AXIS 
A_AXIS 
Y_AXIS 
B_AXIS 
Z_AXIS 
C_AXIS 
E_AXIS 
X_HEAD 
Y_HEAD 
Z_HEAD 
E0_AXIS 
E1_AXIS 
E2_AXIS 
E3_AXIS 
E4_AXIS 
E5_AXIS 
ALL_AXES 
NO_AXIS 
36  : uint8_t {
37  X_AXIS = 0, A_AXIS = 0,
38  Y_AXIS = 1, B_AXIS = 1,
39  Z_AXIS = 2, C_AXIS = 2,
40  E_AXIS = 3,
41  X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 6,
42  E0_AXIS = 3,
43  E1_AXIS = 4,
44  E2_AXIS = 5,
45  E3_AXIS = 6,
46  E4_AXIS = 7,
47  E5_AXIS = 8,
48  ALL_AXES = 0xFE, NO_AXIS = 0xFF
49 };

Function Documentation

◆ toLogical() [1/3]

void toLogical ( xy_pos_t raw)
271 {}
Here is the caller graph for this function:

◆ toLogical() [2/3]

void toLogical ( xyz_pos_t raw)
272 {}

◆ toLogical() [3/3]

void toLogical ( xyze_pos_t raw)
273 {}

◆ toNative() [1/3]

void toNative ( xy_pos_t raw)
274 {}
Here is the caller graph for this function:

◆ toNative() [2/3]

void toNative ( xyz_pos_t raw)
275 {}

◆ toNative() [3/3]

void toNative ( xyze_pos_t raw)
276 {}

Variable Documentation

◆ axis_codes

const xyze_char_t axis_codes { 'X', 'Y', 'Z', 'E' }
E3_AXIS
Definition: types.h:45
E2_AXIS
Definition: types.h:44
NO_AXIS
Definition: types.h:48
X_AXIS
Definition: types.h:37
E1_AXIS
Definition: types.h:43
C_AXIS
Definition: types.h:39
E4_AXIS
Definition: types.h:46
X_HEAD
Definition: types.h:41
ALL_AXES
Definition: types.h:48
Y_HEAD
Definition: types.h:41
uint8_t
const uint8_t[]
Definition: 404_html.c:3
Y_AXIS
Definition: types.h:38
Z_AXIS
Definition: types.h:39
A_AXIS
Definition: types.h:37
E5_AXIS
Definition: types.h:47
E_AXIS
Definition: types.h:40
B_AXIS
Definition: types.h:38
Z_HEAD
Definition: types.h:41
E0_AXIS
Definition: types.h:42