aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2012-11-29 06:13:43 -0800
committerAndrew Hannam <andrewh@inmarket.com.au>2012-11-29 06:13:43 -0800
commitf91aeb4c4d026056d4e8515f8e060097f41d216c (patch)
treef5ade7a4ef2a5e4379990b2a56e00cea1b2827b2
parent8275c8820f230342939a2410dd0b24c0f26a14e5 (diff)
parent5bfa0f26220588359342d4bf14add6dc53b4788b (diff)
downloaduGFX-f91aeb4c4d026056d4e8515f8e060097f41d216c.tar.gz
uGFX-f91aeb4c4d026056d4e8515f8e060097f41d216c.tar.bz2
uGFX-f91aeb4c4d026056d4e8515f8e060097f41d216c.zip
Merge pull request #9 from Tectu/master
Merge Tectu Changes
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld.c53
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld_board_example.h2
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h5
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld_config.h2
-rw-r--r--drivers/gdisp/Nokia6610/GE12.h2
-rw-r--r--drivers/gdisp/Nokia6610/GE8.h2
-rw-r--r--drivers/gdisp/Nokia6610/gdisp_lld.c2
-rw-r--r--drivers/gdisp/Nokia6610/gdisp_lld_board_example.h2
-rw-r--r--drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h2
-rw-r--r--drivers/gdisp/Nokia6610/gdisp_lld_config.h2
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld.c2
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld_board_example.h2
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h2
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld_config.h2
-rw-r--r--drivers/gdisp/SSD1289/gdisp_lld.c2
-rw-r--r--drivers/gdisp/SSD1289/gdisp_lld_board_example.h2
-rw-r--r--drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h2
-rw-r--r--drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h2
-rw-r--r--drivers/gdisp/SSD1289/gdisp_lld_config.h2
-rw-r--r--drivers/gdisp/TestStub/gdisp_lld.c2
-rw-r--r--drivers/gdisp/TestStub/gdisp_lld_config.h2
-rw-r--r--drivers/gdisp/VMT/gdisp_lld.c2
-rw-r--r--drivers/gdisp/VMT/gdisp_lld_config.h2
-rw-r--r--drivers/gdisp/VMT/gdisp_lld_driver1.c2
-rw-r--r--drivers/gdisp/VMT/gdisp_lld_driver2.c2
-rw-r--r--drivers/ginput/toggle/Pal/ginput_lld_toggle.c4
-rw-r--r--drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h4
-rw-r--r--drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h4
-rw-r--r--drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h4
-rw-r--r--drivers/ginput/touch/ADS7843/ginput_lld_mouse.c14
-rw-r--r--drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h2
-rw-r--r--drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h (renamed from drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h)51
-rw-r--r--drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h2
-rw-r--r--drivers/ginput/touch/MCU/ginput_lld_mouse.c14
-rw-r--r--drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h2
-rw-r--r--drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h163
-rw-r--r--drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h174
-rw-r--r--drivers/ginput/touch/MCU/ginput_lld_mouse_config.h8
-rw-r--r--drivers/multiple/Win32/gdisp_lld.c4
-rw-r--r--drivers/multiple/Win32/gdisp_lld_config.h10
-rw-r--r--drivers/multiple/Win32/ginput_lld_mouse_config.h2
-rw-r--r--include/gdisp/fonts.h2
-rw-r--r--include/lld/gdisp/gdisp_lld.h2
-rw-r--r--include/lld/gdisp/gdisp_lld_msgs.h2
-rw-r--r--include/lld/touchscreen/touchscreen_lld.h2
-rw-r--r--src/gtimer.c2
-rw-r--r--src/gwin/button.c6
47 files changed, 306 insertions, 276 deletions
diff --git a/drivers/gdisp/ILI9320/gdisp_lld.c b/drivers/gdisp/ILI9320/gdisp_lld.c
index 0d1e969c..ada0f27d 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld.c
+++ b/drivers/gdisp/ILI9320/gdisp_lld.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -237,20 +237,39 @@ static void lld_lcdSetCursor(uint16_t x, uint16_t y) {
addr = y * 0x100 + x;
- lld_lcdWriteReg(0x0020, addr & 0xff); /* low addr */
- lld_lcdWriteReg(0x0021, (addr >> 8) & 0x1ff); /* high addr */
+ switch(GDISP.Orientation) {
+ case GDISP_ROTATE_0:
+ lld_lcdWriteReg(0x0020, addr & 0xff); /* low addr */
+ lld_lcdWriteReg(0x0021, (addr >> 8) & 0x1ff); /* high addr */
+ break;
+
+ case GDISP_ROTATE_90:
+ lld_lcdWriteReg(0x0020, (addr >> 8) & 0x1ff); /* low addr */
+ lld_lcdWriteReg(0x0021, addr & 0xff); /* high addr */
+ break;
+
+ case GDISP_ROTATE_180:
+ break;
+
+ case GDISP_ROTATE_270:
+ break;
+ }
}
static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy) {
switch(GDISP.Orientation) {
case GDISP_ROTATE_0:
- lld_lcdWriteReg(0x0050, x - 1);
- lld_lcdWriteReg(0x0051, x + cx - 2);
- lld_lcdWriteReg(0x0052, y - 1);
- lld_lcdWriteReg(0x0053, y + cy - 2);
+ lld_lcdWriteReg(0x0050, x);
+ lld_lcdWriteReg(0x0051, x + cx - 1);
+ lld_lcdWriteReg(0x0052, y);
+ lld_lcdWriteReg(0x0053, y + cy - 1);
break;
case GDISP_ROTATE_90:
+ lld_lcdWriteReg(0x0050, y);
+ lld_lcdWriteReg(0x0051, y + cy - 1);
+ lld_lcdWriteReg(0x0052, x);
+ lld_lcdWriteReg(0x0053, x + cx - 1);
break;
case GDISP_ROTATE_180:
@@ -265,7 +284,16 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy)
}
static __inline void lld_lcdResetViewPort(void) {
- /* ToDo */
+ switch(GDISP.Orientation) {
+ case GDISP_ROTATE_0:
+ case GDISP_ROTATE_180:
+ lld_lcdSetViewPort(0, 0, GDISP_SCREEN_WIDTH, GDISP_SCREEN_HEIGHT);
+ break;
+ case GDISP_ROTATE_90:
+ case GDISP_ROTATE_270:
+ lld_lcdSetViewPort(0, 0, GDISP_SCREEN_HEIGHT, GDISP_SCREEN_WIDTH);
+ break;
+ }
}
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
@@ -479,20 +507,20 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
GDISP.Powermode = (gdisp_powermode_t)value;
return;
-#if 0
- // NOT IMPLEMENTED YET
case GDISP_CONTROL_ORIENTATION:
if(GDISP.Orientation == (gdisp_orientation_t)value)
return;
switch((gdisp_orientation_t)value) {
case GDISP_ROTATE_0:
- /* ToDo */
+ lld_lcdWriteReg(0x0001, 0x0100);
+ lld_lcdWriteReg(0x0003, 0x1038);
GDISP.Height = GDISP_SCREEN_HEIGHT;
GDISP.Width = GDISP_SCREEN_WIDTH;
break;
case GDISP_ROTATE_90:
- /* ToDo */
+ lld_lcdWriteReg(0x0001, 0x0000);
+ lld_lcdWriteReg(0x0003, 0x1030);
GDISP.Height = GDISP_SCREEN_WIDTH;
GDISP.Width = GDISP_SCREEN_HEIGHT;
break;
@@ -521,7 +549,6 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif
GDISP.Orientation = (gdisp_orientation_t)value;
return;
-#endif
case GDISP_CONTROL_BACKLIGHT:
if((unsigned)value > 100) value = (void *)100;
diff --git a/drivers/gdisp/ILI9320/gdisp_lld_board_example.h b/drivers/gdisp/ILI9320/gdisp_lld_board_example.h
index b929a3c3..48221b3a 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld_board_example.h
+++ b/drivers/gdisp/ILI9320/gdisp_lld_board_example.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h
index 0b926bb8..a6d9d631 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h
+++ b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -44,8 +44,7 @@ static __inline void GDISP_LLD(init_board)(void) {
palSetPadMode(GPIOE, GPIOE_TFT_RST, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOD, GPIOD_TFT_LIGHT, PAL_MODE_OUTPUT_PUSHPULL);
- /* const unsigned char FSMC_Bank = 0; */
- const unsigned char FSMC_Bank = 6;
+ const unsigned char FSMC_Bank = 0;
/* FSMC timing */
FSMC_Bank1->BTCR[FSMC_Bank+1] = (6) | (10 << 8) | (10 << 16);
diff --git a/drivers/gdisp/ILI9320/gdisp_lld_config.h b/drivers/gdisp/ILI9320/gdisp_lld_config.h
index 2fe89a14..ca534568 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld_config.h
+++ b/drivers/gdisp/ILI9320/gdisp_lld_config.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/Nokia6610/GE12.h b/drivers/gdisp/Nokia6610/GE12.h
index 668f475d..6c980e2e 100644
--- a/drivers/gdisp/Nokia6610/GE12.h
+++ b/drivers/gdisp/Nokia6610/GE12.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/Nokia6610/GE8.h b/drivers/gdisp/Nokia6610/GE8.h
index ea835e1b..789308a9 100644
--- a/drivers/gdisp/Nokia6610/GE8.h
+++ b/drivers/gdisp/Nokia6610/GE8.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/Nokia6610/gdisp_lld.c b/drivers/gdisp/Nokia6610/gdisp_lld.c
index 661d6a77..47df5bb2 100644
--- a/drivers/gdisp/Nokia6610/gdisp_lld.c
+++ b/drivers/gdisp/Nokia6610/gdisp_lld.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h b/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h
index de8eb6ce..c8528f9e 100644
--- a/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h
+++ b/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h b/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h
index 3d1e6ceb..0b5756d0 100644
--- a/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h
+++ b/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/Nokia6610/gdisp_lld_config.h b/drivers/gdisp/Nokia6610/gdisp_lld_config.h
index f751020f..e7583b54 100644
--- a/drivers/gdisp/Nokia6610/gdisp_lld_config.h
+++ b/drivers/gdisp/Nokia6610/gdisp_lld_config.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/S6D1121/gdisp_lld.c b/drivers/gdisp/S6D1121/gdisp_lld.c
index 49116ec1..5fac4b29 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld.c
+++ b/drivers/gdisp/S6D1121/gdisp_lld.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/S6D1121/gdisp_lld_board_example.h b/drivers/gdisp/S6D1121/gdisp_lld_board_example.h
index c47a6ed6..00c4b869 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld_board_example.h
+++ b/drivers/gdisp/S6D1121/gdisp_lld_board_example.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h b/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h
index ad71d343..9abfa74c 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h
+++ b/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/S6D1121/gdisp_lld_config.h b/drivers/gdisp/S6D1121/gdisp_lld_config.h
index 95046946..c662d0e7 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld_config.h
+++ b/drivers/gdisp/S6D1121/gdisp_lld_config.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/SSD1289/gdisp_lld.c b/drivers/gdisp/SSD1289/gdisp_lld.c
index 6ac55865..abcc4736 100644
--- a/drivers/gdisp/SSD1289/gdisp_lld.c
+++ b/drivers/gdisp/SSD1289/gdisp_lld.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/SSD1289/gdisp_lld_board_example.h b/drivers/gdisp/SSD1289/gdisp_lld_board_example.h
index c47a6ed6..00c4b869 100644
--- a/drivers/gdisp/SSD1289/gdisp_lld_board_example.h
+++ b/drivers/gdisp/SSD1289/gdisp_lld_board_example.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h b/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h
index dd492f9d..76a5c04c 100644
--- a/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h
+++ b/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h b/drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h
index 07cdfa12..9cff5a19 100644
--- a/drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h
+++ b/drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/SSD1289/gdisp_lld_config.h b/drivers/gdisp/SSD1289/gdisp_lld_config.h
index bc49c764..dafbc90f 100644
--- a/drivers/gdisp/SSD1289/gdisp_lld_config.h
+++ b/drivers/gdisp/SSD1289/gdisp_lld_config.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/TestStub/gdisp_lld.c b/drivers/gdisp/TestStub/gdisp_lld.c
index f1373ccd..79181036 100644
--- a/drivers/gdisp/TestStub/gdisp_lld.c
+++ b/drivers/gdisp/TestStub/gdisp_lld.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/TestStub/gdisp_lld_config.h b/drivers/gdisp/TestStub/gdisp_lld_config.h
index ecf383a9..18c2de59 100644
--- a/drivers/gdisp/TestStub/gdisp_lld_config.h
+++ b/drivers/gdisp/TestStub/gdisp_lld_config.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/VMT/gdisp_lld.c b/drivers/gdisp/VMT/gdisp_lld.c
index 6291f3ce..1bacf1a7 100644
--- a/drivers/gdisp/VMT/gdisp_lld.c
+++ b/drivers/gdisp/VMT/gdisp_lld.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/VMT/gdisp_lld_config.h b/drivers/gdisp/VMT/gdisp_lld_config.h
index 5f02f1d8..8c7bfc9c 100644
--- a/drivers/gdisp/VMT/gdisp_lld_config.h
+++ b/drivers/gdisp/VMT/gdisp_lld_config.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/VMT/gdisp_lld_driver1.c b/drivers/gdisp/VMT/gdisp_lld_driver1.c
index 5bfaaa85..06dadc54 100644
--- a/drivers/gdisp/VMT/gdisp_lld_driver1.c
+++ b/drivers/gdisp/VMT/gdisp_lld_driver1.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/gdisp/VMT/gdisp_lld_driver2.c b/drivers/gdisp/VMT/gdisp_lld_driver2.c
index 961c43b3..5dca0b27 100644
--- a/drivers/gdisp/VMT/gdisp_lld_driver2.c
+++ b/drivers/gdisp/VMT/gdisp_lld_driver2.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c
index 98c2f61b..560d11b9 100644
--- a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c
+++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -19,7 +19,7 @@
*/
/**
- * @file drivers/ginput/togglePal/ginput_lld_toggle.c
+ * @file drivers/ginput/toggle/Pal/ginput_lld_toggle.c
* @brief GINPUT Toggle low level driver source for the ChibiOS PAL hardware.
*
* @addtogroup GINPUT_TOGGLE
diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h
index e8262b9a..46d32b47 100644
--- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h
+++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -19,7 +19,7 @@
*/
/**
- * @file drivers/ginput/togglePal/ginput_lld_toggle_board_example.h
+ * @file drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h
* @brief GINPUT Toggle low level driver source for the ChibiOS PAL hardware on the example board.
*
* @addtogroup GINPUT_TOGGLE
diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h
index 3858ad0c..b767f32c 100644
--- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h
+++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -19,7 +19,7 @@
*/
/**
- * @file drivers/ginput/togglePal/ginput_lld_toggle_board_olimexsam7ex256.h
+ * @file drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h
* @brief GINPUT Toggle low level driver source for the ChibiOS PAL hardware on the Olimex SAM7EX256 board.
*
* @addtogroup GINPUT_TOGGLE
diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h
index f58221f9..a3fcf22e 100644
--- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h
+++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -19,7 +19,7 @@
*/
/**
- * @file drivers/ginput/togglePal/ginput_lld_toggle_config.h
+ * @file drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h
* @brief GINPUT Toggle Driver configuration header.
*
* @addtogroup GDISP
diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c
index de32c493..9c1a582b 100644
--- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c
+++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -31,15 +31,17 @@
#if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/
+#include "gdisp.h" /* for coord_t */
+#include "gevent.h"
+#include "ginput/ginput_mouse.h" /* for GINPUT_TOUCH_PRESSED */
#include "lld/ginput/mouse.h"
#if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD
- /* Include the user supplied board definitions */
#include "ginput_lld_mouse_board.h"
-//#elif defined(BOARD_OLIMEX_SAM7_EX256)
-// #include "ginput_lld_mouse_board_olimexsam7ex256.h"
+#elif defined(BOARD_FIREBULL_STM32_F103)
+ #include "ginput_lld_mouse_board_firebull_stm32f103.h"
#else
- #include "ginput_lld_mouse_board.h"
+ #include "ginput_lld_mouse_board_example.h"
#endif
static uint16_t sampleBuf[7];
@@ -92,6 +94,8 @@ void ginput_lld_mouse_init(void) {
* @notapi
*/
void ginput_lld_mouse_get_reading(MouseReading *pt) {
+ uint16_t i;
+
// If touch-off return the previous results
if (!getpin_pressed()) {
pt->x = lastx;
diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h
index 45563bee..9fbbaa56 100644
--- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h
+++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h
index 2c23472a..9df301a4 100644
--- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h
+++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -19,8 +19,8 @@
*/
/**
- * @file drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h
- * @brief GINPUT Touch low level driver source for the ADS7843 on some unknown board.
+ * @file drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h
+ * @brief GINPUT Touch low level driver source for the ADS7843 on the example board.
*
* @addtogroup GINPUT_MOUSE
* @{
@@ -29,13 +29,20 @@
#ifndef _GINPUT_LLD_MOUSE_BOARD_H
#define _GINPUT_LLD_MOUSE_BOARD_H
+static const SPIConfig spicfg = {
+ NULL,
+ GPIOC,
+ 6,
+ /* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0,
+};
+
/**
* @brief Initialise the board for the touch.
*
* @notapi
*/
static __inline void init_board(void) {
- spiStart(TOUCH_SPIDriver, TOUCH_SPIConfig);
+ spiStart(&SPID1, &spicfg);
}
/**
@@ -45,21 +52,17 @@ static __inline void init_board(void) {
* @notapi
*/
static __inline bool_t getpin_pressed(void) {
- return !palReadPad(TOUCH_PressedPort, TOUCH_PressedPin);
+ return (!palReadPad(GPIOC, 4));
}
-
/**
* @brief Aquire the bus ready for readings
*
* @notapi
*/
static __inline void aquire_bus(void) {
- #if defined(SPI_USE_MUTUAL_EXCLUSION)
- spiAcquireBus(TOUCH_SPIDriver);
- #endif
-
- GINPUT_TOUCH_SPI_PROLOGUE();
- palClearPad(TOUCH_SPIConfig->ssport, TOUCH_SPIConfig->sspad);
+ spiAcquireBus(&SPID1);
+ //TOUCHSCREEN_SPI_PROLOGUE();
+ palClearPad(GPIOC, 6);
}
/**
@@ -68,12 +71,9 @@ static __inline void aquire_bus(void) {
* @notapi
*/
static __inline void release_bus(void) {
- palSetPad(TOUCH_SPIConfig->ssport, TOUCH_SPIConfig->sspad);
- GINPUT_TOUCH_SPI_EPILOGUE();
-
- #if defined(SPI_USE_MUTUAL_EXCLUSION)
- spiReleaseBus(tsDriver->spip);
- #endif
+ palSetPad(GPIOC, 6);
+ spiReleaseBus(&SPID1);
+ //TOUCHSCREEN_SPI_EPILOGUE();
}
/**
@@ -85,12 +85,17 @@ static __inline void release_bus(void) {
* @notapi
*/
static __inline uint16_t read_value(uint16_t port) {
- static uint8_t txbuf[3] = {0};
- static uint8_t rxbuf[3] = {0};
+ static uint8_t txbuf[3] = {0};
+ static uint8_t rxbuf[3] = {0};
+ uint16_t ret;
+
+ txbuf[0] = port;
+
+ spiExchange(&SPID1, 3, txbuf, rxbuf);
- txbuf[0] = cmd;
- spiExchange(TOUCH_SPIDriver, 3, txbuf, rxbuf);
- return (rxbuf[1] << 5) | (rxbuf[2] >> 3);
+ ret = (rxbuf[1] << 5) | (rxbuf[2] >> 3);
+
+ return ret;
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h
index 1ab568f5..7462b9f2 100644
--- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h
+++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h
@@ -30,7 +30,7 @@
#define GINPUT_MOUSE_EVENT_TYPE GEVENT_TOUCH
#define GINPUT_MOUSE_NEED_CALIBRATION TRUE
#define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE
-#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 2
+#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 4
#define GINPUT_MOUSE_READ_CYCLES 4
#define GINPUT_MOUSE_POLL_PERIOD 100
#define GINPUT_MOUSE_MAX_CLICK_JITTER 2
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse.c b/drivers/ginput/touch/MCU/ginput_lld_mouse.c
index ac42033b..d0a3c42e 100644
--- a/drivers/ginput/touch/MCU/ginput_lld_mouse.c
+++ b/drivers/ginput/touch/MCU/ginput_lld_mouse.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -31,13 +31,15 @@
#if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/
-#include "lld/ginput/touch.h"
+#include "gdisp.h" /* for coord_t */
+#include "gevent.h"
+#include "ginput/ginput_mouse.h" /* for GINPUT_TOUCH_PRESSED */
+#include "lld/ginput/mouse.h"
#if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD
- /* Include the user supplied board definitions */
#include "ginput_lld_mouse_board.h"
-//#elif defined(BOARD_OLIMEX_SAM7_EX256)
-// #include "ginput_lld_mouse_board_olimexsam7ex256.h"
+#elif defined(BOARD_OLIMEX_STM32_LCD)
+ #include "ginput_lld_mouse_board_olimex_stm32_lcd.h"
#else
#include "ginput_lld_mouse_board.h"
#endif
@@ -92,6 +94,8 @@ void ginput_lld_mouse_init(void) {
* @notapi
*/
void ginput_lld_mouse_get_reading(MouseReading *pt) {
+ uint16_t i;
+
// If touch-off return the previous results
if (!getpin_pressed()) {
pt->x = lastx;
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h
index 21e55e74..5a09b274 100644
--- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h
+++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h
new file mode 100644
index 00000000..cde1ba77
--- /dev/null
+++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h
@@ -0,0 +1,163 @@
+/*
+ ChibiOS/GFX - Copyright (C) 2012
+ Joel Bodenmann aka Tectu <joel@unormal.org>
+
+ This file is part of ChibiOS/GFX.
+
+ ChibiOS/GFX is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/GFX is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h
+ * @brief GINPUT Touch low level driver source for the MCU on the example board.
+ *
+ * @addtogroup GINPUT_MOUSE
+ * @{
+ */
+
+#ifndef _GINPUT_LLD_MOUSE_BOARD_H
+#define _GINPUT_LLD_MOUSE_BOARD_H
+
+#define ADC_NUM_CHANNELS 2
+#define ADC_BUF_DEPTH 1
+
+static const ADCConversionGroup adc_y_config = {
+ FALSE,
+ ADC_NUM_CHANNELS,
+ NULL,
+ NULL,
+ 0, 0,
+ 0, 0,
+ ADC_SQR1_NUM_CH(ADC_NUM_CHANNELS),
+ 0,
+ ADC_SQR3_SQ2_N(ADC_CHANNEL_IN12) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN13)
+};
+
+static const ADCConversionGroup adc_x_config = {
+ FALSE,
+ ADC_NUM_CHANNELS,
+ NULL,
+ NULL,
+ 0, 0,
+ 0, 0,
+ ADC_SQR1_NUM_CH(ADC_NUM_CHANNELS),
+ 0,
+ ADC_SQR3_SQ2_N(ADC_CHANNEL_IN10) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN11)
+};
+
+/**
+ * @brief Initialise the board for the touch.
+ *
+ * @notapi
+ */
+static __inline void init_board(void) {
+ adcStart(&ADCD1, NULL);
+}
+
+/**
+ * @brief Check whether the surface is currently touched
+ * @return TRUE if the surface is currently touched
+ *
+ * @notapi
+ */
+static __inline bool_t getpin_pressed(void) {
+ palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_PULLDOWN);
+ palSetPadMode(GPIOC, 1, PAL_MODE_INPUT);
+ palSetPadMode(GPIOC, 2, PAL_MODE_INPUT);
+ palSetPadMode(GPIOC, 3, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPad(GPIOC, 3);
+
+ return palReadPad(GPIOC, 0);
+}
+
+/**
+ * @brief Aquire the bus ready for readings
+ *
+ * @notapi
+ */
+static __inline void aquire_bus(void) {
+
+}
+
+/**
+ * @brief Release the bus after readings
+ *
+ * @notapi
+ */
+static __inline void release_bus(void) {
+
+}
+
+/**
+ * @brief Read an x value from touch controller
+ * @return The value read from the controller
+ *
+ * @notapi
+ */
+static __inline uint16_t read_x_value(void) {
+ uint16_t val1, val2;
+ adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
+
+ palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_ANALOG);
+ palSetPadMode(GPIOC, 1, PAL_MODE_INPUT_ANALOG);
+ palSetPadMode(GPIOC, 2, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOC, 3, PAL_MODE_OUTPUT_PUSHPULL);
+
+ palSetPad(GPIOC, 2);
+ palClearPad(GPIOC, 3);
+ chThdSleepMilliseconds(1);
+ adcConvert(&ADCD1, &adc_x_config, samples, ADC_BUF_DEPTH);
+ val1 = ((samples[0] + samples[1])/2);
+
+ palClearPad(GPIOC, 2);
+ palSetPad(GPIOC, 3);
+ chThdSleepMilliseconds(1);
+ adcConvert(&ADCD1, &adc_x_config, samples, ADC_BUF_DEPTH);
+ val2 = ((samples[0] + samples[1])/2);
+
+ return ((val1+((1<<12)-val2))/4);
+}
+
+/**
+ * @brief Read an y value from touch controller
+ * @return The value read from the controller
+ *
+ * @notapi
+ */
+static __inline uint16_t read_y_value(void) {
+ uint16_t val1, val2;
+ adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
+
+ palSetPadMode(GPIOC, 2, PAL_MODE_INPUT_ANALOG);
+ palSetPadMode(GPIOC, 3, PAL_MODE_INPUT_ANALOG);
+ palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOC, 1, PAL_MODE_OUTPUT_PUSHPULL);
+
+ palSetPad(GPIOC, 1);
+ palClearPad(GPIOC, 0);
+ chThdSleepMilliseconds(1);
+ adcConvert(&ADCD1, &adc_y_config, samples, ADC_BUF_DEPTH);
+ val1 = ((samples[0] + samples[1])/2);
+
+ palClearPad(GPIOC, 0);
+ palSetPad(GPIOC, 1);
+ chThdSleepMilliseconds(1);
+ adcConvert(&ADCD1, &adc_y_config, samples, ADC_BUF_DEPTH);
+ val2 = ((samples[0] + samples[1])/2);
+
+ return ((val1+((1<<12)-val2))/4);
+}
+
+#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
+/** @} */
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h
deleted file mode 100644
index 4780806e..00000000
--- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- ChibiOS/RT - Copyright (C) 2012
- Joel Bodenmann aka Tectu <joel@unormal.org>
-
- This file is part of ChibiOS/GFX.
-
- ChibiOS/GFX is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- ChibiOS/GFX is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/**
- * @file drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h
- * @brief GINPUT Touch low level driver source for the MCU on some unknown board.
- *
- * @addtogroup GINPUT_MOUSE
- * @{
- */
-
-#ifndef _GINPUT_LLD_MOUSE_BOARD_H
-#define _GINPUT_LLD_MOUSE_BOARD_H
-
-#define ADC_NUM_CHANNELS 2
-#define ADC_BUF_DEPTH 1
-
-static const ADCConversionGroup adc_y_config = {
- FALSE,
- ADC_NUM_CHANNELS,
- NULL,
- NULL,
- 0, 0,
- 0, 0,
- ADC_SQR1_NUM_CH(ADC_NUM_CHANNELS),
- 0,
- ADC_SQR3_SQ2_N(ADC_CHANNEL_IN12) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN13)
-};
-
-static const ADCConversionGroup adc_x_config = {
- FALSE,
- ADC_NUM_CHANNELS,
- NULL,
- NULL,
- 0, 0,
- 0, 0,
- ADC_SQR1_NUM_CH(ADC_NUM_CHANNELS),
- 0,
- ADC_SQR3_SQ2_N(ADC_CHANNEL_IN10) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN11)
-};
-
-/**
- * @brief Initialise the board for the mouse/touch.
- *
- * @notapi
- */
-static __inline void init_board(void) {
- /* Code here */
- #error "ginputMCU: You must supply a definition for init_board for your board
-
- adcStart(ts->adc_driver, NULL);
-}
-
-/**
- * @brief Check whether the surface is currently touched
- * @return TRUE if the surface is currently touched
- *
- * @notapi
- */
-static __inline bool_t getpin_pressed(void) {
- /* Code here */
- #error "ginputMCU: You must supply a definition for getpin_pressed for your board"
- palSetPadMode(ts->yd_port, ts->yd_pin, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(ts->yu_port, ts->yu_pin, PAL_MODE_INPUT);
- palSetPadMode(ts->xl_port, ts->xl_pin, PAL_MODE_INPUT);
- palSetPadMode(ts->xr_port, ts->xr_pin, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPad(ts->xr_port, ts->xr_pin);
-
- return palReadPad(ts->yd_port, ts->yd_pin);
-}
-
-/**
- * @brief Aquire the bus ready for readings
- *
- * @notapi
- */
-static __inline void aquire_bus(void) {
- /* Code here */
- #error "ginputMCU: You must supply a definition for aquire_bus for your board"
-}
-
-/**
- * @brief Release the bus after readings
- *
- * @notapi
- */
-static __inline void release_bus(void) {
- /* Code here */
- #error "ginputMCU: You must supply a definition for release_bus for your board"
-}
-
-/**
- * @brief Read an x value from touch controller
- * @return The value read from the controller
- *
- * @notapi
- */
-static __inline uint16_t read_x_value(void) {
- /* Code here */
- #error "ginputMCU: You must supply a definition for read_x_value for your board"
- uint16_t val1, val2;
- adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
-
- palSetPadMode(ts->yd_port, ts->yd_pin, PAL_MODE_INPUT_ANALOG);
- palSetPadMode(ts->yu_port, ts->yu_pin, PAL_MODE_INPUT_ANALOG);
- palSetPadMode(ts->xl_port, ts->xl_pin, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPadMode(ts->xr_port, ts->xr_pin, PAL_MODE_OUTPUT_PUSHPULL);
-
- palSetPad(ts->xl_port, ts->xl_pin);
- palClearPad(ts->xr_port, ts->xr_pin);
- chThdSleepMilliseconds(1);
- adcConvert(ts->adc_driver, &adc_x_config, samples, ADC_BUF_DEPTH);
- val1 = ((samples[0] + samples[1])/2);
-
- palClearPad(ts->xl_port, ts->xl_pin);
- palSetPad(ts->xr_port, ts->xr_pin);
- chThdSleepMilliseconds(1);
- adcConvert(ts->adc_driver, &adc_x_config, samples, ADC_BUF_DEPTH);
- val2 = ((samples[0] + samples[1])/2);
-
- return ((val1+((1<<12)-val2))/4);
-}
-
-/**
- * @brief Read an y value from touch controller
- * @return The value read from the controller
- *
- * @notapi
- */
-static __inline uint16_t read_y_value(void) {
- /* Code here */
- #error "ginputMCU: You must supply a definition for read_y_value for your board"
- uint16_t val1, val2;
- adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
-
- palSetPadMode(ts->xl_port, ts->xl_pin, PAL_MODE_INPUT_ANALOG);
- palSetPadMode(ts->xr_port, ts->xr_pin, PAL_MODE_INPUT_ANALOG);
- palSetPadMode(ts->yd_port, ts->yd_pin, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPadMode(ts->yu_port, ts->yu_pin, PAL_MODE_OUTPUT_PUSHPULL);
-
- palSetPad(ts->yu_port, ts->yu_pin);
- palClearPad(ts->yd_port, ts->yd_pin);
- chThdSleepMilliseconds(1);
- adcConvert(ts->adc_driver, &adc_y_config, samples, ADC_BUF_DEPTH);
- val1 = ((samples[0] + samples[1])/2);
-
- palClearPad(ts->yu_port, ts->yu_pin);
- palSetPad(ts->yd_port, ts->yd_pin);
- chThdSleepMilliseconds(1);
- adcConvert(ts->adc_driver, &adc_y_config, samples, ADC_BUF_DEPTH);
- val2 = ((samples[0] + samples[1])/2);
-
- return ((val1+((1<<12)-val2))/4);
-}
-
-#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
-/** @} */
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h
index d56be229..e1aa15f3 100644
--- a/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h
+++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h
@@ -28,13 +28,13 @@
#define _LLD_GINPUT_MOUSE_CONFIG_H
#define GINPUT_MOUSE_EVENT_TYPE GEVENT_TOUCH
-#define GINPUT_MOUSE_NEED_CALIBRATION TRUE
+#define GINPUT_MOUSE_NEED_CALIBRATION FALSE
#define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE
-#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 2
+#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR -1
#define GINPUT_MOUSE_READ_CYCLES 4
#define GINPUT_MOUSE_POLL_PERIOD 100
-#define GINPUT_MOUSE_MAX_CLICK_JITTER 2
-#define GINPUT_MOUSE_MAX_MOVE_JITTER 2
+#define GINPUT_MOUSE_MAX_CLICK_JITTER 4
+#define GINPUT_MOUSE_MAX_MOVE_JITTER 4
#define GINPUT_MOUSE_CLICK_TIME 700
#endif /* _LLD_GINPUT_MOUSE_CONFIG_H */
diff --git a/drivers/multiple/Win32/gdisp_lld.c b/drivers/multiple/Win32/gdisp_lld.c
index 72ad0554..30cd3389 100644
--- a/drivers/multiple/Win32/gdisp_lld.c
+++ b/drivers/multiple/Win32/gdisp_lld.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
@@ -19,7 +19,7 @@
*/
/**
- * @file drivers/gdisp/Win32/gdisp_lld.c
+ * @file drivers/multiple/Win32/gdisp_lld.c
* @brief GDISP Graphics Driver subsystem low level driver source for Win32.
*
* @addtogroup GDISP
diff --git a/drivers/multiple/Win32/gdisp_lld_config.h b/drivers/multiple/Win32/gdisp_lld_config.h
index bf018eea..bebd76b9 100644
--- a/drivers/multiple/Win32/gdisp_lld_config.h
+++ b/drivers/multiple/Win32/gdisp_lld_config.h
@@ -1,15 +1,15 @@
/*
- ChibiOS/RT - Copyright (C) 2012
+ ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
- This file is part of ChibiOS-LCD-Driver.
+ This file is part of ChibiOS/GFX.
- ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify
+ ChibiOS-GFX is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
- ChibiOS-LCD-Driver is distributed in the hope that it will be useful,
+ ChibiOS-GFX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -19,7 +19,7 @@
*/
/**
- * @file drivers/gdisp/Win32/gdisp_lld_config.h
+ * @file drivers/multiple/Win32/gdisp_lld_config.h
* @brief GDISP Graphic Driver subsystem low level driver header for Win32.
*
* @addtogroup GDISP
diff --git a/drivers/multiple/Win32/ginput_lld_mouse_config.h b/drivers/multiple/Win32/ginput_lld_mouse_config.h
index bf063d6d..fc70a4d2 100644
--- a/drivers/multiple/Win32/ginput_lld_mouse_config.h
+++ b/drivers/multiple/Win32/ginput_lld_mouse_config.h
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
- * @file drivers/gdisp/Win32/ginput_lld_mouse_config.h
+ * @file drivers/multiple/Win32/ginput_lld_mouse_config.h
* @brief GINPUT LLD header file for mouse/touch driver.
*
* @addtogroup GINPUT_LLD_MOUSE
diff --git a/include/gdisp/fonts.h b/include/gdisp/fonts.h
index e3b07e86..e0c7f7de 100644
--- a/include/gdisp/fonts.h
+++ b/include/gdisp/fonts.h
@@ -19,7 +19,7 @@
*/
/**
- * @file include/gdisp_fonts.h
+ * @file include/gdisp/fonts.h
* @brief GDISP internal font definitions.
* @details This is not generally needed by an application. It is used
* by the low level drivers that need to understand a font.
diff --git a/include/lld/gdisp/gdisp_lld.h b/include/lld/gdisp/gdisp_lld.h
index fecd710a..4e29dc48 100644
--- a/include/lld/gdisp/gdisp_lld.h
+++ b/include/lld/gdisp/gdisp_lld.h
@@ -19,7 +19,7 @@
*/
/**
- * @file include/gdisp_lld.h
+ * @file include/lld/gdisp/gdisp_lld.h
* @brief GDISP Graphic Driver subsystem low level driver header.
*
* @addtogroup GDISP
diff --git a/include/lld/gdisp/gdisp_lld_msgs.h b/include/lld/gdisp/gdisp_lld_msgs.h
index 5885a70c..f5d29ea1 100644
--- a/include/lld/gdisp/gdisp_lld_msgs.h
+++ b/include/lld/gdisp/gdisp_lld_msgs.h
@@ -19,7 +19,7 @@
*/
/**
- * @file include/gdisp_lld_msgs.h
+ * @file include/lld/gdisp/gdisp_lld_msgs.h
* @brief GDISP Graphic Driver subsystem low level driver message structures.
*
* @addtogroup GDISP
diff --git a/include/lld/touchscreen/touchscreen_lld.h b/include/lld/touchscreen/touchscreen_lld.h
index 9dd29629..912d2464 100644
--- a/include/lld/touchscreen/touchscreen_lld.h
+++ b/include/lld/touchscreen/touchscreen_lld.h
@@ -19,7 +19,7 @@
*/
/**
- * @file include/touchscreen_lld.h
+ * @file include/lld/touchscreen/touchscreen_lld.h
* @brief TOUCHSCREEN Driver subsystem low level driver header.
*
* @addtogroup TOUCHSCREEN
diff --git a/src/gtimer.c b/src/gtimer.c
index 8956a190..164822f3 100644
--- a/src/gtimer.c
+++ b/src/gtimer.c
@@ -258,6 +258,8 @@ void gtimerStop(GTimer *pt) {
*
* @param[in] pt Pointer to a GTimer structure
*
+ * @return TRUE if active, FALSE otherwise
+ *
* @api
*/
bool_t gtimerIsActive(GTimer *pt) {
diff --git a/src/gwin/button.c b/src/gwin/button.c
index f62a86a4..fce82a20 100644
--- a/src/gwin/button.c
+++ b/src/gwin/button.c
@@ -30,12 +30,12 @@
#include "gwin.h"
#include "ginput.h"
-#if !defined(GFX_USE_GINPUT) || !GFX_USE_GINPUT
+#if (GFX_USE_GWIN && GWIN_NEED_BUTTON) || defined(__DOXYGEN__)
+
+#if !GFX_USE_GINPUT
#error "GWIN Buttons require GFX_USE_GINPUT"
#endif
-#if (GFX_USE_GWIN && GWIN_NEED_BUTTON) || defined(__DOXYGEN__)
-
#include <string.h>
#include "gwin_internal.h"