@@ -0,0 +1,37 | |||||
|
1 | /*------------------------------------------------------------------------------ | |||
|
2 | -- This file is a part of the libuc, microcontroler library | |||
|
3 | -- Copyright (C) 2012, 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@gmail.com | |||
|
21 | -------------------------------------------------------------------------------*/ | |||
|
22 | #ifndef OPTIMISED_MATH_H | |||
|
23 | #define OPTIMISED_MATH_H | |||
|
24 | #include <arm_math.h> | |||
|
25 | ||||
|
26 | inline float32_t optimised_sqrt(float32_t value) | |||
|
27 | { | |||
|
28 | float32_t out; | |||
|
29 | arm_sqrt_f32(value,&out); | |||
|
30 | return out; | |||
|
31 | } | |||
|
32 | ||||
|
33 | inline float optimised_sin(float32_t x) | |||
|
34 | { | |||
|
35 | return arm_sin_f32(x); | |||
|
36 | } | |||
|
37 | #endif |
@@ -0,0 +1,57 | |||||
|
1 | # | |||
|
2 | # qmake configuration for stm32f4 | |||
|
3 | # | |||
|
4 | # | |||
|
5 | ||||
|
6 | ||||
|
7 | isEmpty(_simulator_conf){ | |||
|
8 | _simulator_conf="oneshot" | |||
|
9 | ||||
|
10 | QMAKE_CFLAGS= -std=c99 | |||
|
11 | ||||
|
12 | include(../../common/simulator.conf) | |||
|
13 | ||||
|
14 | DEFINES += \"assert_param(expr)=((void)0)\" | |||
|
15 | INCLUDEPATH += $$PWD /usr/include/SDL | |||
|
16 | ||||
|
17 | DEFINES += BSP="\"\\\"$$BSP"\\\"\" | |||
|
18 | ||||
|
19 | CONFIG += cpu | |||
|
20 | ||||
|
21 | contains( TEMPLATE, app ) { | |||
|
22 | OBJECTS_DIR=obj-$$UCMODEL | |||
|
23 | DESTDIR=bin-$$UCMODEL | |||
|
24 | LIBS += -L$$[QT_INSTALL_PREFIX]/bsp/lib/$$BSP | |||
|
25 | LIBS += -lbsp -lSDLCD -lSDL -lz -lm | |||
|
26 | SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/simulator/startup.c | |||
|
27 | SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/simulator/fs.c | |||
|
28 | ||||
|
29 | ||||
|
30 | INCLUDEPATH+= $$[QT_INSTALL_PREFIX]/bsp/includes/$$BSP | |||
|
31 | ||||
|
32 | } | |||
|
33 | ||||
|
34 | contains( TEMPLATE, lib ) { | |||
|
35 | OBJECTS_DIR=obj-$$UCMODEL | |||
|
36 | DESTDIR=bin-$$UCMODEL | |||
|
37 | CONFIG+=staticlib | |||
|
38 | } | |||
|
39 | ||||
|
40 | include(../../common/libuc2libs.conf) | |||
|
41 | ||||
|
42 | } | |||
|
43 | ||||
|
44 | ||||
|
45 | ||||
|
46 | ||||
|
47 | ||||
|
48 | ||||
|
49 | ||||
|
50 | ||||
|
51 | ||||
|
52 | ||||
|
53 | ||||
|
54 | ||||
|
55 | ||||
|
56 | ||||
|
57 |
@@ -0,0 +1,42 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). | |||
|
4 | ** Contact: http://www.qt-project.org/legal | |||
|
5 | ** | |||
|
6 | ** This file is part of the qmake spec of the Qt Toolkit. | |||
|
7 | ** | |||
|
8 | ** $QT_BEGIN_LICENSE:LGPL$ | |||
|
9 | ** Commercial License Usage | |||
|
10 | ** Licensees holding valid commercial Qt licenses may use this file in | |||
|
11 | ** accordance with the commercial license agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. For licensing terms and | |||
|
14 | ** conditions see http://qt.digia.com/licensing. For further information | |||
|
15 | ** use the contact form at http://qt.digia.com/contact-us. | |||
|
16 | ** | |||
|
17 | ** GNU Lesser General Public License Usage | |||
|
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | |||
|
19 | ** General Public License version 2.1 as published by the Free Software | |||
|
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the | |||
|
21 | ** packaging of this file. Please review the following information to | |||
|
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements | |||
|
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | |||
|
24 | ** | |||
|
25 | ** In addition, as a special exception, Digia gives you certain additional | |||
|
26 | ** rights. These rights are described in the Digia Qt LGPL Exception | |||
|
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | |||
|
28 | ** | |||
|
29 | ** GNU General Public License Usage | |||
|
30 | ** Alternatively, this file may be used under the terms of the GNU | |||
|
31 | ** General Public License version 3.0 as published by the Free Software | |||
|
32 | ** Foundation and appearing in the file LICENSE.GPL included in the | |||
|
33 | ** packaging of this file. Please review the following information to | |||
|
34 | ** ensure the GNU General Public License version 3.0 requirements will be | |||
|
35 | ** met: http://www.gnu.org/copyleft/gpl.html. | |||
|
36 | ** | |||
|
37 | ** | |||
|
38 | ** $QT_END_LICENSE$ | |||
|
39 | ** | |||
|
40 | ****************************************************************************/ | |||
|
41 | ||||
|
42 | //#include "../linux-g++/qplatformdefs.h" |
@@ -0,0 +1,37 | |||||
|
1 | /*------------------------------------------------------------------------------ | |||
|
2 | -- This file is a part of the libuc, microcontroler library | |||
|
3 | -- Copyright (C) 2012, 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@gmail.com | |||
|
21 | -------------------------------------------------------------------------------*/ | |||
|
22 | #ifndef OPTIMISED_MATH_H | |||
|
23 | #define OPTIMISED_MATH_H | |||
|
24 | #include <arm_math.h> | |||
|
25 | ||||
|
26 | inline float32_t optimised_sqrt(float32_t value) | |||
|
27 | { | |||
|
28 | float32_t out; | |||
|
29 | arm_sqrt_f32(value,&out); | |||
|
30 | return out; | |||
|
31 | } | |||
|
32 | ||||
|
33 | inline float optimised_sin(float32_t x) | |||
|
34 | { | |||
|
35 | return arm_sin_f32(x); | |||
|
36 | } | |||
|
37 | #endif |
@@ -0,0 +1,77 | |||||
|
1 | # | |||
|
2 | # qmake configuration for stm32f4 | |||
|
3 | # | |||
|
4 | # | |||
|
5 | ||||
|
6 | ||||
|
7 | isEmpty(_stm32f4_conf){ | |||
|
8 | _stm32f4_conf="oneshot" | |||
|
9 | ||||
|
10 | QMAKE_CFLAGS=-mlittle-endian -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c99 | |||
|
11 | ||||
|
12 | include(../../common/arm-none-eabi.conf) | |||
|
13 | ||||
|
14 | DEFINES += __OPTIMIZED_MATH | |||
|
15 | DEFINES += \"assert_param(expr)=((void)0)\" | |||
|
16 | INCLUDEPATH += $$PWD | |||
|
17 | ||||
|
18 | DEFINES += __FPU_PRESENT=1 | |||
|
19 | DEFINES += ARM_MATH_CM4 | |||
|
20 | ||||
|
21 | DEFINES += BSP="\"\\\"$$BSP"\\\"\" | |||
|
22 | ||||
|
23 | CONFIG += cpu | |||
|
24 | ||||
|
25 | contains( TEMPLATE, app ) { | |||
|
26 | OBJECTS_DIR=obj-$$UCMODEL | |||
|
27 | DESTDIR=bin-$$UCMODEL | |||
|
28 | unix:QMAKE_POST_LINK += arm-none-eabi-objcopy -O ihex "$(TARGET)" $$DESTDIR/"$(QMAKE_TARGET).hex" && arm-none-eabi-objcopy -O binary "$(TARGET)" $$DESTDIR/"$(QMAKE_TARGET).bin && python $$[QT_INSTALL_BINS]/dfu.py -b 0x08000000:"$$DESTDIR/"$(QMAKE_TARGET).bin " $$DESTDIR/"$(QMAKE_TARGET).dfu" | |||
|
29 | win32:QMAKE_POST_LINK += arm-none-eabi-objcopy -O ihex "$(DESTDIR_TARGET)" $$DESTDIR/"$(QMAKE_TARGET).hex" && arm-none-eabi-objcopy -O binary "$(DESTDIR_TARGET)" $$DESTDIR/"$(QMAKE_TARGET).bin" | |||
|
30 | ||||
|
31 | LIBS += -L$$[QT_INSTALL_PREFIX]/bsp/lib/$$BSP | |||
|
32 | LIBS += -lbsp | |||
|
33 | ||||
|
34 | ||||
|
35 | QMAKE_LFLAGS= -mlittle-endian -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c99 -T $$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/stm32_flash.ld | |||
|
36 | ||||
|
37 | INCLUDEPATH+= $$[QT_INSTALL_PREFIX]/bsp/includes/$$BSP | |||
|
38 | ||||
|
39 | SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/syscalls.c | |||
|
40 | SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/fs.c | |||
|
41 | SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/startup.s | |||
|
42 | SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/cpuinit.c | |||
|
43 | ||||
|
44 | # OTHER_FILES += $$[QT_INSTALL_PREFIX]/ucfiles/stm32f4/$$CPU/stm32_flash.ld | |||
|
45 | ||||
|
46 | stflash.target = stflash | |||
|
47 | stflash.commands = cd $$DESTDIR && sudo st-flash write $(QMAKE_TARGET).bin 0x08000000 | |||
|
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 | |||
|
50 | QMAKE_EXTRA_TARGETS += stflash dfu | |||
|
51 | } | |||
|
52 | ||||
|
53 | contains( TEMPLATE, lib ) { | |||
|
54 | CONFIG+=staticlib | |||
|
55 | OBJECTS_DIR=obj-$$UCMODEL | |||
|
56 | DESTDIR=bin-$$UCMODEL | |||
|
57 | message( "You can only build static library for stm32f4" ) | |||
|
58 | } | |||
|
59 | ||||
|
60 | include(../../common/libuc2libs.conf) | |||
|
61 | ||||
|
62 | } | |||
|
63 | ||||
|
64 | ||||
|
65 | ||||
|
66 | ||||
|
67 | ||||
|
68 | ||||
|
69 | ||||
|
70 | ||||
|
71 | ||||
|
72 | ||||
|
73 | ||||
|
74 | ||||
|
75 | ||||
|
76 | ||||
|
77 |
@@ -0,0 +1,42 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). | |||
|
4 | ** Contact: http://www.qt-project.org/legal | |||
|
5 | ** | |||
|
6 | ** This file is part of the qmake spec of the Qt Toolkit. | |||
|
7 | ** | |||
|
8 | ** $QT_BEGIN_LICENSE:LGPL$ | |||
|
9 | ** Commercial License Usage | |||
|
10 | ** Licensees holding valid commercial Qt licenses may use this file in | |||
|
11 | ** accordance with the commercial license agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. For licensing terms and | |||
|
14 | ** conditions see http://qt.digia.com/licensing. For further information | |||
|
15 | ** use the contact form at http://qt.digia.com/contact-us. | |||
|
16 | ** | |||
|
17 | ** GNU Lesser General Public License Usage | |||
|
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | |||
|
19 | ** General Public License version 2.1 as published by the Free Software | |||
|
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the | |||
|
21 | ** packaging of this file. Please review the following information to | |||
|
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements | |||
|
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | |||
|
24 | ** | |||
|
25 | ** In addition, as a special exception, Digia gives you certain additional | |||
|
26 | ** rights. These rights are described in the Digia Qt LGPL Exception | |||
|
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | |||
|
28 | ** | |||
|
29 | ** GNU General Public License Usage | |||
|
30 | ** Alternatively, this file may be used under the terms of the GNU | |||
|
31 | ** General Public License version 3.0 as published by the Free Software | |||
|
32 | ** Foundation and appearing in the file LICENSE.GPL included in the | |||
|
33 | ** packaging of this file. Please review the following information to | |||
|
34 | ** ensure the GNU General Public License version 3.0 requirements will be | |||
|
35 | ** met: http://www.gnu.org/copyleft/gpl.html. | |||
|
36 | ** | |||
|
37 | ** | |||
|
38 | ** $QT_END_LICENSE$ | |||
|
39 | ** | |||
|
40 | ****************************************************************************/ | |||
|
41 | ||||
|
42 | //#include "../linux-g++/qplatformdefs.h" |
@@ -457,8 +457,8 void bsp_lcd0_writeGRAM(void* buffer,uin | |||||
457 |
|
457 | |||
458 | void bsp_lcd0_readGRAM(void* buffer,uint32_t count) |
|
458 | void bsp_lcd0_readGRAM(void* buffer,uint32_t count) | |
459 | { |
|
459 | { | |
460 |
|
|
460 | uint32_t reg =ILI9328_REGISTER_WRITEDATATOGRAM; | |
461 |
|
|
461 | uint8_t* pt8 = (uint8_t*)(void*)® | |
462 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ |
|
462 | #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | |
463 | *lcd0_CMD=pt8[3]; |
|
463 | *lcd0_CMD=pt8[3]; | |
464 | *lcd0_CMD=pt8[2]; |
|
464 | *lcd0_CMD=pt8[2]; | |
@@ -474,21 +474,31 void bsp_lcd0_readGRAM(void* buffer,uint | |||||
474 | pt8[2*i]=*lcd0_DATA; |
|
474 | pt8[2*i]=*lcd0_DATA; | |
475 | } |
|
475 | } | |
476 | #else |
|
476 | #else | |
477 |
|
|
477 | *lcd0_CMD=pt8[1]; | |
478 |
|
|
478 | *lcd0_CMD=pt8[0]; | |
479 |
|
|
479 | pt8 = (uint8_t*)(void*)buffer; | |
480 |
|
|
480 | for(int i=0;i<(int)count;i++) | |
481 |
|
|
481 | { | |
482 |
|
|
482 | pt8[(2*i) +1]=*lcd0_DATA; | |
483 |
|
|
483 | __asm__("nop"); | |
484 |
|
|
484 | __asm__("nop"); | |
485 |
|
|
485 | __asm__("nop"); | |
486 |
|
|
486 | __asm__("nop"); | |
487 |
|
|
487 | __asm__("nop"); | |
488 | // pt8[2*i]=*lcd0_DATA; |
|
488 | __asm__("nop"); | |
489 | //pt8[(2*i) +1]=(uint8_t)0; |
|
489 | __asm__("nop"); | |
490 | //pt8[(2*i)]=(uint8_t)0; |
|
490 | __asm__("nop"); | |
491 | // } |
|
491 | __asm__("nop"); | |
|
492 | __asm__("nop"); | |||
|
493 | pt8[2*i]=*lcd0_DATA; | |||
|
494 | __asm__("nop"); | |||
|
495 | __asm__("nop"); | |||
|
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 | } | |||
492 | #endif |
|
502 | #endif | |
493 | } |
|
503 | } | |
494 |
|
504 |
@@ -5,7 +5,7 CONFIG += cpu | |||||
5 | UCMODEL=stm32f4 |
|
5 | UCMODEL=stm32f4 | |
6 | BSP = OPLAYER |
|
6 | BSP = OPLAYER | |
7 |
|
7 | |||
8 | DEFINES += CPUFREQ=10000000 |
|
8 | DEFINES += CPUFREQ=160000000 | |
9 |
|
9 | |||
10 |
|
10 | |||
11 | SOURCES += \ |
|
11 | SOURCES += \ |
@@ -87,11 +87,11 void playFile(ucdirent* file,FAT32fs* pa | |||||
87 | uint32_t fileLba,nextLba; |
|
87 | uint32_t fileLba,nextLba; | |
88 | int i=0; |
|
88 | int i=0; | |
89 | fat32getdirentname(file,direntName); |
|
89 | fat32getdirentname(file,direntName); | |
90 | gpioset(LCD_BACKL); |
|
90 | //gpioset(LCD_BACKL); | |
91 |
|
|
91 | printf("%s\n",direntName); | |
92 | nextLba=fat32getdirentlba(file); |
|
92 | nextLba=fat32getdirentlba(file); | |
93 | //printf("Streaming File\n"); |
|
93 | //printf("Streaming File\n"); | |
94 | gpioclr(LCD_BACKL); |
|
94 | //gpioclr(LCD_BACKL); | |
95 | do |
|
95 | do | |
96 | { |
|
96 | { | |
97 | fileLba = nextLba; |
|
97 | fileLba = nextLba; | |
@@ -134,7 +134,7 void playAllparts() | |||||
134 | } |
|
134 | } | |
135 | } |
|
135 | } | |
136 |
|
136 | |||
137 | int main() |
|
137 | int main2() | |
138 | { |
|
138 | { | |
139 | delay_100us(30000); |
|
139 | delay_100us(30000); | |
140 | int i=0; |
|
140 | int i=0; | |
@@ -181,13 +181,10 int main() | |||||
181 | while(1); |
|
181 | while(1); | |
182 | } |
|
182 | } | |
183 |
|
183 | |||
184 |
int main |
|
184 | int main() | |
185 | { |
|
185 | { | |
186 | extern terminal_t terminal0; |
|
186 | extern terminal_t terminal0; | |
187 | extern volatile vs10XXDev audioCodec0; |
|
187 | extern volatile vs10XXDev audioCodec0; | |
188 | lcd0.paintText(&lcd0,"hello",20,50,&ComicSansMS_18 ,0xF0F0); |
|
|||
189 | while (1) |
|
|||
190 | randTextDemo(); |
|
|||
191 | printf("Volume=0x%x\n",vs10XXcmdread(&audioCodec0,VSVOL)); |
|
188 | printf("Volume=0x%x\n",vs10XXcmdread(&audioCodec0,VSVOL)); | |
192 | vs10XXcmdwrite(&audioCodec0,VSCLOCKF,0x2000); |
|
189 | vs10XXcmdwrite(&audioCodec0,VSCLOCKF,0x2000); | |
193 | delay_100us(1000); |
|
190 | delay_100us(1000); | |
@@ -195,7 +192,7 int main2() | |||||
195 | printf("VSCLOCKF=0x%x\n",vs10XXcmdread(&audioCodec0,VSCLOCKF)); |
|
192 | printf("VSCLOCKF=0x%x\n",vs10XXcmdread(&audioCodec0,VSCLOCKF)); | |
196 | printf("VSMODE=0x%x\n",vs10XXcmdread(&audioCodec0,VSMODE)); |
|
193 | printf("VSMODE=0x%x\n",vs10XXcmdread(&audioCodec0,VSMODE)); | |
197 | //terminal_clear(&terminal0); |
|
194 | //terminal_clear(&terminal0); | |
198 | gpioclr(LCD_BACKL); |
|
195 | // gpioclr(LCD_BACKL); | |
199 | playAllparts(); |
|
196 | playAllparts(); | |
200 | return 0; |
|
197 | return 0; | |
201 | } |
|
198 | } |
@@ -37,7 +37,7 void lcd_print() | |||||
37 | // __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)"hello",1,5); |
|
37 | // __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)"hello",1,5); | |
38 | } |
|
38 | } | |
39 |
|
39 | |||
40 |
int libuc |
|
40 | int libuc_main() | |
41 | { |
|
41 | { | |
42 | char in[255]; |
|
42 | char in[255]; | |
43 | lcd_print(); |
|
43 | lcd_print(); |
@@ -15,5 +15,6 target.path = $$[QT_INSTALL_LIBS]/$$UCMO | |||||
15 | INSTALLS += target |
|
15 | INSTALLS += target | |
16 |
|
16 | |||
17 | HEADERS += \ |
|
17 | HEADERS += \ | |
18 | ../../../includes/sdcard.h |
|
18 | ../../../includes/sdcard.h \ | |
|
19 | ../../../includes/sdcard-spi.h | |||
19 |
|
20 |
@@ -359,7 +359,7 void ili9328paintText(LCD_t* LCD,char* b | |||||
359 | { |
|
359 | { | |
360 | line=font->table[(((*buffer)-32)*h*bpl)+tableoffset++]; |
|
360 | line=font->table[(((*buffer)-32)*h*bpl)+tableoffset++]; | |
361 | } |
|
361 | } | |
362 | tmp[pix]=0; |
|
362 | //tmp[pix]=0; | |
363 | if((line & (uint8_t)0x01)==(uint8_t)1)tmp[pix]=(uint16_t)color; |
|
363 | if((line & (uint8_t)0x01)==(uint8_t)1)tmp[pix]=(uint16_t)color; | |
364 | pix++; |
|
364 | pix++; | |
365 | line>>=1; |
|
365 | line>>=1; |
@@ -51,7 +51,7 int terminal_init(terminal_t* terminal,L | |||||
51 | int charw=terminal->font->Width + terminal->horizontalSpace; |
|
51 | int charw=terminal->font->Width + terminal->horizontalSpace; | |
52 | int charh=terminal->font->Height + terminal->verticalSpace; |
|
52 | int charh=terminal->font->Height + terminal->verticalSpace; | |
53 | terminal->textColor=0xFFFF; |
|
53 | terminal->textColor=0xFFFF; | |
54 |
terminal->backgroundColor=0x |
|
54 | terminal->backgroundColor=0xF00F; | |
55 | terminal_setgeometry(terminal,5,5,terminal->LCD->width-(10),terminal->LCD->height-(10)); |
|
55 | terminal_setgeometry(terminal,5,5,terminal->LCD->width-(10),terminal->LCD->height-(10)); | |
56 | strdev->_stream = (UHANDLE)terminal; |
|
56 | strdev->_stream = (UHANDLE)terminal; | |
57 | strdev->ops = &TERMINAL_OPS; |
|
57 | strdev->ops = &TERMINAL_OPS; | |
@@ -112,28 +112,20 void terminal_settextColor(terminal_t* t | |||||
112 |
|
112 | |||
113 | void terminal_movecursor(terminal_t* terminal,int n) |
|
113 | void terminal_movecursor(terminal_t* terminal,int n) | |
114 | { |
|
114 | { | |
115 | int charw=terminal->font->Width + terminal->horizontalSpace; |
|
|||
116 | int charh=terminal->font->Height + terminal->verticalSpace; |
|
|||
117 | terminal->column += n; |
|
115 | terminal->column += n; | |
118 | if(terminal->column>(terminal->columnCount)) |
|
116 | if(terminal->column>(terminal->columnCount)) | |
119 | { |
|
117 | { | |
120 | terminal->line += (terminal->column)/terminal->columnCount; |
|
118 | terminal->line += (terminal->column)/terminal->columnCount; | |
121 | terminal->line = terminal->line % terminal->lineCount; |
|
119 | terminal->line = terminal->line % terminal->lineCount; | |
122 | terminal->column = (terminal->column % terminal->columnCount)-1; |
|
120 | terminal->column = (terminal->column % terminal->columnCount)-1; | |
123 | int x=CHARXPOS(terminal, charw); |
|
|||
124 | int y=CHARYPOS(terminal,charh)-charh; |
|
|||
125 | int w=charw*(terminal->columnCount-terminal->column); |
|
|||
126 | int h=charh; |
|
|||
127 | //terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal, charw),CHARYPOS(terminal,charh)-charh,charw*(terminal->columnCount-terminal->column-1),charh,terminal->backgroundColor,0,terminal->backgroundColor); |
|
|||
128 | } |
|
121 | } | |
129 | //terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal,charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor); |
|
|||
130 | } |
|
122 | } | |
131 |
|
123 | |||
132 | void terminal_clearCurentLine(terminal_t* terminal) |
|
124 | void terminal_clearCurentLine(terminal_t* terminal) | |
133 | { |
|
125 | { | |
134 | int charw=terminal->font->Width + terminal->horizontalSpace; |
|
126 | int charw=terminal->font->Width + terminal->horizontalSpace; | |
135 | int charh=terminal->font->Height + terminal->verticalSpace; |
|
127 | int charh=terminal->font->Height + terminal->verticalSpace; | |
136 |
|
|
128 | terminal->LCD->paintFilRect(terminal->LCD,terminal->Xpos,CHARYPOS(terminal, charh)-charh,terminal->width,charh,terminal->backgroundColor,0,terminal->backgroundColor); | |
137 | } |
|
129 | } | |
138 |
|
130 | |||
139 | int terminal_writenc(terminal_t* terminal,char* data, int n) |
|
131 | int terminal_writenc(terminal_t* terminal,char* data, int n) | |
@@ -162,7 +154,7 int terminal_writenc(terminal_t* termina | |||||
162 | if(terminal->column==0)terminal_clearCurentLine(terminal); |
|
154 | if(terminal->column==0)terminal_clearCurentLine(terminal); | |
163 | if(buffer[0]!='\r'){ |
|
155 | if(buffer[0]!='\r'){ | |
164 | // terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal, charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor); |
|
156 | // terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal, charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor); | |
165 | terminal->LCD->paintText(terminal->LCD,buffer,CHARXPOS(terminal,charw),CHARYPOS(terminal, charh),terminal->font,terminal->textColor); |
|
157 | terminal->LCD->paintText(terminal->LCD,buffer,CHARXPOS(terminal,charw),(CHARYPOS(terminal, charh))-(terminal->verticalSpace/2),terminal->font,terminal->textColor); | |
166 | terminal_movecursor(terminal,1); |
|
158 | terminal_movecursor(terminal,1); | |
167 | } |
|
159 | } | |
168 | } |
|
160 | } |
@@ -19,8 +19,8 | |||||
19 | -- Author : Alexis Jeandet |
|
19 | -- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@gmail.com |
|
20 | -- Mail : alexis.jeandet@gmail.com | |
21 | -------------------------------------------------------------------------------*/ |
|
21 | -------------------------------------------------------------------------------*/ | |
22 |
#ifndef SDCARD |
|
22 | #ifndef SDCARD_SPI_H | |
23 |
#define SDCARD |
|
23 | #define SDCARD_SPI_H | |
24 | #include <blkdevice.h> |
|
24 | #include <blkdevice.h> | |
25 | #include <libucstrings.h> |
|
25 | #include <libucstrings.h> | |
26 | #include <uhandle.h> |
|
26 | #include <uhandle.h> |
@@ -3,5 +3,5 | |||||
3 | int main(void) |
|
3 | int main(void) | |
4 | { |
|
4 | { | |
5 | bsp_init(); |
|
5 | bsp_init(); | |
6 |
libuc |
|
6 | libuc_main(); | |
7 | } |
|
7 | } |
@@ -8,11 +8,10 contains( TEMPLATE, app ) { | |||||
8 | } |
|
8 | } | |
9 | } |
|
9 | } | |
10 |
|
10 | |||
11 | #contains( TEMPLATE, lib ) { |
|
11 | !isEmpty( UCMODEL ) { | |
12 | !isEmpty( UCMODEL ) { |
|
12 | include(./$$UCMODEL/cpu.pri) | |
13 |
|
|
13 | include(./$$UCMODEL/qmake.conf) | |
14 | } |
|
14 | } | |
15 | #} |
|
|||
16 |
|
15 | |||
17 |
|
16 | |||
18 |
|
17 | |||
@@ -31,4 +30,3 contains( TEMPLATE, app ) { | |||||
31 |
|
30 | |||
32 |
|
31 | |||
33 |
|
32 | |||
34 |
|
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now