@@ -0,0 +1,18 | |||||
|
1 | TEMPLATE = lib | |||
|
2 | ||||
|
3 | TARGET=bsp | |||
|
4 | OBJECTS_DIR = obj | |||
|
5 | ||||
|
6 | BSP=STM32F4Discovery-ILI9328-8bits | |||
|
7 | ||||
|
8 | UCMODEL=stm32f4 | |||
|
9 | ||||
|
10 | SOURCES += bsp.c | |||
|
11 | ||||
|
12 | HEADERS += bsp.h | |||
|
13 | ||||
|
14 | ||||
|
15 | BSPFILE = bsp.pri | |||
|
16 | ||||
|
17 | ||||
|
18 |
@@ -0,0 +1,378 | |||||
|
1 | /*------------------------------------------------------------------------------ | |||
|
2 | -- This file is a part of the libuc, microcontroler library | |||
|
3 | -- Copyright (C) 2011, Alexis Jeandet | |||
|
4 | -- | |||
|
5 | -- This program is free software; you can redistribute it and/or modify | |||
|
6 | -- it under the terms of the GNU General Public License as published by | |||
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |||
|
8 | -- (at your option) any later version. | |||
|
9 | -- | |||
|
10 | -- This program is distributed in the hope that it will be useful, | |||
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
13 | -- GNU General Public License for more details. | |||
|
14 | -- | |||
|
15 | -- You should have received a copy of the GNU General Public License | |||
|
16 | -- along with this program; if not, write to the Free Software | |||
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
|
18 | ------------------------------------------------------------------------------- | |||
|
19 | -- Author : Alexis Jeandet | |||
|
20 | -- Mail : alexis.jeandet@member.fsf.org | |||
|
21 | -------------------------------------------------------------------------------*/ | |||
|
22 | #include "bsp.h" | |||
|
23 | #include <streamdevices.h> | |||
|
24 | #include <malloc.h> | |||
|
25 | #include <gpio.h> | |||
|
26 | #include <uart.h> | |||
|
27 | #include <stdio.h> | |||
|
28 | #include <ili9328.h> | |||
|
29 | #include <genericLCD_Controler.h> | |||
|
30 | #include <stm32f4xx.h> | |||
|
31 | #include <stm32f4xx_gpio.h> | |||
|
32 | #include <stm32f4xx_rcc.h> | |||
|
33 | #include <stm32f4xx_gpio.h> | |||
|
34 | #include <stm32f4xx_fsmc.h> | |||
|
35 | #include <terminal.h> | |||
|
36 | uint32_t OSC0 =8000000; | |||
|
37 | uint32_t INTOSC =16000000; | |||
|
38 | uint32_t RTCOSC =32768; | |||
|
39 | uint32_t currentCpuFreq=0; | |||
|
40 | extern streamdevice* __opnfiles__[__MAX_OPENED_FILES__]; | |||
|
41 | ||||
|
42 | volatile uint8_t* lcd0_CMD=(volatile uint8_t*)0x60000000; | |||
|
43 | volatile uint8_t* lcd0_DATA=(volatile uint8_t*)0x61FFFFF0; | |||
|
44 | terminal_t terminal0; | |||
|
45 | volatile vs10XXDev audioCodec0; | |||
|
46 | sdcardDev sdcard2; | |||
|
47 | blkdevice sdcard2blkdev; | |||
|
48 | dikpartition sdcard2Part1; | |||
|
49 | FAT32fs sdcard2FAT32part1; | |||
|
50 | dikpartition sdcard2Part2; | |||
|
51 | FAT32fs sdcard2FAT32part2; | |||
|
52 | dikpartition sdcard2Part3; | |||
|
53 | FAT32fs sdcard2FAT32part3; | |||
|
54 | dikpartition sdcard2Part4; | |||
|
55 | FAT32fs sdcard2FAT32part4; | |||
|
56 | ||||
|
57 | LCD_IF_t lcdIF0={ | |||
|
58 | .init = &bsp_FSMC_init, | |||
|
59 | .writereg = &bsp_lcd0_write_reg, | |||
|
60 | .readreg = &bsp_lcd0_read_reg, | |||
|
61 | .writeGRAM = &bsp_lcd0_writeGRAM, | |||
|
62 | .readGRAM = &bsp_lcd0_readGRAM | |||
|
63 | }; | |||
|
64 | ||||
|
65 | LCD_t lcd0={ | |||
|
66 | .interface = &lcdIF0, | |||
|
67 | .init = &ili9328init, | |||
|
68 | .paint = &ili9328paint, | |||
|
69 | .paintText = &ili9328paintText, | |||
|
70 | .paintFilRect = &ili9328paintFilRect, | |||
|
71 | .refreshenable = &ili9328refreshenable, | |||
|
72 | .width= 240, | |||
|
73 | .height = 320 | |||
|
74 | }; | |||
|
75 | ||||
|
76 | ||||
|
77 | float VREF0 =(float)3.3; | |||
|
78 | ||||
|
79 | int bsp_init() | |||
|
80 | { | |||
|
81 | int i=0; | |||
|
82 | for(i=0;i<32;i++) | |||
|
83 | { | |||
|
84 | __opnfiles__[i] = NULL; | |||
|
85 | } | |||
|
86 | bsp_GPIO_init(); | |||
|
87 | bsp_uart_init(); | |||
|
88 | bsp_FSMC_init(); | |||
|
89 | bsp_GTerm_init(); | |||
|
90 | printf("\r================================================================\n\r"); | |||
|
91 | printf("================================================================\n\r"); | |||
|
92 | printf(BSP); | |||
|
93 | printf(" initialised\n\r"); | |||
|
94 | printf("================================================================\n\r"); | |||
|
95 | return 1; | |||
|
96 | } | |||
|
97 | ||||
|
98 | void bsp_GPIO_init() | |||
|
99 | { | |||
|
100 | gpio_t gpio1 = gpioopen(PD12);//gpioopen(LED1); //PD9 D=> 0x0300 9 => 0x0009 | |||
|
101 | gpio_t gpio2 = gpioopen(PD13);//gpioopen(LED2); | |||
|
102 | gpio_t gpio3 = gpioopen(PD14);//gpioopen(LED2); | |||
|
103 | gpio_t gpio4 = gpioopen(PD15);//gpioopen(LED2); | |||
|
104 | gpiosetspeed(&gpio1,gpiohighspeed); | |||
|
105 | gpiosetspeed(&gpio2,gpiohighspeed); | |||
|
106 | gpiosetspeed(&gpio3,gpiohighspeed); | |||
|
107 | gpiosetspeed(&gpio4,gpiohighspeed); | |||
|
108 | gpiosetdir(&gpio1,gpiooutdir); | |||
|
109 | gpiosetdir(&gpio3,gpiooutdir); | |||
|
110 | gpiosetdir(&gpio2,gpiooutdir); | |||
|
111 | gpiosetdir(&gpio4,gpiooutdir); | |||
|
112 | } | |||
|
113 | ||||
|
114 | void bsp_uart_init() | |||
|
115 | { | |||
|
116 | // if(__opnfiles__[1]==NULL) | |||
|
117 | // { | |||
|
118 | // //uart_t* uart1 = (uart_t*)malloc(sizeof(uart_t)); | |||
|
119 | // streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice)); | |||
|
120 | // uart_t uart = uartopenandconfig(uart3,uartparitynone | uart8bits | uartonestop,19200,PB10,PB11,-1,-1); | |||
|
121 | // uartmkstreamdev(uart,fd1); | |||
|
122 | // __opnfiles__[1] = fd1; //stdo | |||
|
123 | // __opnfiles__[0] = fd1; //stdi | |||
|
124 | // } | |||
|
125 | // else | |||
|
126 | // { | |||
|
127 | // uartopenandconfig(2,uartparitynone | uart8bits | uartonestop,115200,PB10,PB11,-1,-1); | |||
|
128 | // } | |||
|
129 | } | |||
|
130 | ||||
|
131 | void bsp_spi_init() | |||
|
132 | { | |||
|
133 | ||||
|
134 | } | |||
|
135 | ||||
|
136 | ||||
|
137 | int bsp_FSMC_init() | |||
|
138 | { | |||
|
139 | #define GPIOGETPORT(gpio) ((GPIO_TypeDef*)(((((uint32_t)gpio) & (uint32_t)0x0000FF00)*(uint32_t)4) + (uint32_t)GPIOA)) | |||
|
140 | #define GPIOPORTNUM(gpio) (((uint32_t)(gpio) & (uint32_t)0x0000FF00)>>(uint32_t)8) | |||
|
141 | ||||
|
142 | gpio_t LCD_DBxList[]={PD14,PD15,PD0,PD1,PE7,PE8,PE9,PE10\ | |||
|
143 | ,PD4,PD5,PD7,PE4}; | |||
|
144 | for(int i=0;i<12;i++) | |||
|
145 | { | |||
|
146 | gpio_t LCD_DBx = gpioopen(LCD_DBxList[i]); | |||
|
147 | LCD_DBx |= gpiohighspeed | gpioaf | gpiopushpulltype | gpionopulltype; | |||
|
148 | gpiosetconfig(&LCD_DBx); | |||
|
149 | GPIO_PinAFConfig(GPIOGETPORT(LCD_DBx), (uint8_t)(LCD_DBx & 0xF), GPIO_AF_FSMC); | |||
|
150 | } | |||
|
151 | ||||
|
152 | FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure; | |||
|
153 | FSMC_NORSRAMTimingInitTypeDef p,readtim; | |||
|
154 | ||||
|
155 | /* Enable FSMC clock */ | |||
|
156 | RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE); | |||
|
157 | ||||
|
158 | /*-- FSMC Configuration ------------------------------------------------------*/ | |||
|
159 | /*----------------------- SRAM Bank 3 ----------------------------------------*/ | |||
|
160 | /* FSMC_Bank1_NORSRAM4 configuration */ | |||
|
161 | p.FSMC_AddressSetupTime = 3; | |||
|
162 | p.FSMC_AddressHoldTime = 3; | |||
|
163 | //ili9328 -> data setup time > 10ns | |||
|
164 | p.FSMC_DataSetupTime = 1; | |||
|
165 | if(getCpuFreq()>100*1000*1000) | |||
|
166 | p.FSMC_DataSetupTime = 2;// 11; | |||
|
167 | p.FSMC_BusTurnAroundDuration = 0; | |||
|
168 | p.FSMC_CLKDivision = 0; | |||
|
169 | p.FSMC_DataLatency = 0; | |||
|
170 | //ili9328 -> data hold time > 15ns | |||
|
171 | if(getCpuFreq()>66*1000*1000) | |||
|
172 | p.FSMC_DataLatency = 1; | |||
|
173 | p.FSMC_AccessMode = FSMC_AccessMode_A; | |||
|
174 | ||||
|
175 | readtim.FSMC_AddressSetupTime = 0xF; | |||
|
176 | readtim.FSMC_AddressHoldTime = 0xF; | |||
|
177 | //p.FSMC_DataSetupTime = 9; | |||
|
178 | readtim.FSMC_DataSetupTime = 0xF ;// 11; | |||
|
179 | if(getCpuFreq()>100*1000*1000) | |||
|
180 | readtim.FSMC_DataSetupTime = 0xF;// 11; | |||
|
181 | readtim.FSMC_BusTurnAroundDuration = 0xf; | |||
|
182 | readtim.FSMC_CLKDivision = 0; | |||
|
183 | readtim.FSMC_DataLatency = 0xF; | |||
|
184 | if(getCpuFreq()>66*1000*1000) | |||
|
185 | readtim.FSMC_DataLatency = 0xF; | |||
|
186 | readtim.FSMC_AccessMode = FSMC_AccessMode_A; | |||
|
187 | ||||
|
188 | ||||
|
189 | FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1; | |||
|
190 | FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; | |||
|
191 | FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM; | |||
|
192 | FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_8b; | |||
|
193 | FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable; | |||
|
194 | FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable; | |||
|
195 | FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low; | |||
|
196 | FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable; | |||
|
197 | FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState; | |||
|
198 | FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable; | |||
|
199 | FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable; | |||
|
200 | FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; | |||
|
201 | FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable; | |||
|
202 | FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readtim; | |||
|
203 | FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p; | |||
|
204 | ||||
|
205 | FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure); | |||
|
206 | ||||
|
207 | FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE); | |||
|
208 | gpioset(LCD_RESET); | |||
|
209 | gpioclr(LCD_RESET); | |||
|
210 | delay_100us(500); | |||
|
211 | gpioset(LCD_RESET); | |||
|
212 | delay_100us(500); | |||
|
213 | lcd0.init(&lcd0); | |||
|
214 | gpioset(LCD_BACKL); | |||
|
215 | return 1; | |||
|
216 | } | |||
|
217 | ||||
|
218 | ||||
|
219 | void bsp_iic_init() | |||
|
220 | { | |||
|
221 | ||||
|
222 | } | |||
|
223 | ||||
|
224 | void bsp_SD_init() | |||
|
225 | { | |||
|
226 | ||||
|
227 | } | |||
|
228 | ||||
|
229 | ||||
|
230 | void vs10XXclearXCS(){} | |||
|
231 | void vs10XXsetXCS(){} | |||
|
232 | int vs10XXDREQ() | |||
|
233 | { | |||
|
234 | return 1; | |||
|
235 | } | |||
|
236 | ||||
|
237 | ||||
|
238 | void bsppowersdcard(char onoff) //always ON | |||
|
239 | { | |||
|
240 | ||||
|
241 | } | |||
|
242 | ||||
|
243 | char bspsdcardpresent() | |||
|
244 | { | |||
|
245 | return 0; | |||
|
246 | } | |||
|
247 | ||||
|
248 | char bspsdcardwriteprotected() | |||
|
249 | { | |||
|
250 | return 0; | |||
|
251 | } | |||
|
252 | ||||
|
253 | void bspsdcardselect(char YESNO) | |||
|
254 | { | |||
|
255 | ||||
|
256 | } | |||
|
257 | ||||
|
258 | ||||
|
259 | ||||
|
260 | void bsp_lcd0_write_reg(uint32_t reg,uint32_t data) | |||
|
261 | { | |||
|
262 | uint8_t* pt8 = (uint8_t*)(void*)® | |||
|
263 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |||
|
264 | *lcd0_CMD=pt8[3]; | |||
|
265 | *lcd0_CMD=pt8[2]; | |||
|
266 | pt8 = (uint8_t*)(void*)&data; | |||
|
267 | *lcd0_DATA=pt8[3]; | |||
|
268 | *lcd0_DATA=pt8[2]; | |||
|
269 | #else | |||
|
270 | *lcd0_CMD=pt8[1]; | |||
|
271 | *lcd0_CMD=pt8[0]; | |||
|
272 | pt8 = (uint8_t*)(void*)&data; | |||
|
273 | *lcd0_DATA=pt8[1]; | |||
|
274 | *lcd0_DATA=pt8[0]; | |||
|
275 | #endif | |||
|
276 | ||||
|
277 | } | |||
|
278 | ||||
|
279 | uint32_t bsp_lcd0_read_reg(uint32_t reg) | |||
|
280 | { | |||
|
281 | uint8_t* pt8 = (uint8_t*)(void*)® | |||
|
282 | uint32_t DATA=0; | |||
|
283 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |||
|
284 | *lcd0_CMD=pt8[3]; | |||
|
285 | *lcd0_CMD=pt8[2]; | |||
|
286 | pt8 = (uint8_t*)(void*)&DATA; | |||
|
287 | pt8[3]=*lcd0_DATA; | |||
|
288 | pt8[2]=*lcd0_DATA; | |||
|
289 | #else | |||
|
290 | ||||
|
291 | *lcd0_CMD=pt8[1]; | |||
|
292 | *lcd0_CMD=pt8[0]; | |||
|
293 | pt8 = (uint8_t*)(void*)&DATA; | |||
|
294 | pt8[1]=*lcd0_DATA; | |||
|
295 | pt8[0]=*lcd0_DATA; | |||
|
296 | #endif | |||
|
297 | ||||
|
298 | return DATA; | |||
|
299 | } | |||
|
300 | ||||
|
301 | void bsp_lcd0_writeGRAM(void* buffer,uint32_t count) | |||
|
302 | { | |||
|
303 | uint32_t reg =ILI9328_REGISTER_WRITEDATATOGRAM; | |||
|
304 | uint8_t* pt8 = (uint8_t*)(void*)(®); | |||
|
305 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |||
|
306 | *lcd0_CMD=pt8[3]; | |||
|
307 | *lcd0_CMD=pt8[2]; | |||
|
308 | pt8 = (uint8_t*)(void*)buffer; | |||
|
309 | for(int i=0;i<(int)count;i++) | |||
|
310 | { | |||
|
311 | *lcd0_DATA=pt8[(2*i) +1]; | |||
|
312 | *lcd0_DATA=pt8[2*i]; | |||
|
313 | } | |||
|
314 | #else | |||
|
315 | ||||
|
316 | *lcd0_CMD=pt8[1]; | |||
|
317 | *lcd0_CMD=pt8[0]; | |||
|
318 | pt8 = (uint8_t*)(void*)buffer; | |||
|
319 | for(int i=0;i<(int)count;i++) | |||
|
320 | { | |||
|
321 | ||||
|
322 | *lcd0_DATA=pt8[(2*i) +1]; | |||
|
323 | *lcd0_DATA=pt8[2*i]; | |||
|
324 | } | |||
|
325 | #endif | |||
|
326 | } | |||
|
327 | ||||
|
328 | void bsp_lcd0_readGRAM(void* buffer,uint32_t count) | |||
|
329 | { | |||
|
330 | uint32_t reg =ILI9328_REGISTER_WRITEDATATOGRAM; | |||
|
331 | uint8_t* pt8 = (uint8_t*)(void*)® | |||
|
332 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |||
|
333 | *lcd0_CMD=pt8[3]; | |||
|
334 | *lcd0_CMD=pt8[2]; | |||
|
335 | pt8 = (uint8_t*)(void*)buffer; | |||
|
336 | for(int i=0;i<(int)count;i++) | |||
|
337 | { | |||
|
338 | pt8[(2*i) +1]=*lcd0_DATA; | |||
|
339 | pt8[2*i]=*lcd0_DATA; | |||
|
340 | } | |||
|
341 | #else | |||
|
342 | *lcd0_CMD=pt8[1]; | |||
|
343 | *lcd0_CMD=pt8[0]; | |||
|
344 | pt8 = (uint8_t*)(void*)buffer; | |||
|
345 | /* | |||
|
346 | * x dummy reads Cf ili9328 datasheet p79! | |||
|
347 | */ | |||
|
348 | pt8[0]=*lcd0_DATA; | |||
|
349 | pt8[0]=*lcd0_DATA; | |||
|
350 | ||||
|
351 | for(int i=0;i<(int)count;i++) | |||
|
352 | { | |||
|
353 | pt8[(2*i) +1]=*lcd0_DATA; | |||
|
354 | pt8[2*i]=*lcd0_DATA; | |||
|
355 | // pt8[(2*i) +1]=(uint8_t)0; | |||
|
356 | // pt8[(2*i)]=(uint8_t)0; | |||
|
357 | } | |||
|
358 | #endif | |||
|
359 | } | |||
|
360 | ||||
|
361 | void bsp_GTerm_init() | |||
|
362 | { | |||
|
363 | if(__opnfiles__[1]==NULL) | |||
|
364 | { | |||
|
365 | streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice)); | |||
|
366 | terminal_init(&terminal0 ,&lcd0,&ComicSansMS_8,fd1); | |||
|
367 | __opnfiles__[1] = fd1; | |||
|
368 | } | |||
|
369 | else | |||
|
370 | { | |||
|
371 | ||||
|
372 | } | |||
|
373 | } | |||
|
374 | ||||
|
375 | ||||
|
376 | ||||
|
377 | ||||
|
378 |
@@ -0,0 +1,127 | |||||
|
1 | /*------------------------------------------------------------------------------ | |||
|
2 | -- This file is a part of the libuc, microcontroler library | |||
|
3 | -- Copyright (C) 2011, Alexis Jeandet | |||
|
4 | -- | |||
|
5 | -- This program is free software; you can redistribute it and/or modify | |||
|
6 | -- it under the terms of the GNU General Public License as published by | |||
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |||
|
8 | -- (at your option) any later version. | |||
|
9 | -- | |||
|
10 | -- This program is distributed in the hope that it will be useful, | |||
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
13 | -- GNU General Public License for more details. | |||
|
14 | -- | |||
|
15 | -- You should have received a copy of the GNU General Public License | |||
|
16 | -- along with this program; if not, write to the Free Software | |||
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
|
18 | ------------------------------------------------------------------------------- | |||
|
19 | -- Author : Alexis Jeandet | |||
|
20 | -- Mail : alexis.jeandet@member.fsf.org | |||
|
21 | -------------------------------------------------------------------------------*/ | |||
|
22 | #ifndef BSP_H | |||
|
23 | #define BSP_H | |||
|
24 | #include <stm32f4xx.h> | |||
|
25 | #include <stm32f4xx_gpio.h> | |||
|
26 | #include <stm32f4xx_rcc.h> | |||
|
27 | #include <gpio.h> | |||
|
28 | #include <spi.h> | |||
|
29 | #include <ili9328.h> | |||
|
30 | #include <genericLCD_Controler.h> | |||
|
31 | #include <sdcard-spi.h> | |||
|
32 | #include <sdcard.h> | |||
|
33 | #include <mbr.h> | |||
|
34 | #include <VS10XX.h> | |||
|
35 | #include <fat32.h> | |||
|
36 | ||||
|
37 | /* | |||
|
38 | #ifndef PD12 | |||
|
39 | #define PD12 | |||
|
40 | #endif | |||
|
41 | #ifndef PD13 | |||
|
42 | #define PD13 | |||
|
43 | #endif | |||
|
44 | */ | |||
|
45 | #define __MAX_OPENED_FILES__ 32 | |||
|
46 | #define __FS_ROOT_SIZE__ 32 | |||
|
47 | ||||
|
48 | #define LED1 PD12 | |||
|
49 | #define LED2 PD13 | |||
|
50 | #define BP3 PA0 | |||
|
51 | ||||
|
52 | #define LCD_RESET PD10 | |||
|
53 | #define LCD_BACKL PE11 | |||
|
54 | ||||
|
55 | #define GREENLEDON (GPIOD->BSRRL = 1<<12) | |||
|
56 | #define ORANGELEDON (GPIOD->BSRRL = 1<<13) | |||
|
57 | #define REDLEDON (GPIOD->BSRRL = 1<<14) | |||
|
58 | #define BLUELEDON (GPIOD->BSRRL = 1<<15) | |||
|
59 | ||||
|
60 | #define GREENLEDOFF (GPIOD->BSRRH = 1<<12) | |||
|
61 | #define ORANGELEDOFF (GPIOD->BSRRH = 1<<13) | |||
|
62 | #define REDLEDOFF (GPIOD->BSRRH = 1<<14) | |||
|
63 | #define BLUELEDOFF (GPIOD->BSRRH = 1<<15) | |||
|
64 | ||||
|
65 | extern float VREF0; | |||
|
66 | extern LCD_t lcd0; | |||
|
67 | extern uint32_t OSC0; | |||
|
68 | extern uint32_t currentCpuFreq; | |||
|
69 | extern volatile vs10XXDev audioCodec0; | |||
|
70 | extern sdcardDev sdcard2; | |||
|
71 | extern blkdevice sdcard2blkdev; | |||
|
72 | extern dikpartition sdcard2Part1; | |||
|
73 | extern FAT32fs sdcard2FAT32part1; | |||
|
74 | extern dikpartition sdcard2Part2; | |||
|
75 | extern FAT32fs sdcard2FAT32part2; | |||
|
76 | extern dikpartition sdcard2Part3; | |||
|
77 | extern FAT32fs sdcard2FAT32part3; | |||
|
78 | extern dikpartition sdcard2Part4; | |||
|
79 | extern FAT32fs sdcard2FAT32part4; | |||
|
80 | ||||
|
81 | ||||
|
82 | extern int bsp_init(); | |||
|
83 | ||||
|
84 | extern void bsp_GPIO_init(); | |||
|
85 | extern void bsp_uart_init(); | |||
|
86 | extern void bsp_iic_init(); | |||
|
87 | extern void bsp_spi_init(); | |||
|
88 | extern void bsp_SD_init(); | |||
|
89 | extern void bsp_GTerm_init(); | |||
|
90 | extern int bsp_FSMC_init(); | |||
|
91 | ||||
|
92 | void bsp_lcd0_write_reg(uint32_t reg,uint32_t data); | |||
|
93 | uint32_t bsp_lcd0_read_reg(uint32_t reg); | |||
|
94 | void bsp_lcd0_writeGRAM(void *buffer, uint32_t count); | |||
|
95 | void bsp_lcd0_readGRAM(void *buffer, uint32_t count); | |||
|
96 | ||||
|
97 | /* VS1053 */ | |||
|
98 | extern void clearXCS(); | |||
|
99 | extern void setXCS(); | |||
|
100 | extern int vs10XXDREQ(); | |||
|
101 | ||||
|
102 | /* SD CARD */ | |||
|
103 | void bsppowersdcard(char onoff); | |||
|
104 | char bspsdcardpresent(); | |||
|
105 | void bspsdcardselect(char YESNO); | |||
|
106 | char bspsdcardwriteprotected(); | |||
|
107 | ||||
|
108 | #endif | |||
|
109 | ||||
|
110 | ||||
|
111 | ||||
|
112 | ||||
|
113 | ||||
|
114 | ||||
|
115 | ||||
|
116 | ||||
|
117 | ||||
|
118 | ||||
|
119 | ||||
|
120 | ||||
|
121 | ||||
|
122 | ||||
|
123 | ||||
|
124 | ||||
|
125 | ||||
|
126 | ||||
|
127 |
@@ -0,0 +1,3 | |||||
|
1 | CPU=stm32f4xxxG | |||
|
2 | DEFINES+=BSP=\\\"STM32F4Discovery-ILI9328-8bits\\\" | |||
|
3 | UCMODEL=stm32f4 |
@@ -51,6 +51,7 LCD_t lcd0={ | |||||
51 | .paint = &ili9328paint, |
|
51 | .paint = &ili9328paint, | |
52 | .paintText = &ili9328paintText, |
|
52 | .paintText = &ili9328paintText, | |
53 | .paintFilRect = &ili9328paintFilRect, |
|
53 | .paintFilRect = &ili9328paintFilRect, | |
|
54 | .getPix = &ili9328getPix, | |||
54 | .refreshenable = &ili9328refreshenable, |
|
55 | .refreshenable = &ili9328refreshenable, | |
55 | .width= 240, |
|
56 | .width= 240, | |
56 | .height = 320 |
|
57 | .height = 320 | |
@@ -58,8 +59,8 LCD_t lcd0={ | |||||
58 |
|
59 | |||
59 | terminal_t terminal0; |
|
60 | terminal_t terminal0; | |
60 |
|
61 | |||
61 |
volatile int16_t* lcd0_CMD=(volatile int16_t*) |
|
62 | volatile int16_t* lcd0_CMD=(volatile int16_t*)0x60000000; | |
62 |
volatile int16_t* lcd0_DATA=(volatile int16_t*) |
|
63 | volatile int16_t* lcd0_DATA=(volatile int16_t*)0x61FFFFF0; | |
63 |
|
64 | |||
64 | float VREF0 =(float)3.3; |
|
65 | float VREF0 =(float)3.3; | |
65 |
|
66 |
@@ -51,6 +51,7 LCD_t lcd0={ | |||||
51 | .paint = &ili9328paint, |
|
51 | .paint = &ili9328paint, | |
52 | .paintText = &ili9328paintText, |
|
52 | .paintText = &ili9328paintText, | |
53 | .paintFilRect = &ili9328paintFilRect, |
|
53 | .paintFilRect = &ili9328paintFilRect, | |
|
54 | .getPix = &ili9328getPix, | |||
54 | .refreshenable = &ili9328refreshenable, |
|
55 | .refreshenable = &ili9328refreshenable, | |
55 | .width= 240, |
|
56 | .width= 240, | |
56 | .height = 320 |
|
57 | .height = 320 | |
@@ -58,8 +59,8 LCD_t lcd0={ | |||||
58 |
|
59 | |||
59 | terminal_t terminal0; |
|
60 | terminal_t terminal0; | |
60 |
|
61 | |||
61 |
volatile uint8_t* lcd0_CMD=(volatile uint8_t*) |
|
62 | volatile uint8_t* lcd0_CMD=(volatile uint8_t*)0x60000000; | |
62 |
volatile uint8_t* lcd0_DATA=(volatile uint8_t*) |
|
63 | volatile uint8_t* lcd0_DATA=(volatile uint8_t*)0x61FFFFF0; | |
63 |
|
64 | |||
64 | float VREF0 =(float)3.3; |
|
65 | float VREF0 =(float)3.3; | |
65 | volatile vs10XXDev audioCodec0; |
|
66 | volatile vs10XXDev audioCodec0; | |
@@ -95,6 +96,11 int bsp_init() | |||||
95 | printf(BSP); |
|
96 | printf(BSP); | |
96 | printf(" initialised\n\r"); |
|
97 | printf(" initialised\n\r"); | |
97 | printf( "=====================\n\r"); |
|
98 | printf( "=====================\n\r"); | |
|
99 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |||
|
100 | printf( "BIG ENDIAN MACHINE\n\r"); | |||
|
101 | #else | |||
|
102 | printf( "LITLE ENDIAN MACHINE\n\r"); | |||
|
103 | #endif | |||
98 | return 1; |
|
104 | return 1; | |
99 | } |
|
105 | } | |
100 |
|
106 | |||
@@ -124,18 +130,18 void bsp_GPIO_init() | |||||
124 |
|
130 | |||
125 | void bsp_uart_init() |
|
131 | void bsp_uart_init() | |
126 | { |
|
132 | { | |
127 | // if(__opnfiles__[1]==NULL) |
|
133 | // if(__opnfiles__[1]==NULL) | |
128 | // { |
|
134 | // { | |
129 | // //uart_t* uart1 = (uart_t*)malloc(sizeof(uart_t)); |
|
135 | // //uart_t* uart1 = (uart_t*)malloc(sizeof(uart_t)); | |
130 | // streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice)); |
|
136 | // streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice)); | |
131 | // uart_t uart = uartopenandconfig(uart3,uartparitynone | uart8bits | uartonestop,115200,PD8,PD9,-1,-1); |
|
137 | // uart_t uart = uartopenandconfig(uart3,uartparitynone | uart8bits | uartonestop,115200,PD8,PD9,-1,-1); | |
132 | // uartmkstreamdev(uart,fd1); |
|
138 | // uartmkstreamdev(uart,fd1); | |
133 | // __opnfiles__[1] = fd1; |
|
139 | // __opnfiles__[1] = fd1; | |
134 | // } |
|
140 | // } | |
135 | // else |
|
141 | // else | |
136 | // { |
|
142 | // { | |
137 | // uartopenandconfig(uart3,uartparitynone | uart8bits | uartonestop,115200,PD8,PD9,-1,-1); |
|
143 | // uartopenandconfig(uart3,uartparitynone | uart8bits | uartonestop,115200,PD8,PD9,-1,-1); | |
138 | // } |
|
144 | // } | |
139 | } |
|
145 | } | |
140 |
|
146 | |||
141 | /* |
|
147 | /* | |
@@ -161,7 +167,7 int bsp_FSMC_init() | |||||
161 | } |
|
167 | } | |
162 |
|
168 | |||
163 | FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure; |
|
169 | FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure; | |
164 | FSMC_NORSRAMTimingInitTypeDef p; |
|
170 | FSMC_NORSRAMTimingInitTypeDef p,readtim; | |
165 |
|
171 | |||
166 | /* Enable FSMC clock */ |
|
172 | /* Enable FSMC clock */ | |
167 | RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE); |
|
173 | RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE); | |
@@ -169,23 +175,34 int bsp_FSMC_init() | |||||
169 | /*-- FSMC Configuration ------------------------------------------------------*/ |
|
175 | /*-- FSMC Configuration ------------------------------------------------------*/ | |
170 | /*----------------------- SRAM Bank 3 ----------------------------------------*/ |
|
176 | /*----------------------- SRAM Bank 3 ----------------------------------------*/ | |
171 | /* FSMC_Bank1_NORSRAM4 configuration */ |
|
177 | /* FSMC_Bank1_NORSRAM4 configuration */ | |
172 |
|
|
178 | p.FSMC_AddressSetupTime = 0xf; | |
173 |
|
|
179 | p.FSMC_AddressHoldTime = 0xf; | |
174 | p.FSMC_AddressSetupTime = 3; |
|
|||
175 | p.FSMC_AddressHoldTime = 3; |
|
|||
176 | //p.FSMC_DataSetupTime = 9; |
|
|||
177 | //ili9328 -> data setup time > 10ns |
|
180 | //ili9328 -> data setup time > 10ns | |
178 |
p.FSMC_DataSetupTime = |
|
181 | p.FSMC_DataSetupTime = 0xf; | |
179 | if(getCpuFreq()>100*1000*1000) |
|
182 | if(getCpuFreq()>100*1000*1000) | |
180 |
p.FSMC_DataSetupTime = |
|
183 | p.FSMC_DataSetupTime = 0xf;// 11; | |
181 | p.FSMC_BusTurnAroundDuration = 0; |
|
184 | p.FSMC_BusTurnAroundDuration = 0xf; | |
182 | p.FSMC_CLKDivision = 0; |
|
185 | p.FSMC_CLKDivision = 0; | |
183 | p.FSMC_DataLatency = 0; |
|
186 | p.FSMC_DataLatency = 0xf; | |
184 | //ili9328 -> data hold time > 15ns |
|
187 | //ili9328 -> data hold time > 15ns | |
185 | if(getCpuFreq()>66*1000*1000) |
|
188 | if(getCpuFreq()>66*1000*1000) | |
186 |
p.FSMC_DataLatency = |
|
189 | p.FSMC_DataLatency = 0xf; | |
187 | p.FSMC_AccessMode = FSMC_AccessMode_A; |
|
190 | p.FSMC_AccessMode = FSMC_AccessMode_A; | |
188 |
|
191 | |||
|
192 | readtim.FSMC_AddressSetupTime = 0xf; | |||
|
193 | readtim.FSMC_AddressHoldTime = 0xf; | |||
|
194 | //p.FSMC_DataSetupTime = 9; | |||
|
195 | readtim.FSMC_DataSetupTime = 0xf ;// 11; | |||
|
196 | if(getCpuFreq()>100*1000*1000) | |||
|
197 | readtim.FSMC_DataSetupTime = 0xf;// 11; | |||
|
198 | readtim.FSMC_BusTurnAroundDuration = 0xf; | |||
|
199 | readtim.FSMC_CLKDivision = 0; | |||
|
200 | readtim.FSMC_DataLatency = 0xf; | |||
|
201 | if(getCpuFreq()>66*1000*1000) | |||
|
202 | readtim.FSMC_DataLatency = 0xf; | |||
|
203 | readtim.FSMC_AccessMode = FSMC_AccessMode_A; | |||
|
204 | ||||
|
205 | ||||
189 | FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1; |
|
206 | FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1; | |
190 | FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; |
|
207 | FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; | |
191 | FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM; |
|
208 | FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM; | |
@@ -199,7 +216,7 int bsp_FSMC_init() | |||||
199 | FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable; |
|
216 | FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable; | |
200 | FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; |
|
217 | FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; | |
201 | FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable; |
|
218 | FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable; | |
202 |
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = & |
|
219 | FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readtim; | |
203 | FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p; |
|
220 | FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p; | |
204 |
|
221 | |||
205 | FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure); |
|
222 | FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure); | |
@@ -298,7 +315,7 void bsp_SD_init() | |||||
298 | { |
|
315 | { | |
299 | printf("Can't open or read MBR\n"); |
|
316 | printf("Can't open or read MBR\n"); | |
300 | } |
|
317 | } | |
301 |
delay_100us(1000 |
|
318 | delay_100us(1000); | |
302 | if(mbropen(&sdcard2blkdev,&sdcard2Part2,2)==MBRnoErr) |
|
319 | if(mbropen(&sdcard2blkdev,&sdcard2Part2,2)==MBRnoErr) | |
303 | { |
|
320 | { | |
304 | if(FATnoErr!=fat32open(&sdcard2FAT32part2,&sdcard2Part2)) |
|
321 | if(FATnoErr!=fat32open(&sdcard2FAT32part2,&sdcard2Part2)) | |
@@ -308,7 +325,7 void bsp_SD_init() | |||||
308 | { |
|
325 | { | |
309 | printf("Can't open or read MBR\n"); |
|
326 | printf("Can't open or read MBR\n"); | |
310 | } |
|
327 | } | |
311 |
delay_100us(1000 |
|
328 | delay_100us(1000); | |
312 | if(mbropen(&sdcard2blkdev,&sdcard2Part3,3)==MBRnoErr) |
|
329 | if(mbropen(&sdcard2blkdev,&sdcard2Part3,3)==MBRnoErr) | |
313 | { |
|
330 | { | |
314 | if(FATnoErr!=fat32open(&sdcard2FAT32part3,&sdcard2Part3)) |
|
331 | if(FATnoErr!=fat32open(&sdcard2FAT32part3,&sdcard2Part3)) | |
@@ -318,7 +335,7 void bsp_SD_init() | |||||
318 | { |
|
335 | { | |
319 | printf("Can't open or read MBR\n"); |
|
336 | printf("Can't open or read MBR\n"); | |
320 | } |
|
337 | } | |
321 |
delay_100us(1000 |
|
338 | delay_100us(1000); | |
322 | if(mbropen(&sdcard2blkdev,&sdcard2Part4,4)==MBRnoErr) |
|
339 | if(mbropen(&sdcard2blkdev,&sdcard2Part4,4)==MBRnoErr) | |
323 | { |
|
340 | { | |
324 | if(FATnoErr!=fat32open(&sdcard2FAT32part4,&sdcard2Part4)) |
|
341 | if(FATnoErr!=fat32open(&sdcard2FAT32part4,&sdcard2Part4)) | |
@@ -334,7 +351,7 void bsp_SD_init() | |||||
334 | printf("Can't initialize SDCARD\n"); |
|
351 | printf("Can't initialize SDCARD\n"); | |
335 | } |
|
352 | } | |
336 | } |
|
353 | } | |
337 |
delay_100us(2000 |
|
354 | delay_100us(2000); | |
338 | } |
|
355 | } | |
339 |
|
356 | |||
340 | void vs1052setXCS(char val) |
|
357 | void vs1052setXCS(char val) | |
@@ -379,7 +396,7 char bspsdcardwriteprotected() | |||||
379 |
|
396 | |||
380 | void bspsdcardselect(char YESNO) |
|
397 | void bspsdcardselect(char YESNO) | |
381 | { |
|
398 | { | |
382 | // gpiosetval(LED1,(int)YESNO); |
|
399 | // gpiosetval(LED1,(int)YESNO); | |
383 | if(YESNO) |
|
400 | if(YESNO) | |
384 | gpioclr(SDCARD2CS); |
|
401 | gpioclr(SDCARD2CS); | |
385 | else |
|
402 | else | |
@@ -389,7 +406,11 void bspsdcardselect(char YESNO) | |||||
389 |
|
406 | |||
390 | void bsp_lcd0_write_reg(uint32_t reg,uint32_t data) |
|
407 | void bsp_lcd0_write_reg(uint32_t reg,uint32_t data) | |
391 | { |
|
408 | { | |
392 | uint8_t* pt8 = (uint8_t*)(void*)® |
|
409 | uint8_t* pt8 = (uint8_t*)(void*)(®); | |
|
410 | *lcd0_CMD=(uint8_t)0; | |||
|
411 | *lcd0_CMD=(uint8_t)0; | |||
|
412 | *lcd0_CMD=(uint8_t)0; | |||
|
413 | *lcd0_CMD=(uint8_t)0; | |||
393 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ |
|
414 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |
394 | *lcd0_CMD=pt8[3]; |
|
415 | *lcd0_CMD=pt8[3]; | |
395 | *lcd0_CMD=pt8[2]; |
|
416 | *lcd0_CMD=pt8[2]; | |
@@ -408,8 +429,12 void bsp_lcd0_write_reg(uint32_t reg,uin | |||||
408 |
|
429 | |||
409 | uint32_t bsp_lcd0_read_reg(uint32_t reg) |
|
430 | uint32_t bsp_lcd0_read_reg(uint32_t reg) | |
410 | { |
|
431 | { | |
411 | uint8_t* pt8 = (uint8_t*)(void*)® |
|
432 | uint8_t* pt8 = (uint8_t*)(void*)(®); | |
412 | uint32_t DATA=0; |
|
433 | uint32_t DATA=0; | |
|
434 | *lcd0_CMD=(uint8_t)0; | |||
|
435 | *lcd0_CMD=(uint8_t)0; | |||
|
436 | *lcd0_CMD=(uint8_t)0; | |||
|
437 | *lcd0_CMD=(uint8_t)0; | |||
413 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ |
|
438 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |
414 | *lcd0_CMD=pt8[3]; |
|
439 | *lcd0_CMD=pt8[3]; | |
415 | *lcd0_CMD=pt8[2]; |
|
440 | *lcd0_CMD=pt8[2]; | |
@@ -431,7 +456,11 uint32_t bsp_lcd0_read_reg(uint32_t reg) | |||||
431 | void bsp_lcd0_writeGRAM(void* buffer,uint32_t count) |
|
456 | void bsp_lcd0_writeGRAM(void* buffer,uint32_t count) | |
432 | { |
|
457 | { | |
433 | uint32_t reg =ILI9328_REGISTER_WRITEDATATOGRAM; |
|
458 | uint32_t reg =ILI9328_REGISTER_WRITEDATATOGRAM; | |
434 | uint8_t* pt8 = (uint8_t*)(void*)® |
|
459 | uint8_t* pt8 = (uint8_t*)(void*)(®); | |
|
460 | *lcd0_CMD=(uint8_t)0; | |||
|
461 | *lcd0_CMD=(uint8_t)0; | |||
|
462 | *lcd0_CMD=(uint8_t)0; | |||
|
463 | *lcd0_CMD=(uint8_t)0; | |||
435 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ |
|
464 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |
436 | *lcd0_CMD=pt8[3]; |
|
465 | *lcd0_CMD=pt8[3]; | |
437 | *lcd0_CMD=pt8[2]; |
|
466 | *lcd0_CMD=pt8[2]; | |
@@ -458,7 +487,11 void bsp_lcd0_writeGRAM(void* buffer,uin | |||||
458 | void bsp_lcd0_readGRAM(void* buffer,uint32_t count) |
|
487 | void bsp_lcd0_readGRAM(void* buffer,uint32_t count) | |
459 | { |
|
488 | { | |
460 | uint32_t reg =ILI9328_REGISTER_WRITEDATATOGRAM; |
|
489 | uint32_t reg =ILI9328_REGISTER_WRITEDATATOGRAM; | |
461 | uint8_t* pt8 = (uint8_t*)(void*)® |
|
490 | volatile uint8_t* pt8 = (uint8_t*)(void*)® | |
|
491 | *lcd0_CMD=(uint8_t)0; | |||
|
492 | *lcd0_CMD=(uint8_t)0; | |||
|
493 | *lcd0_CMD=(uint8_t)0; | |||
|
494 | *lcd0_CMD=(uint8_t)0; | |||
462 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ |
|
495 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |
463 | *lcd0_CMD=pt8[3]; |
|
496 | *lcd0_CMD=pt8[3]; | |
464 | *lcd0_CMD=pt8[2]; |
|
497 | *lcd0_CMD=pt8[2]; | |
@@ -466,38 +499,26 void bsp_lcd0_readGRAM(void* buffer,uint | |||||
466 | for(int i=0;i<(int)count;i++) |
|
499 | for(int i=0;i<(int)count;i++) | |
467 | { |
|
500 | { | |
468 | pt8[(2*i) +1]=*lcd0_DATA; |
|
501 | pt8[(2*i) +1]=*lcd0_DATA; | |
469 | __asm__("nop"); |
|
|||
470 | __asm__("nop"); |
|
|||
471 | __asm__("nop"); |
|
|||
472 | __asm__("nop"); |
|
|||
473 | __asm__("nop"); |
|
|||
474 | pt8[2*i]=*lcd0_DATA; |
|
502 | pt8[2*i]=*lcd0_DATA; | |
475 | } |
|
503 | } | |
476 | #else |
|
504 | #else | |
477 | *lcd0_CMD=pt8[1]; |
|
505 | *lcd0_CMD=pt8[1]; | |
478 | *lcd0_CMD=pt8[0]; |
|
506 | *lcd0_CMD=pt8[0]; | |
479 |
|
|
507 | pt8 = (uint8_t*)buffer; | |
|
508 | /* | |||
|
509 | * x dummy reads Cf ili9328 datasheet p79! | |||
|
510 | */ | |||
|
511 | pt8[0]=*lcd0_DATA; | |||
|
512 | pt8[1]=*lcd0_DATA; | |||
|
513 | ||||
480 | for(int i=0;i<(int)count;i++) |
|
514 | for(int i=0;i<(int)count;i++) | |
481 | { |
|
515 | { | |
482 | pt8[(2*i) +1]=*lcd0_DATA; |
|
516 | pt8[(2*i) +1]=*lcd0_DATA; | |
483 | __asm__("nop"); |
|
517 | pt8[2*i]=*lcd0_DATA; | |
484 | __asm__("nop"); |
|
518 | pt8[(2*i) +1]=*lcd0_DATA; | |
485 | __asm__("nop"); |
|
|||
486 | __asm__("nop"); |
|
|||
487 | __asm__("nop"); |
|
|||
488 | __asm__("nop"); |
|
|||
489 | __asm__("nop"); |
|
|||
490 | __asm__("nop"); |
|
|||
491 | __asm__("nop"); |
|
|||
492 | __asm__("nop"); |
|
|||
493 | pt8[2*i]=*lcd0_DATA; |
|
519 | pt8[2*i]=*lcd0_DATA; | |
494 | __asm__("nop"); |
|
520 | // pt8[(2*i) +1]=(uint8_t)0; | |
495 | __asm__("nop"); |
|
521 | // pt8[(2*i)]=(uint8_t)0; | |
496 | __asm__("nop"); |
|
|||
497 | __asm__("nop"); |
|
|||
498 | __asm__("nop"); |
|
|||
499 | pt8[(2*i) +1]=(uint8_t)0; |
|
|||
500 | pt8[(2*i)]=(uint8_t)0; |
|
|||
501 | } |
|
522 | } | |
502 | #endif |
|
523 | #endif | |
503 | } |
|
524 | } |
@@ -46,6 +46,7 LCD_t lcd0={ | |||||
46 | .paint = &ili9328paint, |
|
46 | .paint = &ili9328paint, | |
47 | .paintText = &ili9328paintText, |
|
47 | .paintText = &ili9328paintText, | |
48 | .paintFilRect = &ili9328paintFilRect, |
|
48 | .paintFilRect = &ili9328paintFilRect, | |
|
49 | .getPix = &ili9328getPix, | |||
49 | .refreshenable = &ili9328refreshenable, |
|
50 | .refreshenable = &ili9328refreshenable, | |
50 | .width= 240, |
|
51 | .width= 240, | |
51 | .height = 320 |
|
52 | .height = 320 |
@@ -50,6 +50,7 LCD_t lcd0={ | |||||
50 | .paint = &ili9328paint, |
|
50 | .paint = &ili9328paint, | |
51 | .paintText = &ili9328paintText, |
|
51 | .paintText = &ili9328paintText, | |
52 | .paintFilRect = &ili9328paintFilRect, |
|
52 | .paintFilRect = &ili9328paintFilRect, | |
|
53 | .getPix = &ili9328getPix, | |||
53 | .refreshenable = &ili9328refreshenable, |
|
54 | .refreshenable = &ili9328refreshenable, | |
54 | .width= 240, |
|
55 | .width= 240, | |
55 | .height = 320 |
|
56 | .height = 320 | |
@@ -161,7 +162,7 int bsp_FSMC_init() | |||||
161 | } |
|
162 | } | |
162 |
|
163 | |||
163 | FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure; |
|
164 | FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure; | |
164 | FSMC_NORSRAMTimingInitTypeDef p; |
|
165 | FSMC_NORSRAMTimingInitTypeDef p,readtim; | |
165 |
|
166 | |||
166 | /* Enable FSMC clock */ |
|
167 | /* Enable FSMC clock */ | |
167 | RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE); |
|
168 | RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE); | |
@@ -169,13 +170,32 int bsp_FSMC_init() | |||||
169 | /*-- FSMC Configuration ------------------------------------------------------*/ |
|
170 | /*-- FSMC Configuration ------------------------------------------------------*/ | |
170 | /*----------------------- SRAM Bank 3 ----------------------------------------*/ |
|
171 | /*----------------------- SRAM Bank 3 ----------------------------------------*/ | |
171 | /* FSMC_Bank1_NORSRAM3 configuration */ |
|
172 | /* FSMC_Bank1_NORSRAM3 configuration */ | |
172 |
p.FSMC_AddressSetupTime = |
|
173 | p.FSMC_AddressSetupTime = 0xf; | |
173 | p.FSMC_AddressHoldTime = 0; |
|
174 | p.FSMC_AddressHoldTime = 0xf; | |
174 | p.FSMC_DataSetupTime = getCpuFreq()/14545450 ;// 11; |
|
175 | //ili9328 -> data setup time > 10ns | |
175 | p.FSMC_BusTurnAroundDuration = 0; |
|
176 | p.FSMC_DataSetupTime = 0xf; | |
|
177 | if(getCpuFreq()>100*1000*1000) | |||
|
178 | p.FSMC_DataSetupTime = 0xf;// 11; | |||
|
179 | p.FSMC_BusTurnAroundDuration = 0xf; | |||
176 | p.FSMC_CLKDivision = 0; |
|
180 | p.FSMC_CLKDivision = 0; | |
177 | p.FSMC_DataLatency = 0; |
|
181 | p.FSMC_DataLatency = 0xf; | |
|
182 | //ili9328 -> data hold time > 15ns | |||
|
183 | if(getCpuFreq()>66*1000*1000) | |||
|
184 | p.FSMC_DataLatency = 0xf; | |||
178 | p.FSMC_AccessMode = FSMC_AccessMode_A; |
|
185 | p.FSMC_AccessMode = FSMC_AccessMode_A; | |
|
186 | ||||
|
187 | readtim.FSMC_AddressSetupTime = 0xf; | |||
|
188 | readtim.FSMC_AddressHoldTime = 0xf; | |||
|
189 | //p.FSMC_DataSetupTime = 9; | |||
|
190 | readtim.FSMC_DataSetupTime = 0xf ;// 11; | |||
|
191 | if(getCpuFreq()>100*1000*1000) | |||
|
192 | readtim.FSMC_DataSetupTime = 0xf;// 11; | |||
|
193 | readtim.FSMC_BusTurnAroundDuration = 0xf; | |||
|
194 | readtim.FSMC_CLKDivision = 0; | |||
|
195 | readtim.FSMC_DataLatency = 0xf; | |||
|
196 | if(getCpuFreq()>66*1000*1000) | |||
|
197 | readtim.FSMC_DataLatency = 0xf; | |||
|
198 | readtim.FSMC_AccessMode = FSMC_AccessMode_A; | |||
179 | /* Color LCD configuration ------------------------------------ |
|
199 | /* Color LCD configuration ------------------------------------ | |
180 | LCD configured as follow: |
|
200 | LCD configured as follow: | |
181 | - Data/Address MUX = Disable |
|
201 | - Data/Address MUX = Disable | |
@@ -198,7 +218,7 int bsp_FSMC_init() | |||||
198 | FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable; |
|
218 | FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable; | |
199 | FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; |
|
219 | FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; | |
200 | FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable; |
|
220 | FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable; | |
201 |
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = & |
|
221 | FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readtim; | |
202 | FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p; |
|
222 | FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p; | |
203 |
|
223 | |||
204 | FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure); |
|
224 | FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure); |
@@ -7,6 +7,7 SUBDIRS += STM32F4Discovery \ | |||||
7 | BEAGLESYNTH \ |
|
7 | BEAGLESYNTH \ | |
8 | STM32F4Eval \ |
|
8 | STM32F4Eval \ | |
9 | STM32F4Discovery-EXT \ |
|
9 | STM32F4Discovery-EXT \ | |
|
10 | STM32F4Discovery-ILI9328-8bits \ | |||
10 | OPLAYER \ |
|
11 | OPLAYER \ | |
11 | SIMULATOR |
|
12 | SIMULATOR | |
12 |
|
13 |
@@ -4,8 +4,9 CONFIG += cpu | |||||
4 |
|
4 | |||
5 | UCMODEL=stm32f4 |
|
5 | UCMODEL=stm32f4 | |
6 | BSP = OPLAYER |
|
6 | BSP = OPLAYER | |
|
7 | #BSP = STM32F4Discovery-ILI9328-8bits | |||
7 |
|
8 | |||
8 |
DEFINES += CPUFREQ= |
|
9 | DEFINES += CPUFREQ=50000000 | |
9 |
|
10 | |||
10 |
|
11 | |||
11 | SOURCES += \ |
|
12 | SOURCES += \ |
@@ -19,6 +19,9 | |||||
19 |
|
19 | |||
20 | extern streamdevice* __opnfiles__[]; |
|
20 | extern streamdevice* __opnfiles__[]; | |
21 | extern void test_Block_Move(LCD_t* LCD,int x,int y,int w,int h,int color); |
|
21 | extern void test_Block_Move(LCD_t* LCD,int x,int y,int w,int h,int color); | |
|
22 | extern void test_all_colors(LCD_t* LCD); | |||
|
23 | extern void test_small_lines(LCD_t* LCD); | |||
|
24 | void test_uniform_rw(LCD_t* LCD); | |||
22 | char buffer[512]; |
|
25 | char buffer[512]; | |
23 |
|
26 | |||
24 | void randBoxesDemo() |
|
27 | void randBoxesDemo() | |
@@ -134,11 +137,17 void playAllparts() | |||||
134 | } |
|
137 | } | |
135 | } |
|
138 | } | |
136 |
|
139 | |||
137 |
int main |
|
140 | int main() | |
138 | { |
|
141 | { | |
139 | delay_100us(30000); |
|
142 | delay_100us(30000); | |
140 | int i=0; |
|
143 | int i=0; | |
141 | int color=0; |
|
144 | int color=0; | |
|
145 | // test_all_colors(&lcd0); | |||
|
146 | test_small_lines(&lcd0); | |||
|
147 | test_uniform_rw(&lcd0); | |||
|
148 | ||||
|
149 | printf("LCD ID REG = 0x%X\n\r",lcd0.interface->readreg(ILI9328_REGISTER_DRIVERCODEREAD)); | |||
|
150 | while(1); | |||
142 | for(i=0;i<240;i++) |
|
151 | for(i=0;i<240;i++) | |
143 | { |
|
152 | { | |
144 | if(i>(240/3)) |
|
153 | if(i>(240/3)) | |
@@ -181,7 +190,7 int main2() | |||||
181 | while(1); |
|
190 | while(1); | |
182 | } |
|
191 | } | |
183 |
|
192 | |||
184 | int main() |
|
193 | int main2() | |
185 | { |
|
194 | { | |
186 | extern terminal_t terminal0; |
|
195 | extern terminal_t terminal0; | |
187 | extern volatile vs10XXDev audioCodec0; |
|
196 | extern volatile vs10XXDev audioCodec0; |
@@ -21,3 +21,50 void test_Block_Move(LCD_t* LCD,int x,in | |||||
21 | { |
|
21 | { | |
22 | LCD->paintFilRect(LCD,x,y,w,h,0,0,color); |
|
22 | LCD->paintFilRect(LCD,x,y,w,h,0,0,color); | |
23 | } |
|
23 | } | |
|
24 | ||||
|
25 | void test_small_lines(LCD_t* LCD) | |||
|
26 | { | |||
|
27 | int i=0; | |||
|
28 | for(i=0;i<LCD->height;i+=2) | |||
|
29 | { | |||
|
30 | LCD->paintFilRect(LCD,0,i,LCD->width,1,0,0,0xaa00); | |||
|
31 | } | |||
|
32 | for(i=1;i<LCD->height;i+=2) | |||
|
33 | { | |||
|
34 | LCD->paintFilRect(LCD,0,i,LCD->width,1,0,0,0x5500); | |||
|
35 | } | |||
|
36 | ||||
|
37 | } | |||
|
38 | ||||
|
39 | void test_uniform_rw(LCD_t* LCD) | |||
|
40 | { | |||
|
41 | uint16_t buffer[50*50]; | |||
|
42 | LCD->paintFilRect(LCD,0,0,LCD->width,LCD->height/2,0,0,0xfaa0); | |||
|
43 | delay_100us(10000); | |||
|
44 | LCD->paintFilRect(LCD,0,0,LCD->width,LCD->height,0,0,0xfaa0); | |||
|
45 | ili9328setFrame(LCD,10,100,50,50); | |||
|
46 | while(1) | |||
|
47 | { | |||
|
48 | // LCD->interface->readGRAM((void*)buffer,50*50); | |||
|
49 | LCD->getPix(LCD,buffer,10,100,50,50); | |||
|
50 | LCD->paint(LCD,buffer,10,100,50,50); | |||
|
51 | delay_100us(10000); | |||
|
52 | //ili9328setFrame(LCD,10,100,50,50); | |||
|
53 | //LCD->interface->writeGRAM((void*)buffer,50*50); | |||
|
54 | } | |||
|
55 | ||||
|
56 | } | |||
|
57 | ||||
|
58 | void test_all_colors(LCD_t* LCD) | |||
|
59 | { | |||
|
60 | uint16_t color=0; | |||
|
61 | char colorch[]=" "; | |||
|
62 | while(1) | |||
|
63 | { | |||
|
64 | LCD->paintFilRect(LCD,0,0,LCD->width,LCD->height,0,0,color); | |||
|
65 | sprintf(colorch,"0x%x",0xFFFF & ((int)color)); | |||
|
66 | LCD->paintText(LCD,colorch,10,100,&ComicSansMS_18,color^-1); | |||
|
67 | //delay_100us(10); | |||
|
68 | color+=1; | |||
|
69 | } | |||
|
70 | } |
@@ -18,6 +18,7 extern streamdevice* __opnfiles__[]; | |||||
18 | extern void test_Block_Move(LCD_t* LCD,int x,int y,int w,int h,int color); |
|
18 | extern void test_Block_Move(LCD_t* LCD,int x,int y,int w,int h,int color); | |
19 | char buffer[512]; |
|
19 | char buffer[512]; | |
20 |
|
20 | |||
|
21 | ||||
21 | void streamdevicePrint(streamdevice* dev, const char* format,...) |
|
22 | void streamdevicePrint(streamdevice* dev, const char* format,...) | |
22 | { |
|
23 | { | |
23 | char** str_buffer; |
|
24 | char** str_buffer; | |
@@ -31,6 +32,20 void streamdevicePrint(streamdevice* dev | |||||
31 | free(*str_buffer); |
|
32 | free(*str_buffer); | |
32 | } |
|
33 | } | |
33 |
|
34 | |||
|
35 | //int printf(const char *format,...) | |||
|
36 | //{ | |||
|
37 | // char** str_buffer; | |||
|
38 | // int i; | |||
|
39 | // va_list ap; | |||
|
40 | // va_start(ap,format); | |||
|
41 | // vasprintf(str_buffer,format,ap); | |||
|
42 | // va_end(ap); | |||
|
43 | // i=strlen(*str_buffer); | |||
|
44 | // __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)*str_buffer,1,i); | |||
|
45 | // free(*str_buffer); | |||
|
46 | ||||
|
47 | //} | |||
|
48 | ||||
34 | void lcd_print() |
|
49 | void lcd_print() | |
35 | { |
|
50 | { | |
36 | lcd0.paintFilRect(&lcd0,10,10,100,100,0,0,0x0F0F); |
|
51 | lcd0.paintFilRect(&lcd0,10,10,100,100,0,0,0x0F0F); |
@@ -6,7 +6,7 UCMODEL=stm32f4 | |||||
6 |
|
6 | |||
7 | BSP = STM32F4Eval |
|
7 | BSP = STM32F4Eval | |
8 |
|
8 | |||
9 |
DEFINES += CPUFREQ= |
|
9 | DEFINES += CPUFREQ=168000000 | |
10 |
|
10 | |||
11 | SOURCES += \ |
|
11 | SOURCES += \ | |
12 | main.c |
|
12 | main.c |
@@ -47,6 +47,44 void testIOEXPender() | |||||
47 | // printf("Scan for IOEXPANDER:\n\r ID1=%d\n\rID2=%d",stmpe811getID(&ioexp1),stmpe811getID(&ioexp2)); |
|
47 | // printf("Scan for IOEXPANDER:\n\r ID1=%d\n\rID2=%d",stmpe811getID(&ioexp1),stmpe811getID(&ioexp2)); | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
|
50 | int _terminal_writenc(terminal_t* terminal,char* data, int n) | |||
|
51 | { | |||
|
52 | #define CHARXPOS(terminal,charwidth) (((terminal)->column * charwidth) + (terminal)->Xpos) | |||
|
53 | #define CHARYPOS(terminal,charheight) ((terminal)->line * charheight + (terminal)->Ypos+charheight) | |||
|
54 | int charw=terminal->font->Width + terminal->horizontalSpace; | |||
|
55 | int charh=terminal->font->Height + terminal->verticalSpace; | |||
|
56 | int l=0; | |||
|
57 | char buffer[2]=" "; | |||
|
58 | while(l<n) | |||
|
59 | { | |||
|
60 | ||||
|
61 | buffer[0]=data[l]; | |||
|
62 | if(buffer[0]=='\n') | |||
|
63 | { | |||
|
64 | terminal->line= (terminal->line+1) % terminal->lineCount; | |||
|
65 | terminal->column = 0; | |||
|
66 | // if(terminal->line==0) | |||
|
67 | // terminal_clear(terminal); | |||
|
68 | // else | |||
|
69 | // terminal_clearCurentLine(terminal); | |||
|
70 | }else { | |||
|
71 | if(buffer[0]=='\t') | |||
|
72 | { | |||
|
73 | for(int i=0;i<1;i++)terminal_movecursor(terminal,1); | |||
|
74 | } | |||
|
75 | // else | |||
|
76 | // if(terminal->column==0)terminal_clearCurentLine(terminal); | |||
|
77 | if(buffer[0]!='\r'){ | |||
|
78 | // terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal, charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor); | |||
|
79 | terminal->LCD->paintText(terminal->LCD,buffer,CHARXPOS(terminal,charw),(CHARYPOS(terminal, charh))-(terminal->verticalSpace/2),terminal->font,terminal->textColor); | |||
|
80 | terminal_movecursor(terminal,1); | |||
|
81 | } | |||
|
82 | } | |||
|
83 | l++; | |||
|
84 | } | |||
|
85 | return n; | |||
|
86 | } | |||
|
87 | ||||
50 | int main() |
|
88 | int main() | |
51 | { |
|
89 | { | |
52 | delay_100us(10000); |
|
90 | delay_100us(10000); | |
@@ -70,17 +108,12 int main() | |||||
70 | printf("Column cnt :\n \t%d\n",terminal0.columnCount); |
|
108 | printf("Column cnt :\n \t%d\n",terminal0.columnCount); | |
71 | printf("CPU Freq :\n \t%dMHz\n",getCpuFreq()/1000000); |
|
109 | printf("CPU Freq :\n \t%dMHz\n",getCpuFreq()/1000000); | |
72 | //testAudioDAC(); |
|
110 | //testAudioDAC(); | |
73 | testIOEXPender(); |
|
111 | for(int i=0;i<240;i++) | |
74 | while(1) |
|
|||
75 | { |
|
112 | { | |
76 | i%=1000; |
|
113 | lcd0.paintFilRect(&lcd0,i,0,1,320,0,0,i); | |
77 | //terminal->write(&terminal," Hi",1, 2); |
|
|||
78 | //delay_100us(1000); |
|
|||
79 | gpioset(LED1); |
|
|||
80 | //delay_100us(1000); |
|
|||
81 | gpioclr(LED1); |
|
|||
82 | } |
|
114 | } | |
83 | printf("hello world\n\r"); |
|
115 | lcd0.paintText(&lcd0,"A",100,100,&ComicSansMS_24,0); | |
|
116 | while(1)_terminal_writenc(&terminal0,"test ",5); | |||
84 | return 0; |
|
117 | return 0; | |
85 | } |
|
118 | } | |
86 |
|
119 |
@@ -19,11 +19,13 | |||||
19 | -- Author : Alexis Jeandet |
|
19 | -- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@member.fsf.org |
|
20 | -- Mail : alexis.jeandet@member.fsf.org | |
21 | -------------------------------------------------------------------------------*/ |
|
21 | -------------------------------------------------------------------------------*/ | |
|
22 | #define _PRVATE_ILI9328_ | |||
22 | #include <ili9328.h> |
|
23 | #include <ili9328.h> | |
23 | #include <stdio.h> |
|
24 | #include <stdio.h> | |
24 | #include <stddef.h> |
|
25 | #include <stddef.h> | |
25 | #include <core.h> |
|
26 | #include <core.h> | |
26 | #include <math.h> |
|
27 | #include <math.h> | |
|
28 | #include <stdint.h> | |||
27 |
|
29 | |||
28 | #ifdef __OPTIMIZED_MATH |
|
30 | #ifdef __OPTIMIZED_MATH | |
29 | #include <optimised_math.h> |
|
31 | #include <optimised_math.h> | |
@@ -341,7 +343,8 void ili9328paintText(LCD_t* LCD,char* b | |||||
341 | if(*buffer<32)*buffer=32; |
|
343 | if(*buffer<32)*buffer=32; | |
342 | if(*buffer>127)*buffer=32; |
|
344 | if(*buffer>127)*buffer=32; | |
343 | ili9328setFrame(LCD,Xpos+(charnum*w),Ypos-h,w,1); |
|
345 | ili9328setFrame(LCD,Xpos+(charnum*w),Ypos-h,w,1); | |
344 | LCD->interface->readGRAM(tmp,w); |
|
346 | // LCD->interface->readGRAM(tmp,w); | |
|
347 | ili9328getPix(LCD,tmp,Xpos+(charnum*w),Ypos-h,w,1); | |||
345 | for(int i=0;i<(h*w);i++) |
|
348 | for(int i=0;i<(h*w);i++) | |
346 | { |
|
349 | { | |
347 | if( ((i%w)==0) ) //read current line to apply text pixmap |
|
350 | if( ((i%w)==0) ) //read current line to apply text pixmap | |
@@ -351,7 +354,8 void ili9328paintText(LCD_t* LCD,char* b | |||||
351 | ili9328setFrame(LCD,Xpos+(charnum*w),Ypos + linenum -h,w,1); |
|
354 | ili9328setFrame(LCD,Xpos+(charnum*w),Ypos + linenum -h,w,1); | |
352 | LCD->interface->writeGRAM(tmp,w); |
|
355 | LCD->interface->writeGRAM(tmp,w); | |
353 | ili9328setFrame(LCD,Xpos+(charnum*w),Ypos + linenum + 1-h,w,1); |
|
356 | ili9328setFrame(LCD,Xpos+(charnum*w),Ypos + linenum + 1-h,w,1); | |
354 | LCD->interface->readGRAM(tmp,w); |
|
357 | // LCD->interface->readGRAM(tmp,w); | |
|
358 | ili9328getPix(LCD,tmp,Xpos+(charnum*w),Ypos + linenum + 1-h,w,1); | |||
355 | pix=0; |
|
359 | pix=0; | |
356 | } |
|
360 | } | |
357 | } |
|
361 | } | |
@@ -419,4 +423,60 int ili9328init(struct LCD_t* LCD) | |||||
419 | return 0; |
|
423 | return 0; | |
420 | } |
|
424 | } | |
421 |
|
425 | |||
|
426 | void ili9328cpFrame(LCD_t* LCD,void* buffer,int x,int y,int w, int h) | |||
|
427 | { | |||
|
428 | #define __set__Address__(_x_,_y_) LCD->interface->writereg(ILI9328_REGISTER_HORIZONTALGRAMADDRESSSET,_x_); \ | |||
|
429 | LCD->interface->writereg(ILI9328_REGISTER_VERTICALGRAMADDRESSSET,_y_) | |||
422 |
|
430 | |||
|
431 | uint16_t* castedBuff = (uint16_t*)buffer; | |||
|
432 | int cx=x,cy=y; | |||
|
433 | for(int i=0;i<(w*h);i++) | |||
|
434 | { | |||
|
435 | __set__Address__(cx,cy); | |||
|
436 | LCD->interface->readGRAM((void*)(&castedBuff[i]),1); | |||
|
437 | cx+=1; | |||
|
438 | if(cx>=(w+x)) | |||
|
439 | { | |||
|
440 | cx=x; | |||
|
441 | cy+=1; | |||
|
442 | } | |||
|
443 | } | |||
|
444 | } | |||
|
445 | ||||
|
446 | ||||
|
447 | ||||
|
448 | void ili9328getPix(struct LCD_t* LCD,uint16_t* buffer,uint16_t Xpos,uint16_t Ypos,uint16_t w,uint16_t h) | |||
|
449 | { | |||
|
450 | #define __set__Address__(_x_,_y_) LCD->interface->writereg(ILI9328_REGISTER_HORIZONTALGRAMADDRESSSET,_x_); \ | |||
|
451 | LCD->interface->writereg(ILI9328_REGISTER_VERTICALGRAMADDRESSSET,_y_) | |||
|
452 | ||||
|
453 | uint16_t* castedBuff = (uint16_t*)buffer; | |||
|
454 | int cx=Xpos,cy=Ypos; | |||
|
455 | for(int i=0;i<(w*h);i++) | |||
|
456 | { | |||
|
457 | __set__Address__(cx,cy); | |||
|
458 | LCD->interface->readGRAM((void*)(&castedBuff[i]),1); | |||
|
459 | cx+=1; | |||
|
460 | if(cx>=(w+Xpos)) | |||
|
461 | { | |||
|
462 | cx=Xpos; | |||
|
463 | cy+=1; | |||
|
464 | } | |||
|
465 | } | |||
|
466 | ||||
|
467 | } | |||
|
468 | ||||
|
469 | ||||
|
470 | ||||
|
471 | ||||
|
472 | ||||
|
473 | ||||
|
474 | ||||
|
475 | ||||
|
476 | ||||
|
477 | ||||
|
478 | ||||
|
479 | ||||
|
480 | ||||
|
481 | ||||
|
482 |
@@ -16,3 +16,7 UCMODEL=simulator | |||||
16 | target.path = $$[QT_INSTALL_LIBS]/$$UCMODEL |
|
16 | target.path = $$[QT_INSTALL_LIBS]/$$UCMODEL | |
17 | INSTALLS += target |
|
17 | INSTALLS += target | |
18 |
|
18 | |||
|
19 | HEADERS += \ | |||
|
20 | ../../../../includes/GRAPHIC/CONTROLERS/ili9328.h \ | |||
|
21 | ../../../../includes/GRAPHIC/CONTROLERS/genericLCD_Controler.h | |||
|
22 |
@@ -20,3 +20,6 UCMODEL=stm32f4 | |||||
20 | target.path = $$[QT_INSTALL_LIBS]/$$UCMODEL |
|
20 | target.path = $$[QT_INSTALL_LIBS]/$$UCMODEL | |
21 | INSTALLS += target |
|
21 | INSTALLS += target | |
22 |
|
22 | |||
|
23 | HEADERS += \ | |||
|
24 | ../../../../includes/GRAPHIC/CONTROLERS/ili9328.h | |||
|
25 |
@@ -43,6 +43,7 typedef struct LCD_t | |||||
43 | void (*paint)(struct LCD_t* LCD,void* buffer,uint16_t Xpos,uint16_t Ypos,uint16_t Width,uint16_t Height); |
|
43 | void (*paint)(struct LCD_t* LCD,void* buffer,uint16_t Xpos,uint16_t Ypos,uint16_t Width,uint16_t Height); | |
44 | void (*paintText)(struct LCD_t* LCD,char* buffer,uint16_t Xpos,uint16_t Ypos,sFONT *font,uint32_t color); |
|
44 | void (*paintText)(struct LCD_t* LCD,char* buffer,uint16_t Xpos,uint16_t Ypos,sFONT *font,uint32_t color); | |
45 | void (*paintFilRect)(struct LCD_t* LCD,uint16_t Xpos,uint16_t Ypos,uint16_t w,uint16_t h,uint32_t contColor,uint16_t contSz,uint32_t fillColor); |
|
45 | void (*paintFilRect)(struct LCD_t* LCD,uint16_t Xpos,uint16_t Ypos,uint16_t w,uint16_t h,uint32_t contColor,uint16_t contSz,uint32_t fillColor); | |
|
46 | void (*getPix)(struct LCD_t* LCD,uint16_t* buffer,uint16_t Xpos,uint16_t Ypos,uint16_t w,uint16_t h); | |||
46 | void (*refreshenable)(struct LCD_t* LCD,int enable); |
|
47 | void (*refreshenable)(struct LCD_t* LCD,int enable); | |
47 | uint16_t width; |
|
48 | uint16_t width; | |
48 | uint16_t height; |
|
49 | uint16_t height; |
@@ -27,7 +27,7 | |||||
27 | #include <stdint.h> |
|
27 | #include <stdint.h> | |
28 | #include <fonts.h> |
|
28 | #include <fonts.h> | |
29 |
|
29 | |||
30 | extern int ili9328init(struct LCD_t* LCD); |
|
30 | extern int ili9328init(struct LCD_t* LCD); | |
31 | extern void ili9328setFrame(LCD_t* LCD,uint16_t X,uint16_t Y,uint16_t W,uint16_t H); |
|
31 | extern void ili9328setFrame(LCD_t* LCD,uint16_t X,uint16_t Y,uint16_t W,uint16_t H); | |
32 | extern void ili9328setGRAMaddress(LCD_t* LCD,uint16_t Haddress,uint16_t Vaddress); |
|
32 | extern void ili9328setGRAMaddress(LCD_t* LCD,uint16_t Haddress,uint16_t Vaddress); | |
33 | extern void ili9328paint(LCD_t* LCD,void* buffer,uint16_t Xpos,uint16_t Ypos,uint16_t Width,uint16_t Height); |
|
33 | extern void ili9328paint(LCD_t* LCD,void* buffer,uint16_t Xpos,uint16_t Ypos,uint16_t Width,uint16_t Height); | |
@@ -35,59 +35,63 extern void ili9328paintText(LCD_t* LCD, | |||||
35 | extern void ili9328paintFilRect(LCD_t* LCD,uint16_t Xpos,uint16_t Ypos,uint16_t w,uint16_t h,uint32_t contColor,uint16_t contSz,uint32_t fillColor); |
|
35 | extern void ili9328paintFilRect(LCD_t* LCD,uint16_t Xpos,uint16_t Ypos,uint16_t w,uint16_t h,uint32_t contColor,uint16_t contSz,uint32_t fillColor); | |
36 | extern void ili9328paintFilCirc(LCD_t* LCD,uint16_t Xpos,uint16_t Ypos,uint16_t r,uint32_t contColor,uint16_t contSz,uint32_t fillColor); |
|
36 | extern void ili9328paintFilCirc(LCD_t* LCD,uint16_t Xpos,uint16_t Ypos,uint16_t r,uint32_t contColor,uint16_t contSz,uint32_t fillColor); | |
37 | extern void ili9328paintFilCircMidPoint(LCD_t* LCD,uint16_t Xpos,uint16_t Ypos,uint16_t r,uint32_t contColor,uint16_t contSz,uint32_t fillColor); |
|
37 | extern void ili9328paintFilCircMidPoint(LCD_t* LCD,uint16_t Xpos,uint16_t Ypos,uint16_t r,uint32_t contColor,uint16_t contSz,uint32_t fillColor); | |
|
38 | extern void ili9328getPix(struct LCD_t* LCD,uint16_t* buffer,uint16_t Xpos,uint16_t Ypos,uint16_t w,uint16_t h); | |||
38 | extern void ili9328refreshenable(struct LCD_t* LCD,int enable); |
|
39 | extern void ili9328refreshenable(struct LCD_t* LCD,int enable); | |
39 |
|
40 | |||
40 |
#define ILI9328_REGISTER_DRIVERCODEREAD |
|
41 | #define ILI9328_REGISTER_DRIVERCODEREAD ((uint32_t) 0x0000 ) | |
41 |
#define ILI9328_REGISTER_DRIVEROUTPUTCONTROL1 |
|
42 | #define ILI9328_REGISTER_DRIVEROUTPUTCONTROL1 ((uint32_t) 0x0001 ) | |
42 |
#define ILI9328_REGISTER_LCDDRIVINGCONTROL |
|
43 | #define ILI9328_REGISTER_LCDDRIVINGCONTROL ((uint32_t) 0x0002 ) | |
43 |
#define ILI9328_REGISTER_ENTRYMODE |
|
44 | #define ILI9328_REGISTER_ENTRYMODE ((uint32_t) 0x0003 ) | |
44 |
#define ILI9328_REGISTER_RESIZECONTROL |
|
45 | #define ILI9328_REGISTER_RESIZECONTROL ((uint32_t) 0x0004 ) | |
45 |
#define ILI9328_REGISTER_DISPLAYCONTROL1 |
|
46 | #define ILI9328_REGISTER_DISPLAYCONTROL1 ((uint32_t) 0x0007 ) | |
46 |
#define ILI9328_REGISTER_DISPLAYCONTROL2 |
|
47 | #define ILI9328_REGISTER_DISPLAYCONTROL2 ((uint32_t) 0x0008 ) | |
47 |
#define ILI9328_REGISTER_DISPLAYCONTROL3 |
|
48 | #define ILI9328_REGISTER_DISPLAYCONTROL3 ((uint32_t) 0x0009 ) | |
48 |
#define ILI9328_REGISTER_DISPLAYCONTROL4 |
|
49 | #define ILI9328_REGISTER_DISPLAYCONTROL4 ((uint32_t) 0x000A ) | |
49 |
#define ILI9328_REGISTER_RGBDISPLAYINTERFACECONTROL1 |
|
50 | #define ILI9328_REGISTER_RGBDISPLAYINTERFACECONTROL1 ((uint32_t) 0x000C ) | |
50 |
#define ILI9328_REGISTER_FRAMEMAKERPOSITION |
|
51 | #define ILI9328_REGISTER_FRAMEMAKERPOSITION ((uint32_t) 0x000D ) | |
51 |
#define ILI9328_REGISTER_RGBDISPLAYINTERFACECONTROL2 |
|
52 | #define ILI9328_REGISTER_RGBDISPLAYINTERFACECONTROL2 ((uint32_t) 0x000F ) | |
52 |
#define ILI9328_REGISTER_POWERCONTROL1 |
|
53 | #define ILI9328_REGISTER_POWERCONTROL1 ((uint32_t) 0x0010 ) | |
53 |
#define ILI9328_REGISTER_POWERCONTROL2 |
|
54 | #define ILI9328_REGISTER_POWERCONTROL2 ((uint32_t) 0x0011 ) | |
54 |
#define ILI9328_REGISTER_POWERCONTROL3 |
|
55 | #define ILI9328_REGISTER_POWERCONTROL3 ((uint32_t) 0x0012 ) | |
55 |
#define ILI9328_REGISTER_POWERCONTROL4 |
|
56 | #define ILI9328_REGISTER_POWERCONTROL4 ((uint32_t) 0x0013 ) | |
56 |
#define ILI9328_REGISTER_HORIZONTALGRAMADDRESSSET |
|
57 | #define ILI9328_REGISTER_HORIZONTALGRAMADDRESSSET ((uint32_t) 0x0020 ) | |
57 |
#define ILI9328_REGISTER_VERTICALGRAMADDRESSSET |
|
58 | #define ILI9328_REGISTER_VERTICALGRAMADDRESSSET ((uint32_t) 0x0021 ) | |
58 |
#define ILI9328_REGISTER_WRITEDATATOGRAM |
|
59 | #define ILI9328_REGISTER_WRITEDATATOGRAM ((uint32_t) 0x0022 ) | |
59 |
#define ILI9328_REGISTER_POWERCONTROL7 |
|
60 | #define ILI9328_REGISTER_POWERCONTROL7 ((uint32_t) 0x0029 ) | |
60 |
#define ILI9328_REGISTER_FRAMERATEANDCOLORCONTROL |
|
61 | #define ILI9328_REGISTER_FRAMERATEANDCOLORCONTROL ((uint32_t) 0x002B ) | |
61 |
#define ILI9328_REGISTER_GAMMACONTROL1 |
|
62 | #define ILI9328_REGISTER_GAMMACONTROL1 ((uint32_t) 0x0030 ) | |
62 |
#define ILI9328_REGISTER_GAMMACONTROL2 |
|
63 | #define ILI9328_REGISTER_GAMMACONTROL2 ((uint32_t) 0x0031 ) | |
63 |
#define ILI9328_REGISTER_GAMMACONTROL3 |
|
64 | #define ILI9328_REGISTER_GAMMACONTROL3 ((uint32_t) 0x0032 ) | |
64 |
#define ILI9328_REGISTER_GAMMACONTROL4 |
|
65 | #define ILI9328_REGISTER_GAMMACONTROL4 ((uint32_t) 0x0035 ) | |
65 |
#define ILI9328_REGISTER_GAMMACONTROL5 |
|
66 | #define ILI9328_REGISTER_GAMMACONTROL5 ((uint32_t) 0x0036 ) | |
66 |
#define ILI9328_REGISTER_GAMMACONTROL6 |
|
67 | #define ILI9328_REGISTER_GAMMACONTROL6 ((uint32_t) 0x0037 ) | |
67 |
#define ILI9328_REGISTER_GAMMACONTROL7 |
|
68 | #define ILI9328_REGISTER_GAMMACONTROL7 ((uint32_t) 0x0038 ) | |
68 |
#define ILI9328_REGISTER_GAMMACONTROL8 |
|
69 | #define ILI9328_REGISTER_GAMMACONTROL8 ((uint32_t) 0x0039 ) | |
69 |
#define ILI9328_REGISTER_GAMMACONTROL9 |
|
70 | #define ILI9328_REGISTER_GAMMACONTROL9 ((uint32_t) 0x003C ) | |
70 |
#define ILI9328_REGISTER_GAMMACONTROL10 |
|
71 | #define ILI9328_REGISTER_GAMMACONTROL10 ((uint32_t) 0x003D ) | |
71 |
#define ILI9328_REGISTER_HORIZONTALADDRESSSTARTPOSITION ((uint32_t) 0x0050 |
|
72 | #define ILI9328_REGISTER_HORIZONTALADDRESSSTARTPOSITION ((uint32_t) 0x0050 ) | |
72 |
#define ILI9328_REGISTER_HORIZONTALADDRESSENDPOSITION ((uint32_t) |
|
73 | #define ILI9328_REGISTER_HORIZONTALADDRESSENDPOSITION ((uint32_t) 0x0051 ) | |
73 |
#define ILI9328_REGISTER_VERTICALADDRESSSTARTPOSITION ((uint32_t) |
|
74 | #define ILI9328_REGISTER_VERTICALADDRESSSTARTPOSITION ((uint32_t) 0x0052 ) | |
74 |
#define ILI9328_REGISTER_VERTICALADDRESSENDPOSITION |
|
75 | #define ILI9328_REGISTER_VERTICALADDRESSENDPOSITION ((uint32_t) 0x0053 ) | |
75 |
#define ILI9328_REGISTER_DRIVEROUTPUTCONTROL2 |
|
76 | #define ILI9328_REGISTER_DRIVEROUTPUTCONTROL2 ((uint32_t) 0x0060 ) | |
76 |
#define ILI9328_REGISTER_BASEIMAGEDISPLAYCONTROL |
|
77 | #define ILI9328_REGISTER_BASEIMAGEDISPLAYCONTROL ((uint32_t) 0x0061 ) | |
77 |
#define ILI9328_REGISTER_VERTICALSCROLLCONTROL |
|
78 | #define ILI9328_REGISTER_VERTICALSCROLLCONTROL ((uint32_t) 0x006A ) | |
78 |
#define ILI9328_REGISTER_PARTIALIMAGE1DISPLAYPOSITION |
|
79 | #define ILI9328_REGISTER_PARTIALIMAGE1DISPLAYPOSITION ((uint32_t) 0x0080 ) | |
79 |
#define ILI9328_REGISTER_PARTIALIMAGE1AREASTARTLINE |
|
80 | #define ILI9328_REGISTER_PARTIALIMAGE1AREASTARTLINE ((uint32_t) 0x0081 ) | |
80 |
#define ILI9328_REGISTER_PARTIALIMAGE1AREAENDLINE |
|
81 | #define ILI9328_REGISTER_PARTIALIMAGE1AREAENDLINE ((uint32_t) 0x0082 ) | |
81 |
#define ILI9328_REGISTER_PARTIALIMAGE2DISPLAYPOSITION |
|
82 | #define ILI9328_REGISTER_PARTIALIMAGE2DISPLAYPOSITION ((uint32_t) 0x0083 ) | |
82 |
#define ILI9328_REGISTER_PARTIALIMAGE2AREASTARTLINE |
|
83 | #define ILI9328_REGISTER_PARTIALIMAGE2AREASTARTLINE ((uint32_t) 0x0084 ) | |
83 |
#define ILI9328_REGISTER_PARTIALIMAGE2AREAENDLINE |
|
84 | #define ILI9328_REGISTER_PARTIALIMAGE2AREAENDLINE ((uint32_t) 0x0085 ) | |
84 |
#define ILI9328_REGISTER_PANELINTERFACECONTROL1 |
|
85 | #define ILI9328_REGISTER_PANELINTERFACECONTROL1 ((uint32_t) 0x0090 ) | |
85 |
#define ILI9328_REGISTER_PANELINTERFACECONTROL2 |
|
86 | #define ILI9328_REGISTER_PANELINTERFACECONTROL2 ((uint32_t) 0x0092 ) | |
86 |
#define ILI9328_REGISTER_PANELINTERFACECONTROL4 |
|
87 | #define ILI9328_REGISTER_PANELINTERFACECONTROL4 ((uint32_t) 0x0095 ) | |
87 |
#define ILI9328_REGISTER_OTPVCMPROGRAMMINGCONTROL |
|
88 | #define ILI9328_REGISTER_OTPVCMPROGRAMMINGCONTROL ((uint32_t) 0x00A1 ) | |
88 |
#define ILI9328_REGISTER_OTPVCMSTATUSANDENABLE |
|
89 | #define ILI9328_REGISTER_OTPVCMSTATUSANDENABLE ((uint32_t) 0x00A2 ) | |
89 |
#define ILI9328_REGISTER_OTPPROGRAMMINGIDKEY |
|
90 | #define ILI9328_REGISTER_OTPPROGRAMMINGIDKEY ((uint32_t) 0x00A5 ) | |
90 |
|
91 | |||
|
92 | #ifdef _PRVATE_ILI9328_ | |||
|
93 | void ili9328cpFrame(LCD_t* LCD,void* buffer,int x,int y,int w, int h); | |||
|
94 | #endif | |||
91 |
|
95 | |||
92 | #endif |
|
96 | #endif | |
93 |
|
97 |
@@ -79,21 +79,27 void SDLCD_writereg(uint32_t reg,uint32_ | |||||
79 | { |
|
79 | { | |
80 | switch (reg) { |
|
80 | switch (reg) { | |
81 | case ILI9328_REGISTER_HORIZONTALGRAMADDRESSSET: |
|
81 | case ILI9328_REGISTER_HORIZONTALGRAMADDRESSSET: | |
|
82 | if((data>=screen->w) || (data<0))printf("Warning printing out of bounds HORIZONTALGRAMADDRESSSET=%d",data); | |||
82 | SDLCD_Xpos = data; |
|
83 | SDLCD_Xpos = data; | |
83 | break; |
|
84 | break; | |
84 | case ILI9328_REGISTER_VERTICALGRAMADDRESSSET: |
|
85 | case ILI9328_REGISTER_VERTICALGRAMADDRESSSET: | |
|
86 | if((data>=screen->h) || (data<0))printf("Warning printing out of bounds ILI9328_REGISTER_VERTICALGRAMADDRESSSET=%d",data); | |||
85 | SDLCD_Ypos = data; |
|
87 | SDLCD_Ypos = data; | |
86 | break; |
|
88 | break; | |
87 | case ILI9328_REGISTER_HORIZONTALADDRESSSTARTPOSITION: |
|
89 | case ILI9328_REGISTER_HORIZONTALADDRESSSTARTPOSITION: | |
|
90 | if((data>=screen->w) || (data<0))printf("Warning printing out of bounds ILI9328_REGISTER_HORIZONTALADDRESSSTARTPOSITION=%d",data); | |||
88 | SDLCD_XWinStrt = data; |
|
91 | SDLCD_XWinStrt = data; | |
89 | break; |
|
92 | break; | |
90 | case ILI9328_REGISTER_HORIZONTALADDRESSENDPOSITION: |
|
93 | case ILI9328_REGISTER_HORIZONTALADDRESSENDPOSITION: | |
|
94 | if((data>=screen->w) || (data<0))printf("Warning printing out of bounds ILI9328_REGISTER_HORIZONTALADDRESSENDPOSITION=%d",data); | |||
91 | SDLCD_XWinEnd = data; |
|
95 | SDLCD_XWinEnd = data; | |
92 | break; |
|
96 | break; | |
93 | case ILI9328_REGISTER_VERTICALADDRESSSTARTPOSITION: |
|
97 | case ILI9328_REGISTER_VERTICALADDRESSSTARTPOSITION: | |
|
98 | if((data>=screen->h) || (data<0))printf("Warning printing out of bounds ILI9328_REGISTER_VERTICALADDRESSSTARTPOSITION=%d",data); | |||
94 | SDLCD_YWinStrt = data; |
|
99 | SDLCD_YWinStrt = data; | |
95 | break; |
|
100 | break; | |
96 | case ILI9328_REGISTER_VERTICALADDRESSENDPOSITION: |
|
101 | case ILI9328_REGISTER_VERTICALADDRESSENDPOSITION: | |
|
102 | if((data>=screen->h) || (data<0))printf("Warning printing out of bounds ILI9328_REGISTER_VERTICALADDRESSENDPOSITION=%d",data); | |||
97 | SDLCD_YWinEnd = data; |
|
103 | SDLCD_YWinEnd = data; | |
98 | break; |
|
104 | break; | |
99 | default: |
|
105 | default: |
@@ -44,7 +44,7 contains( TEMPLATE, app ) { | |||||
44 | # OTHER_FILES += $$[QT_INSTALL_PREFIX]/ucfiles/stm32f4/$$CPU/stm32_flash.ld |
|
44 | # OTHER_FILES += $$[QT_INSTALL_PREFIX]/ucfiles/stm32f4/$$CPU/stm32_flash.ld | |
45 |
|
45 | |||
46 | stflash.target = stflash |
|
46 | stflash.target = stflash | |
47 |
stflash.commands = cd $$DESTDIR && |
|
47 | stflash.commands = cd $$DESTDIR && st-flash write $(QMAKE_TARGET).bin 0x08000000 | |
48 | dfu.target = dfu |
|
48 | dfu.target = dfu | |
49 | dfu.commands = cd $$DESTDIR && dfu-util d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D $(QMAKE_TARGET).bin 0x08000000 |
|
49 | dfu.commands = cd $$DESTDIR && dfu-util d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D $(QMAKE_TARGET).bin 0x08000000 | |
50 | QMAKE_EXTRA_TARGETS += stflash dfu |
|
50 | QMAKE_EXTRA_TARGETS += stflash dfu |
General Comments 0
You need to be logged in to leave comments.
Login now