Skip to content

Commit b1378c1

Browse files
committed
[cfg] Add config for Adafruit 2.8" TFT Touch Shield v2 (Capacitive)
1 parent 37b4af1 commit b1378c1

File tree

2 files changed

+58
-22
lines changed

2 files changed

+58
-22
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=RT-Thread
2-
version=0.7.3
2+
version=0.7.4
33
author=onelife <[email protected]>, Bernard Xiong <[email protected]>
44
maintainer=onelife <[email protected]>
55
sentence=Real Time Operating System porting for Arduino SAM and SAMD boards

src/rtconfig.h

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,45 @@
66
#ifndef __RTCONFIG_H__
77
#define __RTCONFIG_H__
88

9+
10+
/* Hardware Options */
11+
/* Adafruit 2.8" TFT Touch Shield v2 (Capacitive) */
12+
#ifdef CONFIG_USING_ADAFRUIT_TFT_CAPACITIVE
13+
# ifdef ARDUINO_SAM_DUE
14+
# define CONFIG_USING_SPI0 (1)
15+
# define CONFIG_USING_IIC1 (1)
16+
17+
# define CONFIG_USING_MODULE (1)
18+
# define CONFIG_USING_SPISD (1)
19+
# define CONFIG_SD_CS_PIN (4)
20+
# define CONFIG_SD_SPI_CHANNEL 0
21+
22+
# define CONFIG_USING_ILI (1)
23+
# define CONFIG_ILI_CS_PIN (10)
24+
# define CONFIG_ILI_DC_PIN (9)
25+
# define CONFIG_ILI_SPI_CHANNEL 0
26+
27+
# define CONFIG_USING_FT6206 (1)
28+
# define CONFIG_FT6206_INT_PIN 7
29+
# define CONFIG_FT6206_IIC_CHANNEL 1
30+
31+
# define CONFIG_USING_GUI (1)
32+
# define CONFIG_GUI_WIDTH (240)
33+
# define CONFIG_GUI_HIGH (320)
34+
# else
35+
# error "Not implement yet!"
36+
# endif /* ARDUINO_SAM_DUE */
37+
#endif /* CONFIG_USING_ADAFRUIT_TFT_CAPACITIVE */
38+
39+
#ifdef ARDUINO_SAMD_MKRZERO
40+
# define CONFIG_USING_SPI1 (1)
41+
42+
# define CONFIG_USING_SPISD (1)
43+
# define CONFIG_SD_CS_PIN (SDCARD_SS_PIN)
44+
# define CONFIG_SD_SPI_CHANNEL 1 /* (1) is wrong -_-! */
45+
#endif /* ARDUINO_SAMD_MKRZERO */
46+
47+
948
/* Porting Options */
1049
#define CONFIG_ARDUINO
1150

@@ -56,7 +95,7 @@
5695
#endif
5796

5897
#ifndef CONFIG_USING_SPISD
59-
# define CONFIG_USING_SPISD (ARDUINO_ARCH_SAMD)
98+
# define CONFIG_USING_SPISD (0)
6099
#endif
61100

62101
#ifndef CONFIG_USING_ILI
@@ -95,30 +134,15 @@
95134
#endif /* CONFIG_USING_MODULE */
96135

97136
#if (CONFIG_USING_SPISD)
98-
# ifdef ARDUINO_SAMD_MKRZERO
99-
# define CONFIG_USING_SPI1 (1)
100-
# endif /* ARDUINO_SAMD_MKRZERO */
101-
102137
# ifndef CONFIG_SD_CS_PIN
103-
# ifdef ARDUINO_SAMD_MKRZERO
104-
# define CONFIG_SD_CS_PIN (SDCARD_SS_PIN)
105-
# else
106-
# error "Please define CONFIG_SD_CS_PIN!"
107-
# endif /* ARDUINO_SAMD_MKRZERO */
108-
# endif /* CONFIG_SD_CS_PIN */
109-
110-
# ifndef CONFIG_SD_SPI_CHANNEL
111-
# ifdef ARDUINO_SAMD_MKRZERO
112-
# define CONFIG_SD_SPI_CHANNEL 1 /* (1) is wrong -_-! */
113-
# endif /* ARDUINO_SAMD_MKRZERO */
114-
# endif /* CONFIG_SD_SPI_CHANNEL */
115-
138+
# error "Please define CONFIG_SD_CS_PIN!"
139+
# endif
116140
# if (!defined(CONFIG_USING_SPI0) && !defined(CONFIG_USING_SPI1))
117141
# error "Please define CONFIG_USING_SPIx!"
118-
# endif /* (!defined(CONFIG_USING_SPI0) && !defined(CONFIG_USING_SPI1)) */
142+
# endif
119143
# ifndef CONFIG_SD_SPI_CHANNEL
120144
# error "Please define CONFIG_SD_SPI_CHANNEL!"
121-
# endif /* CONFIG_SD_SPI_CHANNEL */
145+
# endif
122146
#endif /* CONFIG_USING_SPISD */
123147

