grblHAL core  20241107
platform.h
Go to the documentation of this file.
1 /*
2  platform.h - platform specific definitions
3 
4  Part of grblHAL
5 
6  Copyright (c) 2021-2024 Terje Io
7 
8  grblHAL is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  grblHAL is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #pragma once
23 
24 #if defined(STM32F103xB) || defined(STM32F103xE)
25 #define STM32_F1_PLATFORM
26 #endif
27 
28 #if defined(STM32F303xC)
29 #define STM32_F3_PLATFORM
30 #endif
31 
32 #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F407xx) || defined(STM32F411xE) || \
33  defined(STM32F412Vx) || defined(STM32F446xx)
34 #define STM32_F4_PLATFORM
35 #endif
36 
37 #if defined(STM32F756xx) || defined(STM32F765xx)
38 #define STM32_F7_PLATFORM
39 #endif
40 
41 #if defined(STM32H743xx) || defined(STM32H723xx)
42 #define STM32_H7_PLATFORM
43 #endif
44 
45 #if defined(STM32_F1_PLATFORM) || defined(STM32_F3_PLATFORM) || defined(STM32_F4_PLATFORM) || defined(STM32_F7_PLATFORM) || defined(STM32_H7_PLATFORM)
46 #define STM32_PLATFORM
47 #endif
48 
49 #if defined(STM32_PLATFORM) || defined(__LPC17XX__) || defined(__IMXRT1062__)
50 #define UINT32FMT "%lu"
51 #define UINT32SFMT "lu"
52 #else
53 #define UINT32FMT "%u"
54 #define UINT32SFMT "u"
55 #endif