Bump clang version to 18 (#14116)
[betaflight.git] / src / test / unit / platform.h
blobf5b7c63a568f258dafbd346791308238d278fc31
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #include <stdio.h>
21 #include <stdint.h>
23 #define USE_PARAMETER_GROUPS
25 #define IOCFG_OUT_PP 0
26 #define IOCFG_OUT_OD 0
27 #define IOCFG_AF_PP 0
28 #define IOCFG_AF_OD 0
29 #define IOCFG_IPD 0
30 #define IOCFG_IPU 0
31 #define IOCFG_IN_FLOATING 0
33 #define U_ID_0 0
34 #define U_ID_1 1
35 #define U_ID_2 2
37 #define NOINLINE
38 #define FAST_CODE
39 #define FAST_CODE_NOINLINE
40 #define FAST_CODE_PREF
41 #define FAST_DATA_ZERO_INIT
42 #define FAST_DATA
45 #define PID_PROFILE_COUNT 4
46 #define CONTROL_RATE_PROFILE_COUNT 4
47 #define USE_MAG
48 #define USE_BARO
49 #define USE_GPS
50 #define USE_DASHBOARD
51 #define USE_TELEMETRY
52 #define USE_LED_STRIP
53 #define USE_SERVOS
54 #define USE_TRANSPONDER
56 #ifndef LED_STRIP_MAX_LENGTH
57 #ifdef USE_LED_STRIP_64
58 #define LED_STRIP_MAX_LENGTH 64
59 #else
60 #define LED_STRIP_MAX_LENGTH 32
61 #endif
62 #endif // #ifndef LED_STRIP_MAX_LENGTH
64 typedef enum
66 Mode_TEST = 0x0,
67 Mode_Out_PP = 0x10
68 } GPIO_Mode;
70 typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
71 typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
72 typedef enum {TEST_IRQ = 0 } IRQn_Type;
73 typedef enum {
74 EXTI_Trigger_Rising = 0x08,
75 EXTI_Trigger_Falling = 0x0C,
76 EXTI_Trigger_Rising_Falling = 0x10
77 } EXTITrigger_TypeDef;
79 typedef struct
81 void *test;
82 } GPIO_TypeDef;
84 typedef struct
86 void* test;
87 } TIM_TypeDef;
89 typedef struct
91 void* test;
92 } TIM_OCInitTypeDef;
94 typedef struct {
95 void* test;
96 } DMA_TypeDef;
98 typedef struct {
99 void* test;
100 } DMA_Channel_TypeDef;
102 uint8_t DMA_GetFlagStatus(void *);
103 void DMA_Cmd(DMA_Channel_TypeDef*, FunctionalState );
104 void DMA_ClearFlag(uint32_t);
106 typedef struct
108 void* test;
109 } SPI_TypeDef;
111 typedef struct
113 void* test;
114 } USART_TypeDef;
116 typedef struct
118 void *test;
119 } I2C_TypeDef;
121 typedef struct
123 void* test;
124 } ADC_TypeDef;
126 #define WS2811_DMA_TC_FLAG (void *)1
127 #define WS2811_DMA_HANDLER_IDENTIFER 0
128 #define NVIC_PriorityGroup_2 0x500
130 #define MCU_TYPE_ID 99
131 #define MCU_TYPE_NAME "UNIT_TEST"
133 #include "target.h"
135 #include "target/common_defaults_post.h"