124148
#if (CONFIG_USING_ILI)
@@ -169,6 +193,7 @@
169193
# define RT_USING_ALARM
170194
#endif
171195

196+
172197
/* Debug Options */
173198
// #define RT_DEBUG
174199
// #define RT_USING_OVERFLOW_CHECK
@@ -180,12 +205,14 @@
180205
// #define RT_DEBUG_TIMER (1)
181206
// #define RT_DEBUG_THREAD (1)
182207

208+
183209
/* System Options */
184210
#define RT_NAME_MAX (16)
185211
#define RT_ALIGN_SIZE (4)
186212
#define RT_THREAD_PRIORITY_MAX (32)
187213
#define RT_TICK_PER_SECOND (100)
188214

215+
189216
/* Arduino Thread Options */
190217
#ifndef CONFIG_ARDUINO_STACK_SIZE
191218
# define CONFIG_ARDUINO_STACK_SIZE (4 * 1024)
@@ -197,11 +224,13 @@
197224
# define CONFIG_ARDUINO_TICK (16)
198225
#endif
199226

227+
200228
/* Timer Options */
201229
// #define RT_USING_TIMER_SOFT
202230
// #define RT_TIMER_THREAD_PRIO (4)
203231
// #define RT_TIMER_THREAD_STACK_SIZE (512)
204232

233+
205234
/* Utility Options */
206235
#define RT_USING_DEVICE /* Required by IPC, DRV */
207236
#define RT_USING_SEMAPHORE /* Required by FINSH */
@@ -213,18 +242,21 @@
213242
// #define RT_USING_HOOK
214243
// #define RT_USING_IDLE_HOOK
215244

245+
216246
/* Memory Management Options */
217247
#define RT_USING_MEMPOOL /* Required by SIG, GUI */
218248
// #define RT_USING_MEMHEAP
219249
#define RT_USING_HEAP
220250
#define RT_USING_SMALL_MEM
221251

252+
222253
/* Console Options */
223254
#if (CONFIG_USING_CONSOLE)
224255
# define RT_USING_CONSOLE
225256
# define RT_CONSOLEBUF_SIZE (128)
226257
#endif /* CONFIG_USING_CONSOLE */
227258

259+
228260
/* FinSH Options */
229261
#if (CONFIG_USING_FINSH)
230262
#define RT_USING_FINSH
@@ -236,9 +268,9 @@
236268
#define FINSH_USING_HISTORY
237269
#define FINSH_THREAD_PRIORITY (20)
238270
#define FINSH_THREAD_STACK_SIZE (4 * 1024)
239-
// # define FINSH_USING_SYMTAB /* Not supported as no access to linker script */
240271
#endif /* CONFIG_USING_FINSH */
241272

273+
242274
/* DFS Options */
243275
#if (CONFIG_USING_SPISD)
244276
# define RT_USING_DFS
@@ -256,7 +288,11 @@
256288
# endif /* defined(RT_DFS_ELM_USE_EXFAT) || (RT_DFS_ELM_CODE_PAGE >= 900) */
257289
#endif /* CONFIG_USING_SPISD */
258290

291+
259292
/* Unsupported Options */
293+
#ifdef FINSH_USING_SYMTAB
294+
# undef FINSH_USING_SYMTAB /* Reason: no access to linker script */
295+
#endif
260296
#ifdef RT_USING_COMPONENTS_INIT
261297
# undef RT_USING_COMPONENTS_INIT /* Reason: no access to linker script */
262298
#endif

0 commit comments

Comments
 (0)