##// END OF EJS Templates
sync
Jeandet Alexis -
r64:b702edc52366 dev_alexis
parent child
Show More
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -298,7 +298,7 void bsp_SD_init()
298 298 {
299 299 printf("Can't open or read MBR\n");
300 300 }
301
301 delay_100us(10000);
302 302 if(mbropen(&sdcard2blkdev,&sdcard2Part2,2)==MBRnoErr)
303 303 {
304 304 if(FATnoErr!=fat32open(&sdcard2FAT32part2,&sdcard2Part2))
@@ -308,7 +308,7 void bsp_SD_init()
308 308 {
309 309 printf("Can't open or read MBR\n");
310 310 }
311
311 delay_100us(10000);
312 312 if(mbropen(&sdcard2blkdev,&sdcard2Part3,3)==MBRnoErr)
313 313 {
314 314 if(FATnoErr!=fat32open(&sdcard2FAT32part3,&sdcard2Part3))
@@ -318,7 +318,7 void bsp_SD_init()
318 318 {
319 319 printf("Can't open or read MBR\n");
320 320 }
321
321 delay_100us(10000);
322 322 if(mbropen(&sdcard2blkdev,&sdcard2Part4,4)==MBRnoErr)
323 323 {
324 324 if(FATnoErr!=fat32open(&sdcard2FAT32part4,&sdcard2Part4))
@@ -334,6 +334,7 void bsp_SD_init()
334 334 printf("Can't initialize SDCARD\n");
335 335 }
336 336 }
337 delay_100us(20000);
337 338 }
338 339
339 340 void vs1052setXCS(char val)
@@ -496,7 +497,7 void bsp_GTerm_init()
496 497 if(__opnfiles__[1]==NULL)
497 498 {
498 499 streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice));
499 terminal_init(&terminal0 ,&lcd0,&ComicSansMS_18,fd1);
500 terminal_init(&terminal0 ,&lcd0,&ComicSansMS_8,fd1);
500 501 __opnfiles__[1] = fd1;
501 502 }
502 503 else
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -36,8 +36,8 LCD_IF_t lcdIF0={
36 36 .init = &SDLCD_init,
37 37 .writereg = &SDLCD_writereg,
38 38 .readreg = &SDLCD_readreg,
39 .writeGRAM = &SDLCD_writeGRAM,
40 .readGRAM = &SDLCD_readGRAM
39 .writeGRAM = &SDLCD_writeGRAM_16bpp,
40 .readGRAM = &SDLCD_readGRAM_16bpp
41 41 };
42 42
43 43 LCD_t lcd0={
@@ -205,6 +205,7 void bsp_GTerm_init()
205 205 {
206 206 streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice));
207 207 terminal_init(&terminal0 ,&lcd0,&ComicSansMS_18,fd1);
208 lcd0.paintFilRect(&lcd0,0,0,240,320,0,0,0x0f0f);
208 209 __opnfiles__[1] = fd1;
209 210 }
210 211 else
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include "bsp.h"
23 23 #include <streamdevices.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef BSP_H
23 23 #define BSP_H
@@ -5,7 +5,7 CONFIG += cpu
5 5 UCMODEL=stm32f4
6 6 BSP = OPLAYER
7 7
8 DEFINES += CPUFREQ=180000000
8 DEFINES += CPUFREQ=10000000
9 9
10 10
11 11 SOURCES += \
@@ -136,6 +136,7 void playAllparts()
136 136
137 137 int main()
138 138 {
139 delay_100us(30000);
139 140 int i=0;
140 141 int color=0;
141 142 for(i=0;i<240;i++)
@@ -42,10 +42,11 int libuc2_main_task()
42 42 char in[255];
43 43 lcd_print();
44 44 printf("hello world\n");
45 streamdevicePrint(__opnfiles__[1],"test Hello %d %f \n ",1234567,8.96);
45 streamdevicePrint(__opnfiles__[1],"test Hello %d %f \n",1234567,8.96);
46 lcd0.paintText(&lcd0,"A",10,100,&ComicSansMS_18,0x0);
46 47 // while (scanf("%c",in))
47 48 // {
48 sleep(3);
49 sleep(5);
49 50 // }
50 51 }
51 52
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <CS43L22.h>
23 23 #include <stdio.h>
@@ -17,7 +17,7
17 17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 #-------------------------------------------------------------------------------
19 19 #-- Author : Alexis Jeandet
20 #-- Mail : alexis.jeandet@gmail.com
20 #-- Mail : alexis.jeandet@member.fsf.org
21 21 #-------------------------------------------------------------------------------*/
22 22 #include <spi.h>
23 23 #include <VS10XX.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <24LC0X.h>
23 23 #include <i2c.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <N25Q128.h>
23 23 #include <core.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #define FAT32_PRIVATE
23 23 #include <fat32.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <mbr.h>
23 23 #include <stdio.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <sdcard.h>
23 23 #include <sdcard-spi.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <ili9328.h>
23 23 #include <stdio.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <ssd2119.h>
23 23 #include <stdio.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <fonts.h>
23 23
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <widget.h>
23 23 #include <terminal.h>
@@ -124,16 +124,16 void terminal_movecursor(terminal_t* ter
124 124 int y=CHARYPOS(terminal,charh)-charh;
125 125 int w=charw*(terminal->columnCount-terminal->column);
126 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);
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 128 }
129 terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal,charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor);
129 //terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal,charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor);
130 130 }
131 131
132 132 void terminal_clearCurentLine(terminal_t* terminal)
133 133 {
134 134 int charw=terminal->font->Width + terminal->horizontalSpace;
135 135 int charh=terminal->font->Height + terminal->verticalSpace;
136 terminal->LCD->paintFilRect(terminal->LCD,terminal->Xpos,CHARYPOS(terminal, charh)-charh,terminal->width,charh,terminal->backgroundColor,0,terminal->backgroundColor);
136 // terminal->LCD->paintFilRect(terminal->LCD,terminal->Xpos,CHARYPOS(terminal, charh)-charh,terminal->width,charh,terminal->backgroundColor,0,terminal->backgroundColor);
137 137 }
138 138
139 139 int terminal_writenc(terminal_t* terminal,char* data, int n)
@@ -161,7 +161,7 int terminal_writenc(terminal_t* termina
161 161 }else
162 162 if(terminal->column==0)terminal_clearCurentLine(terminal);
163 163 if(buffer[0]!='\r'){
164 terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal, charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor);
164 // terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal, charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor);
165 165 terminal->LCD->paintText(terminal->LCD,buffer,CHARXPOS(terminal,charw),CHARYPOS(terminal, charh),terminal->font,terminal->textColor);
166 166 terminal_movecursor(terminal,1);
167 167 }
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <STMPE811.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <ina226.h>
23 23 #include <stdio.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <thread.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef B24LC0X_H
23 23 #define B24LC0X_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef TERMINAL_H
23 23 #define TERMINAL_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef STMPE811_H
23 23 #define STMPE811_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef GENERICTC_CONTROLER_H
23 23 #define GENERICTC_CONTROLER_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef N25Q128_H
23 23 #define N25Q128_H
@@ -17,7 +17,7
17 17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 #-------------------------------------------------------------------------------
19 19 #-- Author : Alexis Jeandet
20 #-- Mail : alexis.jeandet@gmail.com
20 #-- Mail : alexis.jeandet@member.fsf.org
21 21 #-------------------------------------------------------------------------------*/
22 22 #ifndef VS10XX_H
23 23 #define VS10XX_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef FAT32_H
23 23 #define FAT32_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef MBR_H
23 23 #define MBR_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef SDCARD_H
23 23 #define SDCARD_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 /*
23 23 TODO:
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #ifndef THREAD_H
23 23 #define THREAD_H
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <core.h>
23 23 #include <stdint.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <gpio.h>
23 23
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <i2c.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <SDL.h>
@@ -136,6 +136,18 void SDLCD_putpixel(SDL_Surface *surface
136 136 }
137 137 }
138 138
139 void SDLCD_putpixel_16bpp(SDL_Surface *surface, int x, int y, Uint32 pixel)
140 {
141 Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * surface->format->BytesPerPixel;
142 *(Uint16 *)p = pixel;
143 }
144
145 Uint32 SDLCD_getpixel_16bpp(SDL_Surface *surface, int x, int y)
146 {
147 Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * surface->format->BytesPerPixel;
148 return *(Uint16 *)p;
149 }
150
139 151 Uint32 SDLCD_getpixel(SDL_Surface *surface, int x, int y)
140 152 {
141 153 int bpp = surface->format->BytesPerPixel;
@@ -172,7 +184,7 void SDLCD_writeGRAM(void* buffer,uint32
172 184 }
173 185 for(i=0;i<count;i++)
174 186 {
175 SDLCD_putpixel(screen,SDLCD_Xpos,SDLCD_Ypos,inptr[i]);
187 SDLCD_putpixel_16bpp(screen,SDLCD_Xpos,SDLCD_Ypos,inptr[i]);
176 188 SDLCD_Xpos+=1;
177 189 ptr[i]=inptr[i];
178 190 if(SDLCD_Xpos>=SDLCD_XWinEnd)
@@ -188,9 +200,64 void SDLCD_writeGRAM(void* buffer,uint32
188 200 if ( SDL_MUSTLOCK(screen) ) {
189 201 SDL_UnlockSurface(screen);
190 202 }
203 // SDL_UpdateRect(screen, SDLCD_XWinStrt, SDLCD_YWinStrt, SDLCD_XWinEnd-SDLCD_XWinStrt, SDLCD_YWinEnd-SDLCD_YWinStrt);
191 204 SDL_UpdateRect(screen, 0, 0, screen->w, screen->h);
192 205 }
193 206
207 void SDLCD_writeGRAM_16bpp(void* buffer,uint32_t count)
208 {
209 int i=0;
210 u_int16_t* inptr=(u_int16_t*)buffer;
211 if ( SDL_MUSTLOCK(screen) ) {
212 if ( SDL_LockSurface(screen) < 0 ) {
213 fprintf(stderr, "Can’t lock screen: %s\n", SDL_GetError());
214 return;
215 }
216 }
217 for(i=0;i<count;i++)
218 {
219 *(( Uint16 * ) screen->pixels + SDLCD_Ypos * screen->pitch / 2 + SDLCD_Xpos)=inptr[i];
220 SDLCD_Xpos+=1;
221 if(SDLCD_Xpos>=SDLCD_XWinEnd)
222 {
223 SDLCD_Xpos=SDLCD_XWinStrt;
224 SDLCD_Ypos+=1;
225 }
226 if(SDLCD_Ypos>=SDLCD_YWinEnd)
227 {
228 SDLCD_Ypos=SDLCD_YWinStrt;
229 }
230 }
231 if ( SDL_MUSTLOCK(screen) ) {
232 SDL_UnlockSurface(screen);
233 }
234 // SDL_UpdateRect(screen, SDLCD_XWinStrt, SDLCD_YWinStrt, SDLCD_XWinEnd-SDLCD_XWinStrt, SDLCD_YWinEnd-SDLCD_YWinStrt);
235 SDL_UpdateRect(screen, 0, 0, screen->w, screen->h);
236 }
237
238 void SDLCD_readGRAM_16bpp(void* buffer,uint32_t count)
239 {
240 int i=0;
241 u_int16_t* ptr=(u_int16_t*)SDLCD_buffer;
242 u_int16_t* inptr=(u_int16_t*)buffer;
243 for(i=0;i<count;i++)
244 {
245 inptr[i]=*(( Uint16 * ) screen->pixels + SDLCD_Ypos * screen->pitch / 2 + SDLCD_Xpos);
246 SDLCD_Xpos+=1;
247 ptr[i]=inptr[i];
248 if(SDLCD_Xpos>=SDLCD_XWinEnd)
249 {
250 SDLCD_Xpos=SDLCD_XWinStrt;
251 SDLCD_Ypos+=1;
252 }
253 if(SDLCD_Ypos>=SDLCD_YWinEnd)
254 {
255 SDLCD_Ypos=SDLCD_YWinStrt;
256 }
257 }
258
259 }
260
194 261 void SDLCD_readGRAM(void* buffer,uint32_t count)
195 262 {
196 263 int i=0;
@@ -198,7 +265,7 void SDLCD_readGRAM(void* buffer,uint32_
198 265 u_int16_t* inptr=(u_int16_t*)buffer;
199 266 for(i=0;i<count;i++)
200 267 {
201 inptr[i]=SDLCD_getpixel(screen,SDLCD_Xpos,SDLCD_Ypos);
268 inptr[i]=SDLCD_getpixel_16bpp(screen,SDLCD_Xpos,SDLCD_Ypos);
202 269 SDLCD_Xpos+=1;
203 270 ptr[i]=inptr[i];
204 271 if(SDLCD_Xpos>=SDLCD_XWinEnd)
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <SDL.h>
@@ -34,7 +34,9 extern int SDLCD_init();
34 34 extern void SDLCD_writereg(uint32_t reg,uint32_t data);
35 35 extern uint32_t SDLCD_readreg(uint32_t reg);
36 36 extern void SDLCD_writeGRAM(void* buffer,uint32_t count);
37 extern void SDLCD_writeGRAM_16bpp(void* buffer,uint32_t count);
37 38 extern void SDLCD_readGRAM(void* buffer,uint32_t count);
39 extern void SDLCD_readGRAM_16bpp(void* buffer,uint32_t count);
38 40
39 41
40 42
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <spi.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <uart.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <core.h>
23 23 #include <stm32f4xx_rcc.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22 #include <gpio.h>
23 23 #include <stm32f4xx_gpio.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <i2c.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <i2c.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <spi.h>
@@ -17,7 +17,7
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@member.fsf.org
21 21 -------------------------------------------------------------------------------*/
22 22
23 23 #include <uart.h>
General Comments 0
You need to be logged in to leave comments. Login now