##// END OF EJS Templates
Removed error on fat32 library, seems now to be able navigate among sectors in...
Removed error on fat32 library, seems now to be able navigate among sectors in both directions. Improved SDLCD drawing performances by almost 1000x.

File last commit:

r66:3ad48bdbe9e3 dev_alexis
r68:104125d87b89 dev_alexis
Show More
main.c
127 lines | 3.9 KiB | text/x-c | CLexer
Added graphical terminal (first shot).
r50 #include <stdio.h>
#include <fat32.h>
#include <gpio.h>
#include <uart.h>
#include <stm32f4xx.h>
#include <math.h>
#include <bsp.h>
#include <i2c.h>
#include <CS43L22.h>
Sync
r57 #include <STMPE811.h>
Added graphical terminal (first shot).
r50 #include <ina226.h>
#include <fonts.h>
#include <stdlib.h>
#include <core.h>
#include <terminal.h>
extern streamdevice* __opnfiles__[__MAX_OPENED_FILES__];
#define LCD_COLOR_WHITE 0xFFFF
#define LCD_COLOR_BLACK 0x0000
#define LCD_COLOR_GREY 0xF7DE
#define LCD_COLOR_BLUE 0x001F
#define LCD_COLOR_BLUE2 0x051F
#define LCD_COLOR_RED 0xF800
#define LCD_COLOR_MAGENTA 0xF81F
#define LCD_COLOR_GREEN 0x07E0
#define LCD_COLOR_CYAN 0x7FFF
#define LCD_COLOR_YELLOW 0xFFE0
Corrected bug #591
r56 void testAudioDAC()
{
CS43L22_t dac;
cs43l22open(&dac,i2c1,0);
uint8_t ID= cs43l22getID(&dac);
printf("dac ID = %d\n\r",ID);
}
Added graphical terminal (first shot).
r50
Sync
r57 void testIOEXPender()
{
STMPE811_t ioexp1,ioexp2;
char data[2]={0,0};
i2cwrite(i2c1,0x50,data,1);
//i2cread(i2c1,0x88,data,2);
// stmpe811init(&ioexp1,i2c1,0);
// stmpe811init(&ioexp2,i2c1,1);
// printf("Scan for IOEXPANDER:\n\r ID1=%d\n\rID2=%d",stmpe811getID(&ioexp1),stmpe811getID(&ioexp2));
}
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66 int _terminal_writenc(terminal_t* terminal,char* data, int n)
{
#define CHARXPOS(terminal,charwidth) (((terminal)->column * charwidth) + (terminal)->Xpos)
#define CHARYPOS(terminal,charheight) ((terminal)->line * charheight + (terminal)->Ypos+charheight)
int charw=terminal->font->Width + terminal->horizontalSpace;
int charh=terminal->font->Height + terminal->verticalSpace;
int l=0;
char buffer[2]=" ";
while(l<n)
{
buffer[0]=data[l];
if(buffer[0]=='\n')
{
terminal->line= (terminal->line+1) % terminal->lineCount;
terminal->column = 0;
// if(terminal->line==0)
// terminal_clear(terminal);
// else
// terminal_clearCurentLine(terminal);
}else {
if(buffer[0]=='\t')
{
for(int i=0;i<1;i++)terminal_movecursor(terminal,1);
}
// else
// if(terminal->column==0)terminal_clearCurentLine(terminal);
if(buffer[0]!='\r'){
// terminal->LCD->paintFilRect(terminal->LCD,CHARXPOS(terminal,charw),CHARYPOS(terminal, charh)-charh,charw,charh,terminal->backgroundColor,0,terminal->backgroundColor);
terminal->LCD->paintText(terminal->LCD,buffer,CHARXPOS(terminal,charw),(CHARYPOS(terminal, charh))-(terminal->verticalSpace/2),terminal->font,terminal->textColor);
terminal_movecursor(terminal,1);
}
}
l++;
}
return n;
}
Added graphical terminal (first shot).
r50 int main()
{
Corrected bug #591
r56 delay_100us(10000);
Added graphical terminal (first shot).
r50 uint16_t innerbuffer[16];
uint16_t outterbuffer[16];
for(int i=0;i<16;i++)innerbuffer[i]=LCD_COLOR_BLUE;
for(int i=0;i<16;i++)outterbuffer[i]=LCD_COLOR_RED;
ili9328paintFilRect(&lcd0,0,0,240,320,LCD_COLOR_CYAN,5,LCD_COLOR_BLACK);
Factorised stream device structure to reduce memory usage....
r51 streamdevice* fd1=__opnfiles__[1];
streamdevice fd2;
int i=0;
terminal_t terminal0,terminal1;
terminal_init(&terminal0,&lcd0,&ComicSansMS_18,fd1);
Sync
r57 //terminal_init(&terminal1,&lcd0,&ComicSansMS_18,&fd2);
terminal_setgeometry(&terminal0,5,5,terminal0.LCD->width-10,(terminal0.LCD->height)-10);
//terminal_setbackgroundColor(&terminal1,0xFFFF);
//terminal_settextColor(&terminal1,0x0000);
//terminal_setgeometry(&terminal1,5,(terminal0.LCD->height/2)+5,terminal0.LCD->width-10,(terminal0.LCD->height/2)-10);
Factorised stream device structure to reduce memory usage....
r51 printf("Line cnt :\n \t%d\n",terminal0.lineCount);
printf("Column cnt :\n \t%d\n",terminal0.columnCount);
Added graphical terminal (first shot).
r50 printf("CPU Freq :\n \t%dMHz\n",getCpuFreq()/1000000);
Corrected bug #591
r56 //testAudioDAC();
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66 for(int i=0;i<240;i++)
Added graphical terminal (first shot).
r50 {
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66 lcd0.paintFilRect(&lcd0,i,0,1,320,0,0,i);
Added graphical terminal (first shot).
r50 }
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66 lcd0.paintText(&lcd0,"A",100,100,&ComicSansMS_24,0);
while(1)_terminal_writenc(&terminal0,"test ",5);
Added graphical terminal (first shot).
r50 return 0;
}