forked from thomast777/grbl32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathg32core.h
91 lines (74 loc) · 2.39 KB
/
g32core.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
g32core.h - Header file for shared definitions, variables, and functions
Part of Grbl32
Copyright (c) 2018-2019 Thomas Truong
Grbl 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.
Grbl 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 Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef G32CORE_H_
#define G32CORE_H_
#define false 0
#define true 1
// Axis array index values. Must start with 0 and be continuous.
#ifdef STM32
#include "float.h"
#define SOME_LARGE_VALUE FLT_MAX
//-- number of axes
#if ( defined (STM32F1_3) || defined(STM32F4_3) )
#define N_AXIS 3
#endif
#if ( defined (STM32F1_4) || defined(STM32F4_4) )
#define N_AXIS 4 // Number of axes
#endif
#if ( defined (STM32F1_5) || defined(STM32F4_5) )
#define N_AXIS 5 // Number of axes
#endif
#if ( defined (STM32F1_6) || defined(STM32F4_6) )
#define N_AXIS 6 // Number of axes
#endif
#ifdef STM32F4
#define N_OUTPUTS_DIG 8 // Number of digital outputs
#define N_INPUTS_DIG 8 // Number of digital inputs
#define N_OUTPUTS_ANA 8 // Number of analog outputs (PWM)
#endif
#ifdef STM32F1
#ifdef STM32F13
#define N_OUTPUTS_DIG 4 // Number of digital outputs
#define N_OUTPUTS_ANA 0 // Number of analog outputs (PWM)
#endif
#ifdef STM32F16
#define N_OUTPUTS_DIG 1 // Number of digital outputs
#define N_OUTPUTS_ANA 0 // Number of analog outputs (PWM)
#endif
#endif
#else //-- not STM32
#define N_AXIS 3 // Number of axes
#define SOME_LARGE_VALUE 1.0E+38
#endif
#define X_AXIS 0 // Axis indexing value.
#define Y_AXIS 1
#define Z_AXIS 2
#ifdef STM32
#if ( defined(STM32F1_4) || defined(STM32F4_4) )
#define A_AXIS 3
#endif
#if ( defined(STM32F1_5) || defined(STM32F4_5) )
#define A_AXIS 3
#define B_AXIS 4
#endif
#if ( defined(STM32F1_6) || defined(STM32F4_6) )
#define A_AXIS 3
#define B_AXIS 4
#define C_AXIS 5
#endif
#endif
#define PIN_MASK uint16_t
#endif /* G6CORE_H_ */