Compare commits

...

162 Commits
v2.8 ... master

Author SHA1 Message Date
Joel Bodenmann 41eef9dede GDISP: Add CH1115 driver 2023-11-25 17:19:15 +01:00
Joel Bodenmann b40425a0ae SSD1312: Add new GDISP driver 2023-10-31 12:34:10 +01:00
inmarket f1a34c9852 Fix for Win32 keyboard driver key states 2023-07-25 09:44:48 +10:00
inmarket 025cef93cc Use pure ascii encoding to prevent character encoding issues 2023-07-12 12:02:40 +10:00
Joel Bodenmann e028d196f5 gwin: add extern C to make usable from C++ 2023-07-03 16:42:03 +02:00
Joel Bodenmann fa0c779b0c drivers/multiple/SDL2: initialize only required subsystems 2023-06-07 16:09:24 +02:00
Joel Bodenmann 3d543b62bc drivers/multiple/SDL2: rename UGFX_SDL_INIT_FLAGS to GFX_SDL_INIT_FLAGS 2023-06-07 15:49:24 +02:00
Joel Bodenmann d1279f5ef2 drivers/multiple/SDL2: allow overriding SDL_Init() flags 2023-06-07 15:47:50 +02:00
Joel Bodenmann 6b0ce94b15 cmake: improve SDL2 support 2023-06-07 15:24:51 +02:00
Joel Bodenmann ad90707866 cmake: add support for drivers/ginput/touch/Linux-Event 2023-05-30 13:22:30 +02:00
Joel Bodenmann dee588888b cmake: add support for drivers/gdisp/framebuffer 2023-05-30 13:14:19 +02:00
Joel Bodenmann 9e9fc1e824 cmake: add support for drivers/multiple/X 2023-04-21 19:02:34 +02:00
Joel Bodenmann 325a7c8b5f cmake: fix typo 2022-06-10 13:41:34 +00:00
Joel Bodenmann da1c2233e7 drivers/GDISP/LGDP4532: Add gdisp_lld_draw_pixel() and gdisp_lld_fill_area()
Contributed by "Volodymyr Shylov" <shilow@ukr.net>
2022-05-23 16:05:05 +02:00
Joel Bodenmann 168cd27633 update changelog.txt 2022-04-26 01:27:10 +02:00
Joel Bodenmann 143a3a8847 drivers/GDISP/SSD1322: Add missing driver.mk file
Fixes #7
2022-04-26 00:50:49 +02:00
Joel Bodenmann 56a88c440d cmake: provide an IMPORTED target 2021-11-03 20:50:24 +01:00
Joel Bodenmann cc0b175e7f cmake: Improve Findugfx.cmake 2021-11-03 20:23:29 +01:00
Joel Bodenmann ba9b9fb62b cmake: add driver file for drivers/multiple/Win32 2021-11-03 20:23:16 +01:00
Joel Bodenmann 0f11538656 Revert "cmake: Print UGFX_ROOT variable on success"
This reverts commit d66739a349.
2021-11-03 18:47:09 +01:00
Joel Bodenmann d66739a349 cmake: Print UGFX_ROOT variable on success 2021-11-03 18:38:53 +01:00
Joel Bodenmann ebf5033144 cmake: No longer print _SOURCES and _INCLUDE_DIRS variables 2021-11-03 17:26:43 +01:00
Joel Bodenmann 734c5cd421 cmake: Improve SDL driver integration 2021-10-28 16:15:02 +02:00
Joel Bodenmann 831c23e2ac cmake: Add root directory to include directories 2021-10-28 14:56:01 +02:00
Joel Bodenmann 2ae3cf397d CMake: Automatically set UGFX_ROOT 2021-10-27 16:45:20 +02:00
inmarket 33f6fa0eb0 More line ending fixes 2021-10-20 22:21:56 +10:00
inmarket 2c1c87ee1b Fixing line endings 2021-10-20 22:17:27 +10:00
Joel Bodenmann ae6a3bc18b Adding CMake support for gdisp/STM32LTDC driver 2021-10-12 18:37:02 +02:00
Joel Bodenmann 68483139c9 Adding ChibiOS 7 support 2021-10-12 18:36:02 +02:00
Joel Bodenmann 64aa71339c Adding CMake support 2021-10-12 17:44:54 +02:00
Joel Bodenmann a4f225700f Improving FreeBSD integration support 2021-10-12 15:33:35 +02:00
Joel Bodenmann 71a308a01a Update readme 2021-09-24 17:51:55 +02:00
Joel Bodenmann 50be0d6432 Revert "Fix signed/unsigned comparison in gos_linux.c"
This reverts commit aa9e187581.
2021-09-23 17:49:02 +02:00
Joel Bodenmann 7e2decd0cd Update changelog.txt 2021-09-21 18:12:07 +02:00
Joel Bodenmann aa9e187581 Fix signed/unsigned comparison in gos_linux.c 2021-09-21 18:07:54 +02:00
Joel Bodenmann 05b547bbbb Updating changelog.txt 2021-09-21 17:56:46 +02:00
Joel Bodenmann 1d63573408 Adding FreeBSD support 2021-09-21 17:54:35 +02:00
Joel Bodenmann 1c29a88ee1 Fix SDL2 driver arguments to mmap() and sem_open()
Linux & MacOS seem to tolerate the incorrect parameters but they are wrong as per the documentation.
On more pedantic systems such as FreeBSD these calls fails.
2021-09-21 17:44:43 +02:00
Joel Bodenmann 4261a1fb0b Fix missing return values in FSync GQUEUE implementations 2021-08-31 16:06:44 +02:00
inmarket 3d3555ec5a Add Visual Studio Code project config to the .gitignore 2021-08-29 17:29:13 +10:00
Joel Bodenmann 2f82247223 Prevent const qualifier being discarded in vfnprintg() 2021-08-26 17:46:55 +02:00
Joel Bodenmann cbf9c22adf STM32LTDC: Update readme.md 2021-08-26 14:26:59 +02:00
Joel Bodenmann 6d6ce043d0 Whitespaces 2021-08-26 14:26:17 +02:00
Joel Bodenmann 0a55fc94bd Avoid duplicate const specifier compiler warnings
The original code is perfectly valid standard C. However, some compilers (especially GCC) complain about duplicate const specifiers anyway.
At this point we cave in as there doesn't seem to be any efforts to fix this problem by the corresponding compiler vendors.

uGFX v3 will no longer suffer from this problem as the driver interface works differently in this area.
2021-08-26 14:26:04 +02:00
Joel Bodenmann 0dac6b4d0f Fix ChibiOS 6.x kernel support 2021-08-26 02:08:42 +02:00
Joel Bodenmann 14f26ec934 Whitespaces 2021-08-26 00:33:11 +02:00
Joel Bodenmann 7845f44f20 Win32 driver: Fix memory leak / invalid pointer to free() when re-calculating buffer position in a specific situation.
Thanks to @nathanwiebe for reporting this.
2021-08-26 00:22:19 +02:00
Joel Bodenmann 1235a9056c Win32 driver: Fix buffer position calculation in gdisp_lld_blit_area()
Thanks to @nathanwiebe for reporting this.
2021-08-26 00:04:47 +02:00
Joel Bodenmann 3f1f1c6a95 Fix/clean changelog.txt 2021-08-23 23:43:39 +02:00
Joel Bodenmann 8d6b2c4707 GTRANS: Update /demos/modules/gtrans/basic 2021-08-23 15:46:47 +02:00
Joel Bodenmann 317db95c46 GTRANS: Update types 2021-08-23 15:46:22 +02:00
Joel Bodenmann ec257874a7 GDISP: Explicitly handle gOrientation values where applicaple
This addresses a compiler bug in some versions of GCC which warn about unhandled enum values although there is a default handler.
2021-08-23 15:28:06 +02:00
Joel Bodenmann b17cb215f4 STM32LTDC: Handle gOrientationPortrait and gOrientationLandscape explicitly although not supporting it 2021-08-23 15:26:15 +02:00
Joel Bodenmann b3216fa0cc Minor doxygen fixes 2021-08-19 13:48:44 +02:00
Joel Bodenmann 888c7e8640 STM32LTDC: Fix bug in DMA2D blitting
Thanks to @nathanwiebe for reporting this:
https://community.ugfx.io/topic/3159-a-bug-in-the-stm32-ltdc-driver
2021-08-18 20:58:53 +02:00
Joel Bodenmann 853f2cba98 Relocate current benchmark to /demos/benchmarks/rectangles 2021-08-18 20:51:56 +02:00
Joel Bodenmann c713719326 Update /demos/benchmarks configuration file 2021-08-18 19:18:04 +02:00
Joel Bodenmann b98a6c258c Update /demos/benchmarks
This uses GOS functionalities to count ticks instead of hardware specific cycle counters.
2021-08-18 19:17:04 +02:00
Joel Bodenmann c57bd08379 Fix comment 2021-08-18 18:26:41 +02:00
Joel Bodenmann 409b8d4490 Update changelog.txt 2021-08-18 18:09:49 +02:00
Joel Bodenmann 77f10024e0 STM32LTDC: Improve pixel format detection if 2nd layer is used
This is necessary as using double buffering via STM32LTDC_USE_DOUBLEBUFFERING will also result in GDISP_TOTAL_DISPLAYS being larger than 1.
2021-08-18 17:12:12 +02:00
Joel Bodenmann 72200af286 Update changelog.txt 2021-08-18 17:05:29 +02:00
Joel Bodenmann d980418e81 STM32LTDC: Update readme.md 2021-08-18 16:46:04 +02:00
Joel Bodenmann 08c2358542 STM32LTDC: Support double buffering 2021-08-18 16:38:23 +02:00
Joel Bodenmann 5e3159064a Fix typo in readme 2021-08-17 15:56:06 +02:00
Joel Bodenmann 8804f3a381 STM32LTDC: Fix misspelled macro (internally only) 2021-08-17 15:55:02 +02:00
Joel Bodenmann 7f78be1183 STM32LTDC: Rename user config options for consistency & add docs 2021-08-17 14:23:57 +02:00
Joel Bodenmann 91247717a0 STM32LTDC: Expose more options to board file 2021-08-17 13:40:57 +02:00
Joel Bodenmann 2de054b530 STM32LTDC: Remove obsolete LTDC_NO_CLOCK_INIT define 2021-08-17 13:29:49 +02:00
Joel Bodenmann 94fd096fdd STM32LTDC: Rename ALLOW_2ND_LAYER to LTDC_USE_2ND_LAYER 2021-08-17 13:26:54 +02:00
Joel Bodenmann a9cf2bdfe2 STM32LTDC: Enable DMA cache flushing on H7 platforms 2021-08-17 12:32:12 +02:00
Joel Bodenmann b1b264b6a1 Fix legacy string 2021-08-16 16:25:04 +02:00
Joel Bodenmann cf01cb2e7c GDISP: Move extern GDISPVMT declarations outside of function body
This prevents generation of "nested-externs" compiler warnings.
2021-08-13 11:51:47 +02:00
Joel Bodenmann 37450998e1 STM32LTDC: Fix board function signatures 2021-08-12 20:31:49 +02:00
Joel Bodenmann 6fa3520f2a Refactor STM32LTDC driver to outsource hardware specifics such as clock setup to the board file 2021-08-12 20:22:49 +02:00
Joel Bodenmann beb815e109 Board STM32F746-Discovery: Fix rouge-ly replaced types 2021-08-12 20:08:02 +02:00
Joel Bodenmann 346375c001 Add experimental support for ChibiOS 6.x kernel 2021-08-12 12:47:08 +02:00
Joel Bodenmann 85c7b08825 Update changelog.txt 2021-08-12 12:22:54 +02:00
Joel Bodenmann 9c0678a291 Avoid duplicate const specifier compiler warnings
The original code is perfectly valid standard C. However, some compilers (especially GCC) complain about duplicate const specifiers anyway.
At this point we cave in as there doesn't seem to be any efforts to fix this problem by the corresponding compiler vendors.

uGFX v3 will no longer suffer from this problem as the driver interface works differently in this area.
2021-08-12 12:20:07 +02:00
Joel Bodenmann a587942305 Fix changelog.txt whitespace 2021-08-10 20:18:47 +02:00
Joel Bodenmann 47d9826a0a Fix compiler warning due to implicit cast 2021-08-10 15:41:26 +02:00
Joel Bodenmann 13d360b17f Doxygen: Set PROJECT_NAME appropriately. 2021-04-13 18:53:06 +02:00
Joel Bodenmann df7027881a Doxygen improvements 2021-04-13 18:36:22 +02:00
Joel Bodenmann 2d4bbea4a3 Update doxygen file
Updated doxygenfile using $>_ doxygen -u Doxyfile
2021-04-13 18:21:54 +02:00
inmarket ff93884f71 Fix doxygen comment 2020-01-21 12:10:35 +10:00
inmarket 0586fd276d Fix to gImage BMP handling where the system pixel size is less than a byte 2019-05-08 09:25:35 +10:00
inmarket 127a7cd2a2 Fix to GWIN console widget 2019-05-08 09:01:56 +10:00
inmarket 701f697df5 Fix release notes 2019-05-08 08:33:47 +10:00
Joel Bodenmann 39bde23dd9 Merge branch 'develop' 2019-05-01 17:07:43 +02:00
Joel Bodenmann ac4b7fc8b4 Typedef gImage compatibility only when GDISP_NEED_IMAGE is GFXON 2019-05-01 16:54:39 +02:00
Joel Bodenmann 785047b0aa Introduce type gImage to replace v2.x gdispImage 2019-04-10 17:33:15 +02:00
Joel Bodenmann 835f0f197f Release v2.9 2019-02-26 16:01:07 +01:00
Joel Bodenmann 138b49a1a0 Updating .gitignore 2019-02-26 16:00:55 +01:00
inmarket 509fc7501e Textedit fix - as per Neon1 2018-11-17 18:50:25 +10:00
inmarket d528fb218d Minor fixups 2018-11-10 10:45:28 +10:00
inmarket 8a9ed5195b Tidy u gfxSem, gfxMutex and various Macros by converting to new types gSem, gMutex etc 2018-11-03 12:29:30 +10:00
inmarket 7c5a6c928f For all source files update integer types to the new gI8 etc type names 2018-11-03 10:51:23 +10:00
inmarket 8bd70d953b FIx big endian bug 2018-10-21 11:56:46 +10:00
inmarket 6a69c5673f Fix gfxRealloc bug for RAW32 (and derivitives) 2018-10-14 14:59:40 +10:00
inmarket 0f3310dd34 Reverse removal of label auto-sizing during label creation. Retained removal of auto-sizing during draw. 2018-10-14 14:58:53 +10:00
inmarket 4c4cf51682 More updating of license header 2018-10-14 14:56:52 +10:00
Joel Bodenmann b2b8b857ee Merge branch 'feature/update_license_header' of XenotriX/uGFX into master 2018-10-01 16:41:19 +02:00
Tibo Clausen 0840c8e784 Update license header 2018-10-01 17:34:15 +02:00
Joel Bodenmann e414e77d23 Merge branch 'feature/label_renderer' of XenotriX/uGFX into master 2018-10-01 15:06:14 +02:00
Tibo Clausen 82287d168f Change gwinLabelDraw to gwinLabelDrawJustified 2018-10-01 15:51:36 +02:00
Joel Bodenmann 3486e47579 Updating changelog 2018-10-01 12:53:30 +02:00
Joel Bodenmann 7047dfa633 Merge branch 'feature/rm_label_auto-resize' of XenotriX/uGFX into master 2018-10-01 12:36:09 +02:00
Tibo Clausen 00c99374b1 Remove label auto-resizing 2018-10-01 13:12:28 +02:00
Joel Bodenmann fe8c80f434 Merge branch 'hotfix/fsyncqueue' of XenotriX/uGFX into master 2018-10-01 11:16:15 +02:00
Tibo Clausen e56ed290e3 Fix fully sync queue 2018-10-01 11:15:24 +02:00
Joel Bodenmann df0200c0f9 Merge branch 'hotfix/color' of XenotriX/uGFX into master 2018-09-27 14:01:37 +02:00
Tibo Clausen 601d8f893d Fix color macros 2018-09-27 12:53:47 +02:00
inmarket 330f891081 Added type gThread to replace V2.x gfxThreadHandle 2018-07-08 15:40:27 +10:00
inmarket 1fc4180d41 gThreadpriorityLow/Normal/High to replace LOW_/NORMAL_/HIGH_PRIORITY 2018-07-08 15:32:26 +10:00
inmarket 93da5a0578 gDelayNone/gDelayForever to replace TIME_IMMEDIATE/TIME_INFINITE 2018-07-08 15:15:15 +10:00
inmarket 215f31ee3d Added type gDelay to replace V2.x delaytime_t
Added type gTicks          to replace V2.x systemticks_t
Added type gThreadreturn   to replace V2.x threadreturn_t
Added type gThreadpriority to replace V2.x threadpriority_t
2018-07-08 14:30:31 +10:00
inmarket e23ae94e91 Added type gColorformat to replace V2.x colorformat 2018-07-08 14:04:14 +10:00
inmarket e61f0ae424 Added type gOrientation to replace V2.x orientation_t, and values gOrientationX replace GDISP_ROTATE_X 2018-07-08 13:51:20 +10:00
inmarket d9258efd4d Added macros JUSTIFYMASK_HORIZONTAL, JUSTIFYMASK_VERTICAL to replace macros JUSTIFYMASK_LEFTRIGHT, JUSTIFYMASK_TOPBOTTOM 2018-07-08 13:25:20 +10:00
inmarket cbf1d4dfa0 Added type gFont to replace V2.x font_t 2018-07-08 13:05:27 +10:00
inmarket a24fab0d72 Added type gFontmetric to replace V2.x fontmetric_t, and values gFontXXX replace fontXXX 2018-07-08 12:50:05 +10:00
inmarket 2e8eaa3471 Added type gJustify to replace V2.x justify_t, and values gJustifyXXX replace justifyXXX 2018-07-08 12:19:30 +10:00
inmarket 788cbced62 Correct V2 powermode macros 2018-07-08 11:58:35 +10:00
inmarket bda8c738b1 Added type gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX 2018-07-08 11:47:36 +10:00
inmarket f9c848e985 Change color_t to gColor 2018-07-08 11:19:43 +10:00
inmarket cfb1b2a488 Change pixel_t to gPixel 2018-07-08 11:08:55 +10:00
inmarket 2ab2d77fcb Change coord_t to gCoord 2018-07-08 10:54:19 +10:00
inmarket 7e95acb731 Change point and point_t to gPoint 2018-07-08 10:43:30 +10:00
inmarket e8b789bfb1 Fix some missing gBool conversions 2018-07-08 10:05:34 +10:00
inmarket 63d6955992 Another ChibiOS V5 fix 2018-07-08 09:46:29 +10:00
inmarket 853863254f Added WS29EPD driver by cpu20 for the WaveShare E-Paper display 2018-07-07 23:14:28 +10:00
inmarket e2fb6820d0 Add support for ChibiOS V5 - Thanks Vrollei 2018-07-07 17:05:18 +10:00
inmarket 41271d632b Added new type definitions - moving towards V3.0 2018-06-23 13:02:07 +10:00
inmarket 3b97fb798e Merge branch 'master' of Steffen/uGFX into master 2018-06-23 03:01:37 +02:00
inmarket b9b7d27c57 Merge branch 'ST7735_128x128' of kapacuk/uGFX into master 2018-06-23 02:52:13 +02:00
kapacuk b94fb2caad Added support for 1.44" board (128x128)
ST7735_TYPE_R and ST7735_TYPE_B macros are deprecated (but supported for backward compatibility).
Instead, ST7735_TYPE should be set to one of BOARD_TYPE_B, BOARD_TYPE_R, or BOARD_TYPE_R144
2018-06-20 15:15:23 +02:00
Joel Bodenmann ee4654b077 Merge branch 'ST7735_fixes' of kapacuk/uGFX into master 2018-06-20 14:42:27 +02:00
kapacuk 0f74d94288 A few minor fixes to be able to compile it on Linux with the latest GCC
- Added missing semicolon to the definition of write_data_repeat;
- Added missing parameter to release_bus() call
- Changed #include to use the lowercase file name
2018-06-20 11:52:51 +02:00
inmarket ef9d93f0ef Fix UC1610 driver private area initialisation 2018-04-03 13:43:01 +10:00
inmarket a70cc09ff9 Merge remote-tracking branch 'origin/master' 2018-03-10 22:46:41 +10:00
Joel Bodenmann a411aea69f Updating changelog 2018-03-10 13:35:57 +01:00
inmarket 0771c14817 Merge remote-tracking branch 'origin/master' 2018-03-10 20:36:35 +10:00
inmarket 94f1cc2f0a Change new colors to GFX_RED instead of GFXRED. Use the new color defs 2018-03-10 20:36:12 +10:00
Thomas Sterren bee02d5bb5 C comment style 2018-03-06 09:56:18 +01:00
Thomas Sterren 509b4113ad Got stuck in here with a source font file generated out of `arial` size 48 2018-03-06 09:56:11 +01:00
Thomas Sterren 50cc1ad596 Typo in mcufontencoder help 2018-03-06 09:55:54 +01:00
Thomas Sterren bbc4b8e551 Added clone() method to DataFile class 2018-03-06 09:55:30 +01:00
Thomas Sterren 3cb7afbdec Tab to spaces 2018-03-06 09:42:00 +01:00
Thomas Sterren 65d00b16b9 Merge branch 'master' of https://git.ugfx.io/uGFX/uGFX 2018-03-06 09:38:37 +01:00
inmarket f265924396 First set of V3 macro changes 2018-02-27 17:44:21 +10:00
Joel Bodenmann 14786e97b6 Fixing issue in RTX5/CMSIS2 port 2018-02-26 10:01:50 +01:00
inmarket d9eaba249f Added support for specifying calibration fonts and text 2018-02-24 12:36:15 +10:00
inmarket aeef03a83e Updates to standard STM32LTDC based boards to ensure the LTDC clock is fully operational before continuing 2018-02-24 11:49:30 +10:00
inmarket 891b78a62c Fix for ST7735 driver 2018-02-24 11:31:34 +10:00
Thomas Sterren 992850bcb1 Compiler satisfaction 2018-02-20 14:54:02 +01:00
Thomas Sterren 9e51a3e586 _gosPostInit() needs to be in C 2018-02-20 14:53:17 +01:00
Thomas Sterren 861e6b9869 Defined gfxRealloc() for GFX_USE_OS_QT 2018-02-20 14:51:37 +01:00
Steffen Schroeter c119ca4a5d Added missing check for GDISP_NEED_CIRCLE 2018-01-23 14:05:11 +01:00
Steffen Schroeter e0f22d9cb8 Add keyboard input to radio widget 2018-01-19 14:21:58 +01:00
inmarket 013bac84ce Support negative baseline_x in a font. 2018-01-09 17:53:30 +10:00
inmarket c41cbd05e9 Fix for wordwrapping when there is a space then a newline 2018-01-05 15:55:30 +10:00
inmarket 87ec4b7c77 Bug fix for drawing boxes of size 3x3 pixels 2017-11-07 17:47:55 +10:00
842 changed files with 28815 additions and 26351 deletions

11
.gitignore vendored
View File

@ -1,13 +1,22 @@
docs/html
build
.build
.dep
.cproject
.project
.vscode
*.sublime*
*.stackdump
*.lst
*.o
*.map
src/gdisp/fonts/*.dat
docs/html
docs/html.zip
docs/*.db
docs/*.tmp
# CLion
.idea/
cmake-build-*/

View File

@ -14,7 +14,7 @@ Yaffs2 is distributed under the GPLv2 license. Specifically that means the follo
- You MUST NOT distribute a binary that you produce in any form (even in the ROM of
a device) that contains both yaffs2 and uGFX code as that will put you in
breach of either the GPL license or the uGFX license no matter what you do.
See http://ugfx.org/licensing for more details.
See http://ugfx.io/licensing for more details.
- Regardless of whether the project is commercial or non-commercial, you MUST NOT
even compile binaries for other people since that is considered "distribution".
You cannot even compile binaries for a friend, they must build it for themselves.

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -76,68 +76,68 @@ static void eink_delay(int us) {
}
/* Turn the E-ink panel Vdd supply (+3.3V) on or off. */
static GFXINLINE void setpower_vdd(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vdd(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOB, GPIOB_SMPS_CTRL, !on);
palWritePad(GPIOA, GPIOA_EINK_VDD, on);
}
/* Turn the E-ink panel negative supplies (-15V, -20V) on or off. */
static GFXINLINE void setpower_vneg(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vneg(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOA, GPIOA_VNEG_CTRL, on);
}
/* Turn the E-ink panel positive supplies (-15V, -20V) on or off. */
static GFXINLINE void setpower_vpos(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vpos(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOA, GPIOA_VPOS_CTRL, on);
}
/* Set the state of the LE (source driver Latch Enable) pin. */
static GFXINLINE void setpin_le(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_le(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_LE, on);
}
/* Set the state of the OE (source driver Output Enable) pin. */
static GFXINLINE void setpin_oe(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_oe(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_OE, on);
}
/* Set the state of the CL (source driver Clock) pin. */
static GFXINLINE void setpin_cl(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_cl(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_CL, on);
}
/* Set the state of the SPH (source driver Start Pulse Horizontal) pin. */
static GFXINLINE void setpin_sph(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_sph(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_SPH, on);
}
/* Set the state of the D0-D7 (source driver Data) pins. */
static GFXINLINE void setpins_data(GDisplay *g, uint8_t value) {
static GFXINLINE void setpins_data(GDisplay *g, gU8 value) {
(void) g;
palWriteGroup(GPIOB, 0xFF, GPIOB_EINK_D0, value);
}
/* Set the state of the CKV (gate driver Clock Vertical) pin. */
static GFXINLINE void setpin_ckv(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_ckv(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_CKV, on);
}
/* Set the state of the GMODE (gate driver Gate Mode) pin. */
static GFXINLINE void setpin_gmode(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_gmode(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOC, GPIOC_EINK_GMODE, on);
}
/* Set the state of the SPV (gate driver Start Pulse Vertical) pin. */
static GFXINLINE void setpin_spv(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_spv(GDisplay *g, gBool on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_SPV, on);
}

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -103,7 +103,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if (state) {
CLR_RST;
@ -112,7 +112,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
}
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
pwmEnableChannel(&PWMD4, 1, percent);
}
@ -140,7 +140,7 @@ static GFXINLINE void busmode8(GDisplay *g) {
spiStart(&SPID1, &spi1cfg_8bit);
}
static GFXINLINE void write_index(GDisplay *g, uint8_t index) {
static GFXINLINE void write_index(GDisplay *g, gU8 index) {
(void) g;
CLR_DATA;
SPI1->DR = index;
@ -148,13 +148,13 @@ static GFXINLINE void write_index(GDisplay *g, uint8_t index) {
SET_DATA;
}
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, gU8 data) {
(void) g;
SPI1->DR = data;
while(((SPI1->SR & SPI_SR_TXE) == 0) || ((SPI1->SR & SPI_SR_BSY) != 0));
}
static GFXINLINE void write_ram16(GDisplay *g, uint16_t data) {
static GFXINLINE void write_ram16(GDisplay *g, gU16 data) {
(void) g;
SPI1->DR = data;
while((SPI1->SR & SPI_SR_TXE) == 0);

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -68,7 +68,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static noinline void setpin_reset(GDisplay *g, bool_t state) {
static noinline void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if (state)
palClearPad(IOPORTA, 7);
@ -76,7 +76,7 @@ static noinline void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(IOPORTA, 7);
}
static void set_backlight(GDisplay *g, uint8_t percent) {
static void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
if (percentage)
palClearPad(IOPORTD, 3);
@ -92,8 +92,8 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static noinline void write_index(GDisplay *g, uint16_t index) {
volatile uint16_t dummy;
static noinline void write_index(GDisplay *g, gU16 index) {
volatile gU16 dummy;
(void) g;
PmpWaitBusy();
@ -106,7 +106,7 @@ static noinline void write_index(GDisplay *g, uint16_t index) {
(void)dummy;
}
static noinline void write_data(GDisplay *g, uint16_t data) {
static noinline void write_data(GDisplay *g, gU16 data) {
(void) g;
PMDIN = data;
PmpWaitBusy();
@ -120,7 +120,7 @@ static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static noinline uint16_t read_data(GDisplay *g) {
static noinline gU16 read_data(GDisplay *g) {
(void) g;
PmpWaitBusy();
return PMDIN;

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/*
@ -31,8 +31,8 @@
// For a multiple display configuration we would put all this in a structure and then
// set g->board to that structure.
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */
static GFXINLINE void init_board(GDisplay *g) {
@ -68,7 +68,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if(state)
palClearPad(GPIOE, GPIOE_TFT_RST);
@ -76,7 +76,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(GPIOE, GPIOE_TFT_RST);
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void)percent;
}
@ -89,12 +89,12 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
GDISP_RAM = data;
}
@ -107,7 +107,7 @@ static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -43,7 +43,7 @@ static const SPIConfig spi2cfg = {
(SPI_CR1_MSTR | SPI_CR1_SPE | SPI_CR1_SSM | SPI_CR1_SSI)
};
static void send_data(uint16_t data);
static void send_data(gU16 data);
/**
* @brief Initialise the board for the display.
@ -83,14 +83,14 @@ static GFXINLINE void post_init_board(GDisplay *g) {
* @brief Set or clear the lcd reset pin.
*
* @param[in] g The GDisplay structure
* @param[in] state TRUE = lcd in reset, FALSE = normal operation
* @param[in] state gTrue = lcd in reset, gFalse = normal operation
*
* @notapi
*/
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if (state == TRUE) {
if (state) {
palClearPad(LCD_PORT, LCD_RES);
} else {
palSetPad(LCD_PORT, LCD_RES);
@ -105,7 +105,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
*
* @notapi
*/
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
@ -139,7 +139,7 @@ static GFXINLINE void release_bus(GDisplay *g) {
*
* @notapi
*/
static GFXINLINE void send_data(uint16_t data) {
static GFXINLINE void send_data(gU16 data) {
// http://forum.easyelectronics.ru/viewtopic.php?p=262122#p262122
while (!(SPI2->SR & SPI_SR_TXE)); // ïðè âõîäå íà îòïðàâêó ïðîâåðÿåì - à ïóñòîé ëè SPI_DR
SPI2->DR = data; // çàãðóçèëè â SPI_DR êîä êîìàíäû
@ -154,7 +154,7 @@ static GFXINLINE void send_data(uint16_t data) {
*
* @notapi
*/
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
while (SPI2->SR & SPI_SR_BSY);
@ -177,7 +177,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
*
* @notapi
*/
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
send_data(data);
@ -213,7 +213,7 @@ static GFXINLINE void setwritemode(GDisplay *g) {
*
* @notapi
*/
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -53,12 +53,12 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
@ -71,13 +71,13 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
palWritePort(GPIOE, index);
CLR_RS; CLR_WR; SET_WR; SET_RS;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
palWritePort(GPIOE, data);
CLR_WR; SET_WR;
@ -95,8 +95,8 @@ static GFXINLINE void setwritemode(GDisplay *g) {
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
uint16_t value;
static GFXINLINE gU16 read_data(GDisplay *g) {
gU16 value;
(void) g;
CLR_RD;

View File

@ -10,8 +10,8 @@
#include "stm32f4xx_hal.h"
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */
static GFXINLINE void init_board(GDisplay *g)
{
@ -97,7 +97,7 @@ static GFXINLINE void post_init_board(GDisplay* g)
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
{
(void) g;
@ -108,7 +108,7 @@ static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
}
}
static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent)
static GFXINLINE void set_backlight(GDisplay* g, gU8 percent)
{
(void) g;
@ -129,14 +129,14 @@ static GFXINLINE void release_bus(GDisplay* g)
(void) g;
}
static GFXINLINE void write_index(GDisplay* g, uint16_t index)
static GFXINLINE void write_index(GDisplay* g, gU16 index)
{
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay* g, uint16_t data)
static GFXINLINE void write_data(GDisplay* g, gU16 data)
{
(void) g;
@ -153,11 +153,11 @@ static GFXINLINE void setwritemode(GDisplay* g)
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay* g)
static GFXINLINE gU16 read_data(GDisplay* g)
{
(void) g;
return (uint16_t)GDISP_RAM;
return (gU16)GDISP_RAM;
}
#endif /* _GDISP_LLD_BOARD_H */

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -18,8 +18,8 @@
// For a multiple display configuration we would put all this in a structure and then
// set g->board to that structure.
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */
static GFXINLINE void init_board(GDisplay *g) {
@ -50,12 +50,12 @@ static GFXINLINE void init_board(GDisplay *g) {
}
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
@ -68,12 +68,12 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
GDISP_RAM = data;
}
@ -86,7 +86,7 @@ static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*
* Mail: fede.677387@hotmail.it
*
@ -31,13 +31,13 @@
#define SET_RST palSetPad(SPFD54124B_PIN_PORT, SPFD54124B_PIN_RST);
#define CLR_RST palClearPad(SPFD54124B_PIN_PORT, SPFD54124B_PIN_RST);
#define USE_SOFT_SPI TRUE
#define USE_SOFT_SPI GFXON
#define USE_HARD_SPI !(USE_SOFT_SPI)
#if USE_HARD_SPI
#if GFX_USE_OS_CHIBIOS
static int32_t thdPriority = 0;
static gI32 thdPriority = 0;
#endif
/*
@ -58,9 +58,9 @@ static GFXINLINE void soft_spi_sck(void){
palClearPad(SPFD54124B_SPI_PORT, SPFD54124B_SPI_SCK);
}
static GFXINLINE void soft_spi_write_9bit(uint16_t data){
static GFXINLINE void soft_spi_write_9bit(gU16 data){
uint8_t i;
gU8 i;
// activate lcd by low on CS pin
palClearPad(SPFD54124B_SPI_PORT, SPFD54124B_SPI_NSS);
@ -81,7 +81,7 @@ static GFXINLINE void soft_spi_write_9bit(uint16_t data){
}
#endif
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if(state) {
CLR_RST;
@ -100,7 +100,7 @@ static GFXINLINE void init_board(GDisplay *g) {
* SPI1 I/O pins setup.
*/
palSetPadMode(SPFD54124B_PIN_PORT, SPFD54124B_PIN_RST, PAL_MODE_OUTPUT_PUSHPULL); /* RESET */
setpin_reset(g, TRUE);
setpin_reset(g, gTrue);
#if USE_HARD_SPI
palSetPadMode(SPFD54124B_SPI_PORT, SPFD54124B_SPI_SCK, PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST); /* SCK. */
@ -131,7 +131,7 @@ static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
#if USE_HARD_SPI
#if GFX_USE_OS_CHIBIOS
thdPriority = (int32_t)chThdGetPriority();
thdPriority = (gI32)chThdGetPriority();
chThdSetPriority(HIGHPRIO);
#endif
spiAcquireBus(&SPFD54124B_SPID);
@ -148,10 +148,10 @@ static GFXINLINE void release_bus(GDisplay *g) {
#endif
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
uint16_t b;
gU16 b;
#if USE_HARD_SPI
@ -176,7 +176,7 @@ static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
#if USE_HARD_SPI
@ -195,7 +195,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -18,8 +18,8 @@
// For a multiple display configuration we would put all this in a structure and then
// set g->board to that structure.
#define GDISP_REG ((volatile uint16_t *) 0x60000000)[0] /* RS = 0 */
#define GDISP_RAM ((volatile uint16_t *) 0x60020000)[0] /* RS = 1 */
#define GDISP_REG ((volatile gU16 *) 0x60000000)[0] /* RS = 0 */
#define GDISP_RAM ((volatile gU16 *) 0x60020000)[0] /* RS = 1 */
#define GDISP_DMA_STREAM STM32_DMA2_STREAM6
#define FSMC_BANK 0
@ -109,12 +109,12 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
pwmEnableChannel(&PWMD3, 2, percent);
}
@ -127,12 +127,12 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
GDISP_RAM = data;
}
@ -147,13 +147,13 @@ static GFXINLINE void setwritemode(GDisplay *g) {
FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
@ -164,7 +164,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
}
}
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);

View File

@ -49,7 +49,7 @@ static GFXINLINE void post_init_board(GDisplay* g)
}
static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
{
(void)g;
@ -72,17 +72,17 @@ static GFXINLINE void release_bus(GDisplay* g)
spiReleaseBus(SPI_DRIVER);
}
static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd)
static GFXINLINE void write_cmd(GDisplay* g, gU8 cmd)
{
(void)g;
static uint8_t buf;
static gU8 buf;
palClearPad(DC_PORT, DC_PAD);
buf = cmd;
spiSend(SPI_DRIVER, 1, &buf);
}
static GFXINLINE void write_data(GDisplay* g, uint8_t* data, uint16_t length)
static GFXINLINE void write_data(GDisplay* g, gU8* data, gU16 length)
{
(void)g;

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -46,7 +46,7 @@
static I2CConfig i2cconfig;
#if GFX_USE_OS_CHIBIOS
static int32_t thdPriority = 0;
static gI32 thdPriority = 0;
#endif
static GFXINLINE void init_board(GDisplay *g) {
@ -82,7 +82,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if(state)
CLR_RST
@ -93,7 +93,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
#if GFX_USE_OS_CHIBIOS
thdPriority = (int32_t)chThdGetPriority();
thdPriority = (gI32)chThdGetPriority();
chThdSetPriority(HIGHPRIO);
#endif
i2cAcquireBus(&I2CD1);
@ -107,8 +107,8 @@ static GFXINLINE void release_bus(GDisplay *g) {
i2cReleaseBus(&I2CD1);
}
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
uint8_t command[2];
static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) {
gU8 command[2];
(void) g;
command[0] = 0x00; // Co = 0, D/C = 0
@ -119,7 +119,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
i2cStop(&I2CD1);
}
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) {
(void) g;
i2cStart(&I2CD1, &i2cconfig);

View File

@ -0,0 +1,92 @@
#pragma once
#include <stm32f4xx_hal.h>
#include <string.h>
// The command byte to put on the front of each page line
#define SSD1312_PAGE_PREFIX 0x40 // Co = 0, D/C = 1
static I2C_HandleTypeDef i2cHandle;
static GFXINLINE void init_board(GDisplay *g)
{
(void) g;
// GPIO
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
__HAL_RCC_GPIOB_CLK_ENABLE();
// I2C SCL
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
// I2C SDA
GPIO_InitStruct.Pin = GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
}
// I2C1
{
__HAL_RCC_I2C1_CLK_ENABLE();
i2cHandle.Instance = I2C1;
i2cHandle.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
i2cHandle.Init.ClockSpeed = 400000;
i2cHandle.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
i2cHandle.Init.DutyCycle = I2C_DUTYCYCLE_2;
i2cHandle.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
i2cHandle.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
if (HAL_I2C_Init(&i2cHandle) != HAL_OK)
gfxHalt("I2C HAL init error");
}
}
static GFXINLINE void post_init_board(GDisplay *g)
{
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
{
(void) g;
(void) state;
}
static GFXINLINE void acquire_bus(GDisplay *g)
{
(void) g;
}
static GFXINLINE void release_bus(GDisplay *g)
{
(void) g;
}
static GFXINLINE void write_cmd(GDisplay *g, gU8 *data, gU16 length)
{
(void) g;
gU8 buf[4]; // length is always <= 3
buf[0] = 0x00;
memcpy(buf+1, data, length);
HAL_I2C_Master_Transmit(&i2cHandle, (0x3c << 1), buf, length+1, 10000);
}
static GFXINLINE void write_data(GDisplay *g, gU8 *data, gU16 length)
{
(void) g;
HAL_I2C_Master_Transmit(&i2cHandle, (0x3c << 1), data, length, 10000);
}

View File

@ -1,88 +0,0 @@
#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include "board_SSD1331.h"
#define LCD_BOARD_ID 0 // 0 or 1 - set by the position of a resistor near SX1505 (see schematic and board design)
// GPIO Pins
#define GPIO_DC 0x01
#define GPIO_CS 0x02
#define GPIO_RES 0x08
#define GPIO_BTN1 0x10
#define GPIO_BTN2 0x20
#define GPIO_BTN3 0x40
#define GPIO_BTN4 0x80
#define GPIO_CMD_START ~(GPIO_CS|GPIO_DC)
#define GPIO_DATA_START ~GPIO_CS
#define GPIO_TRANSFER_END GPIO_CS
//GPIO Registers
#define GPIO_RegData 0x00
#define GPIO_RegDir 0x01
#define GPIO_RegPullUp 0x02
// Wire address of the SX1505 chip
#define GPIO_ADDR 0x20
static void writeGPIO(uint8_t regAddr, uint8_t regData)
{
uint8_t oldTWBR=TWBR;
TWBR=0;
Wire.beginTransmission(GPIO_ADDR + LCD_BOARD_ID);
Wire.write(regAddr);
Wire.write(regData);
Wire.endTransmission();
TWBR=oldTWBR;
}
static bool isDataMode = false;
static bool isCmdMode = false;
void SSD1331_init_board(void) {
//setup GPIO, reset SSD1331
writeGPIO(GPIO_RegData,~GPIO_RES);//reset low, CS/other pins high
writeGPIO(GPIO_RegDir,~GPIO_RES);//set reset to output
delay(5);
writeGPIO(GPIO_RegDir,~(GPIO_CS|GPIO_DC));//reset to input, CS/DC output
writeGPIO(GPIO_RegPullUp,GPIO_BTN1|GPIO_BTN2|GPIO_BTN3|GPIO_BTN4);//button pullup enable
//init SPI
SPI.begin();
SPI.setDataMode(SPI_MODE0);//wrong mode, works because we're only writing. this mode is compatible with SD cards.
SPI.setClockDivider(SPI_CLOCK_DIV2);
isDataMode = isCmdMode = false;
}
void SSD1331_setpin_reset(int state) {
// Ignore this as we did it in the init_board
}
void SSD1331_aquirebus(void) {
// Do nothing as we do it in the data transfer
}
void SSD1331_releasebus(void) {
if (!isDataMode && !isCmdMode) return;
writeGPIO(GPIO_RegData,GPIO_TRANSFER_END);
isDataMode = isCmdMode = false;
}
void SSD1331_write_cmd(uint8_t cmd) {
if (!isCmdMode) {
writeGPIO(GPIO_RegData,GPIO_CMD_START);
isDataMode = false;
isCmdMode = true;
}
SPI.transfer(cmd);
}
void SSD1331_write_data(uint8_t data) {
if (!isDataMode) {
writeGPIO(GPIO_RegData,GPIO_DATA_START);
isDataMode = true;
isCmdMode = false;
}
SPI.transfer(data);
}

View File

@ -1,34 +0,0 @@
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
#define init_board(g) SSD1331_init_board()
#define post_init_board(g)
#define setpin_reset(g, state) SSD1331_setpin_reset(state)
#define acquire_bus(g) SSD1331_aquirebus()
#define release_bus(g) SSD1331_releasebus()
#define write_cmd(g, cmd) SSD1331_write_cmd(cmd)
#define write_data(g, data) SSD1331_write_data(data)
#ifdef __cplusplus
extern "C" {
#endif
void SSD1331_init_board(void);
void SSD1331_setpin_reset(int state);
void SSD1331_aquirebus(void);
void SSD1331_releasebus(void);
void SSD1331_write_cmd(uint8_t cmd);
void SSD1331_write_data(uint8_t data);
#ifdef __cplusplus
}
#endif
#endif /* _GDISP_LLD_BOARD_H */

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#include <Arduino.h>

View File

@ -2,23 +2,12 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
extern void ssd1351_init_board(void);
extern void ssd1351_setpin_reset(int state);
extern void ssd1351_acquire_bus(void);
extern void ssd1351_release_bus(void);
extern void ssd1351_write_cmd(unsigned char index);
extern void ssd1351_write_data(unsigned char data);
#define init_board(g) ssd1351_init_board()
#define post_init_board(g)
#define setpin_reset(g, s) ssd1351_setpin_reset(s)
@ -28,8 +17,20 @@ extern void ssd1351_write_data(unsigned char data);
#define write_cmd(g, i) ssd1351_write_cmd(i)
#define write_data(g, d) ssd1351_write_cmd(d)
/* This test is needed as this file is also included in the .cpp file providing the below functions */
#ifdef __cplusplus
extern "C" {
#endif
void ssd1351_init_board(void);
void ssd1351_setpin_reset(int state);
void ssd1351_acquire_bus(void);
void ssd1351_release_bus(void);
void ssd1351_write_cmd(unsigned char index);
void ssd1351_write_data(unsigned char data);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif
#endif /* _GDISP_LLD_BOARD_H */

View File

@ -32,8 +32,8 @@ static const LCD_Parameters DisplayTimings[] = {
// set g->board to that structure.
/* Using FSMC A16 as RS */
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */
static GFXINLINE void init_board(GDisplay *g) {
@ -81,7 +81,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
FSMC_Bank1->BTCR[0] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
}
@ -94,12 +94,12 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
GDISP_RAM = data;
}

View File

@ -72,7 +72,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
}
@ -87,14 +87,14 @@ static GFXINLINE void release_bus(GDisplay *g) {
Clr_CS;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
Set_RS; Clr_RD; Set_WR;
palWritePort(GDISP_DATA_PORT, index);
Clr_WR;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
Clr_RS; Clr_RD; Set_WR;
palWritePort(GDISP_DATA_PORT, data);

View File

@ -16,7 +16,7 @@
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);
static GFXINLINE bool_t init_board(GDisplay* g)
static GFXINLINE gBool init_board(GDisplay* g)
{
nrf_drv_spi_config_t spi_config;
ret_code_t err = NRF_SUCCESS;
@ -47,10 +47,10 @@ static GFXINLINE bool_t init_board(GDisplay* g)
spi_config.bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;
err = nrf_drv_spi_init(&spi, &spi_config, 0);
if (err != NRF_SUCCESS) {
return FALSE;
return gFalse;
}
return TRUE;
return gTrue;
}
static GFXINLINE void post_init_board(GDisplay* g)
@ -58,7 +58,7 @@ static GFXINLINE void post_init_board(GDisplay* g)
(void)g;
}
static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
{
(void)g;
@ -69,14 +69,14 @@ static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
}
}
static GFXINLINE bool_t getpin_busy(GDisplay* g)
static GFXINLINE gBool getpin_busy(GDisplay* g)
{
(void)g;
if (nrf_gpio_pin_read(PIN_BUSY) == 1) {
return TRUE;
return gTrue;
} else {
return FALSE;
return gFalse;
}
}
@ -94,7 +94,7 @@ static GFXINLINE void release_bus(GDisplay* g)
nrf_gpio_pin_set(PIN_CS);
}
static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd)
static GFXINLINE void write_cmd(GDisplay* g, gU8 cmd)
{
(void)g;
@ -102,7 +102,7 @@ static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd)
nrf_drv_spi_transfer(&spi, &cmd, 1, 0, 0);
}
static GFXINLINE void write_data(GDisplay* g, uint8_t data)
static GFXINLINE void write_data(GDisplay* g, gU8 data)
{
(void)g;
@ -110,7 +110,7 @@ static GFXINLINE void write_data(GDisplay* g, uint8_t data)
nrf_drv_spi_transfer(&spi, &data, 1, 0, 0);
}
static GFXINLINE void write_data_burst(GDisplay* g, uint8_t* data, uint8_t length)
static GFXINLINE void write_data_burst(GDisplay* g, gU8* data, gU8 length)
{
(void)g;

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -34,17 +34,17 @@ static const SPIConfig spicfg = {
// How much extra data to allocate at the end of the GMouse structure for the board's use
#define GMOUSE_ADS7843_BOARD_DATA_SIZE 0
static bool_t init_board(GMouse* m, unsigned driverinstance) {
static gBool init_board(GMouse* m, unsigned driverinstance) {
(void) m;
if (driverinstance)
return FALSE;
return gFalse;
spiStart(&SPID2, &spicfg);
return TRUE;
return gTrue;
}
static GFXINLINE bool_t getpin_pressed(GMouse* m) {
static GFXINLINE gBool getpin_pressed(GMouse* m) {
(void) m;
return (!palReadPad(GPIOG, 0));
@ -66,14 +66,14 @@ static GFXINLINE void release_bus(GMouse* m) {
//TOUCHSCREEN_SPI_EPILOGUE();
}
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) {
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
static GFXINLINE gU16 read_value(GMouse* m, gU16 port) {
static gU8 txbuf[3] = {0};
static gU8 rxbuf[3] = {0};
(void) m;
txbuf[0] = port;
spiExchange(&SPID2, 3, txbuf, rxbuf);
return ((uint16_t)rxbuf[1] << 5) | (rxbuf[2] >> 3);
return ((gU16)rxbuf[1] << 5) | (rxbuf[2] >> 3);
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -45,11 +45,11 @@ static const SPIConfig spicfg = {
// How much extra data to allocate at the end of the GMouse structure for the board's use
#define GMOUSE_ADS7843_BOARD_DATA_SIZE 0
static bool_t init_board(GMouse* m, unsigned driverinstance) {
static gBool init_board(GMouse* m, unsigned driverinstance) {
(void) m;
if (driverinstance)
return FALSE;
return gFalse;
palSetPadMode(GPIOB, 13, PAL_MODE_ALTERNATE(5) ); /* SCK */
palSetPadMode(GPIOB, 14, PAL_MODE_ALTERNATE(5) ); /* MISO */
@ -57,10 +57,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
palSetPadMode(GPIOC, 4, PAL_MODE_OUTPUT_PUSHPULL); /* CS */
spiStart(&SPID2, &spicfg);
return TRUE;
return gTrue;
}
static GFXINLINE bool_t getpin_pressed(GMouse* m) {
static GFXINLINE gBool getpin_pressed(GMouse* m) {
(void) m;
return (!palReadPad(GPIOC, 5));
@ -80,15 +80,15 @@ static GFXINLINE void release_bus(GMouse* m) {
spiReleaseBus(&SPID2);
}
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) {
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
static GFXINLINE gU16 read_value(GMouse* m, gU16 port) {
static gU8 txbuf[3] = {0};
static gU8 rxbuf[3] = {0};
(void) m;
txbuf[0] = port;
spiExchange(&SPID2, 3, txbuf, rxbuf);
return ((uint16_t)rxbuf[1] << 5) | (rxbuf[2] >> 3);
return ((gU16)rxbuf[1] << 5) | (rxbuf[2] >> 3);
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */

View File

@ -16,7 +16,7 @@
static SPI_HandleTypeDef _hspi;
static bool_t init_board(GMouse* m, unsigned driverinstance)
static gBool init_board(GMouse* m, unsigned driverinstance)
{
GPIO_InitTypeDef GPIO_InitStruct;
@ -93,20 +93,20 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
_hspi.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
_hspi.Init.CRCPolynomial = 10;
if (HAL_SPI_Init(&_hspi) != HAL_OK) {
return FALSE;
return gFalse;
}
return TRUE;
return gTrue;
}
static GFXINLINE bool_t getpin_pressed(GMouse* m)
static GFXINLINE gBool getpin_pressed(GMouse* m)
{
(void)m;
if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_4) == GPIO_PIN_RESET)
return TRUE;
return gTrue;
return FALSE;
return gFalse;
}
static GFXINLINE void aquire_bus(GMouse* m)
@ -123,11 +123,11 @@ static GFXINLINE void release_bus(GMouse* m)
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET);
}
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t reg)
static GFXINLINE gU16 read_value(GMouse* m, gU16 reg)
{
uint8_t txbuf[3] = {0, 0, 0};
uint8_t rxbuf[3] = {0, 0, 0};
uint16_t ret;
gU8 txbuf[3] = {0, 0, 0};
gU8 rxbuf[3] = {0, 0, 0};
gU16 ret;
(void)m;

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -48,29 +48,29 @@ static struct ADCDriver ADCD;
#define YPOS 11 // D
static const ADCConversionGroup ADC_X_CG = {
.circular = FALSE,
.circular = 0,
.num_channels = 1,
.channels = 1 << XNEG,
};
static const ADCConversionGroup ADC_Y_CG = {
.circular = FALSE,
.circular = 0,
.num_channels = 1,
.channels = 1 << YPOS,
};
static bool_t init_board(GMouse *m, unsigned driverinstance) {
static gBool init_board(GMouse *m, unsigned driverinstance) {
(void) m;
if (driverinstance)
return FALSE;
return gFalse;
adcObjectInit(&ADCD);
adcStart(&ADCD, &ADCC);
return TRUE;
return gTrue;
}
static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
static gBool read_xyz(GMouse *m, GMouseReading *prd) {
adcsample_t samples[2];
prd->buttons = 0;
@ -89,7 +89,7 @@ static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
// Shortcut - no need to read X or Y if the touch is off.
if (pdr->z < GMOUSE_MCU_Z_TOUCHON)
return TRUE;
return gTrue;
// Read X
palSetPadMode(IOPORTB, XPOS, PAL_MODE_OUTPUT);
@ -111,7 +111,7 @@ static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
adcConvert(&ADCD, &ADC_X_CG, &samples[0], 1);
pdr->y = ADC_MAX - samples[0];
return TRUE;
return gTrue;
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#define SCREEN_WIDTH 800
@ -10,19 +10,19 @@
#define FRAMEREADER_BASE ALT_VIP_VFR_0_BASE
#if GDISP_NEED_CONTROL
static void board_backlight(GDisplay* g, uint8_t percent)
static void board_backlight(GDisplay* g, gU8 percent)
{
(void) g;
(void) percent;
}
static void board_contrast(GDisplay* g, uint8_t percent)
static void board_contrast(GDisplay* g, gU8 percent)
{
(void) g;
(void) percent;
}
static void board_power(GDisplay* g, powermode_t pwr)
static void board_power(GDisplay* g, gPowermode pwr)
{
(void) g;
(void) pwr;

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GINPUT_LLD_MOUSE_BOARD_H
@ -25,11 +25,11 @@
// How much extra data to allocate at the end of the GMouse structure for the board's use
#define GMOUSE_FT5316_BOARD_DATA_SIZE 0
// Set this to TRUE if you want self-calibration.
// Set this to GFXON if you want self-calibration.
// NOTE: This is not as accurate as real calibration.
// It requires the orientation of the touch panel to match the display.
// It requires the active area of the touch panel to exactly match the display size.
#define GMOUSE_FT5316_SELF_CALIBRATE TRUE
#define GMOUSE_FT5316_SELF_CALIBRATE GFXON
static unsigned int device_write(unsigned char device_address, unsigned char sub_address, unsigned char wdata)
{
@ -66,39 +66,39 @@ static unsigned int device_read_16(unsigned char device_address, unsigned char s
return (0xFFFF & ((rdata_h << 8) | rdata_l));
}
static bool_t init_board(GMouse* m, unsigned instance)
static gBool init_board(GMouse* m, unsigned instance)
{
(void)m;
(void)instance;
I2C_init(I2C_OPENCORES_0_BASE, 50000000, 400000);
return TRUE;
return gTrue;
}
static void write_reg(GMouse* m, uint8_t reg, uint8_t val)
static void write_reg(GMouse* m, gU8 reg, gU8 val)
{
(void)m;
device_write(FT5316_I2C_SLAVE_ADDRESS, reg, val);
}
static uint8_t read_byte(GMouse* m, uint8_t reg)
static gU8 read_byte(GMouse* m, gU8 reg)
{
(void)m;
uint8_t ret = 0;
gU8 ret = 0;
ret = (uint8_t)device_read(FT5316_I2C_SLAVE_ADDRESS, reg);
ret = (gU8)device_read(FT5316_I2C_SLAVE_ADDRESS, reg);
return ret;
}
static uint16_t read_word(GMouse* m, uint8_t reg)
static gU16 read_word(GMouse* m, gU8 reg)
{
(void)m;
uint16_t ret = 0;
gU16 ret = 0;
ret = (uint16_t)device_read(FT5316_I2C_SLAVE_ADDRESS, reg);
ret = (gU16)device_read(FT5316_I2C_SLAVE_ADDRESS, reg);
return ret;
}

View File

@ -26,9 +26,9 @@
// Wire address of the SX1505 chip
#define GPIO_ADDR 0x20
static void writeGPIO(uint8_t regAddr, uint8_t regData)
static void writeGPIO(gU8 regAddr, gU8 regData)
{
uint8_t oldTWBR=TWBR;
gU8 oldTWBR=TWBR;
TWBR=0;
Wire.beginTransmission(GPIO_ADDR + LCD_BOARD_ID);
Wire.write(regAddr);
@ -69,7 +69,7 @@ void SSD1331_releasebus(void) {
isDataMode = isCmdMode = false;
}
void SSD1331_write_cmd(uint8_t cmd) {
void SSD1331_write_cmd(gU8 cmd) {
if (!isCmdMode) {
writeGPIO(GPIO_RegData,GPIO_CMD_START);
isDataMode = false;
@ -78,7 +78,7 @@ void SSD1331_write_cmd(uint8_t cmd) {
SPI.transfer(cmd);
}
void SSD1331_write_data(uint8_t data) {
void SSD1331_write_data(gU8 data) {
if (!isDataMode) {
writeGPIO(GPIO_RegData,GPIO_DATA_START);
isDataMode = true;

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -16,6 +16,7 @@
#define write_cmd(g, cmd) SSD1331_write_cmd(cmd)
#define write_data(g, data) SSD1331_write_data(data)
/* This test is needed as this file is also included in the .cpp file providing the below functions */
#ifdef __cplusplus
extern "C" {
#endif
@ -24,8 +25,8 @@ void SSD1331_init_board(void);
void SSD1331_setpin_reset(int state);
void SSD1331_aquirebus(void);
void SSD1331_releasebus(void);
void SSD1331_write_cmd(uint8_t cmd);
void SSD1331_write_data(uint8_t data);
void SSD1331_write_cmd(gU8 cmd);
void SSD1331_write_data(gU8 data);
#ifdef __cplusplus
}

View File

@ -31,18 +31,18 @@
#define _GFXCONF_H
/* The operating system to use. One of these must be defined - preferably in your Makefile */
//#define GFX_USE_OS_CHIBIOS FALSE
//#define GFX_USE_OS_WIN32 FALSE
//#define GFX_USE_OS_LINUX FALSE
//#define GFX_USE_OS_OSX FALSE
#define GFX_USE_OS_ARDUINO TRUE
//#define GFX_USE_OS_CHIBIOS GFXOFF
//#define GFX_USE_OS_WIN32 GFXOFF
//#define GFX_USE_OS_LINUX GFXOFF
//#define GFX_USE_OS_OSX GFXOFF
#define GFX_USE_OS_ARDUINO GFXON
/* GFX sub-systems to turn on */
#define GFX_USE_GDISP TRUE
#define GFX_USE_GDISP GFXON
/* Features for the GDISP sub-system. */
#define GDISP_NEED_VALIDATION TRUE
#define GDISP_NEED_CLIP TRUE
#define GDISP_NEED_VALIDATION GFXON
#define GDISP_NEED_CLIP GFXON
#endif /* _GFXCONF_H */

View File

@ -3,8 +3,8 @@
#include <gfx.h>
void setup() {
coord_t width, height;
coord_t i, j;
gCoord width, height;
gCoord i, j;
pinMode(13, OUTPUT);
@ -17,12 +17,12 @@ void setup() {
height = gdispGetHeight();
// Code Here
gdispDrawBox(10, 10, width / 2, height / 2, Yellow);
gdispFillArea(width / 2, height / 2, width / 2 - 10, height / 2 - 10, Blue);
gdispDrawLine(5, 30, width - 50, height - 40, Red);
gdispDrawBox(10, 10, width / 2, height / 2, GFX_YELLOW);
gdispFillArea(width / 2, height / 2, width / 2 - 10, height / 2 - 10, GFX_BLUE);
gdispDrawLine(5, 30, width - 50, height - 40, GFX_RED);
for (i = 5, j = 0; i < width && j < height; i += 7, j += i / 20)
gdispDrawPixel(i, j, White);
gdispDrawPixel(i, j, GFX_WHITE);
#endif
}

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Embest-STM32-DMSTF4BB
GFXSRC +=
GFXDEFS += -DGFX_USE_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_CHIBIOS=GFXON
include $(GFXLIB)/drivers/gdisp/SSD2119/driver.mk
include $(GFXLIB)/drivers/ginput/touch/STMPE811/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -12,8 +12,8 @@
// set g->board to that structure.
/* Using FSMC A19 (PE3) as DC */
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* DC = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* DC = 1 */
#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* DC = 0 */
#define GDISP_RAM (*((volatile gU16 *) 0x60100000)) /* DC = 1 */
#define GDISP_DMA_STREAM STM32_DMA2_STREAM6
#define SET_RST palSetPad(GPIOD, 3);
@ -99,7 +99,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if (state) {
CLR_RST;
@ -108,7 +108,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
}
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
pwmEnableChannel(&PWMD4, 1, percent);
}
@ -121,12 +121,12 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
GDISP_RAM = data;
}
@ -139,13 +139,13 @@ static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#if defined(GDISP_USE_DMA)
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
@ -156,7 +156,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
}
}
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);

View File

@ -74,7 +74,7 @@ bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
return FALSE;
return 0;
}
#endif /* HAL_USE_SDC */
@ -96,7 +96,7 @@ bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) {
(void)mmcp;
return FALSE;
return 0;
}
#endif

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GINPUT_LLD_MOUSE_BOARD_H
@ -20,16 +20,16 @@
#define GMOUSE_STMPE811_BOARD_DATA_SIZE 0
// Options - Leave these commented to make it user configurable in the gfxconf.h
//#define GMOUSE_STMPE811_READ_PRESSURE FALSE
//#define GMOUSE_STMPE811_SELF_CALIBRATE FALSE
//#define GMOUSE_STMPE811_TEST_MODE FALSE
//#define GMOUSE_STMPE811_READ_PRESSURE GFXOFF
//#define GMOUSE_STMPE811_SELF_CALIBRATE GFXOFF
//#define GMOUSE_STMPE811_TEST_MODE GFXOFF
// If TRUE this board has the STMPE811 IRQ pin connected to a GPIO.
// If GFXON this board has the STMPE811 IRQ pin connected to a GPIO.
// Note: Although this board has such a pin its reliability has not been tested on this board!!!!!
#define GMOUSE_STMPE811_GPIO_IRQPIN FALSE
#define GMOUSE_STMPE811_GPIO_IRQPIN GFXOFF
// If TRUE this is a really slow CPU and we should always clear the FIFO between reads.
#define GMOUSE_STMPE811_SLOW_CPU FALSE
// If GFXON this is a really slow CPU and we should always clear the FIFO between reads.
#define GMOUSE_STMPE811_SLOW_CPU GFXOFF
// Slave address
#define STMPE811_ADDR (0x82 >> 1)
@ -43,12 +43,12 @@ static const I2CConfig i2ccfg = {
FAST_DUTY_CYCLE_2,
};
static bool_t init_board(GMouse* m, unsigned driverinstance) {
static gBool init_board(GMouse* m, unsigned driverinstance) {
(void) m;
// This board only supports one touch panel
if (driverinstance)
return FALSE;
return gFalse;
palSetPadMode(GPIOC, 13, PAL_MODE_INPUT | PAL_STM32_PUDR_FLOATING); /* TP IRQ */
palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SCL */
@ -56,11 +56,11 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
i2cStart(&I2CD1, &i2ccfg);
return TRUE;
return gTrue;
}
#if GMOUSE_STMPE811_GPIO_IRQPIN
static bool_t getpin_irq(GMouse* m) {
static gBool getpin_irq(GMouse* m) {
(void) m;
return !palReadPad(GPIOC, 13);
@ -77,8 +77,8 @@ static GFXINLINE void release_bus(GMouse* m) {
}
static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {
uint8_t txbuf[2];
static void write_reg(GMouse* m, gU8 reg, gU8 val) {
gU8 txbuf[2];
(void) m;
txbuf[0] = reg;
@ -89,8 +89,8 @@ static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {
i2cReleaseBus(&I2CD1);
}
static uint8_t read_byte(GMouse* m, uint8_t reg) {
uint8_t rxbuf[1];
static gU8 read_byte(GMouse* m, gU8 reg) {
gU8 rxbuf[1];
(void) m;
rxbuf[0] = 0;
@ -102,8 +102,8 @@ static uint8_t read_byte(GMouse* m, uint8_t reg) {
return rxbuf[0];
}
static uint16_t read_word(GMouse* m, uint8_t reg) {
uint8_t rxbuf[2];
static gU16 read_word(GMouse* m, gU8 reg) {
gU8 rxbuf[2];
(void) m;
rxbuf[0] = 0;
@ -113,7 +113,7 @@ static uint16_t read_word(GMouse* m, uint8_t reg) {
i2cMasterTransmitTimeout(&I2CD1, STMPE811_ADDR, &reg, 1, rxbuf, 2, MS2ST(STMPE811_TIMEOUT));
i2cReleaseBus(&I2CD1);
return (((uint16_t)rxbuf[0]) << 8) | rxbuf[1];
return (((gU16)rxbuf[0]) << 8) | rxbuf[1];
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/FireBull-STM32F103-FB
GFXSRC +=
GFXDEFS += -DGFX_USE_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_CHIBIOS=GFXON
include $(GFXLIB)/boards/base/FireBull-STM32F103-FB/chibios_board/board.mk
include $(GFXLIB)/drivers/gdisp/SSD1289/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -48,7 +48,7 @@ static GFXINLINE void post_init_board(GDisplay *g)
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state)
static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
{
(void) g;
(void) state;
@ -56,7 +56,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state)
/* Nothing to do here - reset pin tied to Vcc */
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent)
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent)
{
(void) g;
(void) percent;
@ -74,7 +74,7 @@ static GFXINLINE void release_bus(GDisplay *g)
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index)
static GFXINLINE void write_index(GDisplay *g, gU16 index)
{
(void) g;
@ -85,7 +85,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index)
SET_RS;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data)
static GFXINLINE void write_data(GDisplay *g, gU16 data)
{
(void) g;
@ -112,7 +112,7 @@ static GFXINLINE void setwritemode(GDisplay *g)
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return palReadPort(GPIOE);

View File

@ -1,3 +1,3 @@
BOARDINC = $(GFXLIB)/boards/base/FireBull-STM32F103-FB/chibios_board
BOARDSRC = $(BOARDINC)/board.c \
BOARDINC = $(GFXLIB)/boards/base/FireBull-STM32F103-FB/chibios_board
BOARDSRC = $(BOARDINC)/board.c \

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GINPUT_LLD_MOUSE_BOARD_H
@ -26,13 +26,13 @@ static const SPIConfig spicfg = {
/* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0,
};
static bool_t init_board(GMouse* m, unsigned driverinstance)
static gBool init_board(GMouse* m, unsigned driverinstance)
{
(void)m;
// Only one touch interface on this board
if (driverinstance)
return FALSE;
return gFalse;
// Set the GPIO modes
palSetPadMode(GPIOC, 4, PAL_MODE_INPUT_PULLUP);
@ -40,10 +40,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
// Start the SPI peripheral
spiStart(&SPID1, &spicfg);
return TRUE;
return gTrue;
}
static GFXINLINE bool_t getpin_pressed(GMouse* m)
static GFXINLINE gBool getpin_pressed(GMouse* m)
{
(void) m;
@ -66,11 +66,11 @@ static GFXINLINE void release_bus(GMouse* m)
spiReleaseBus(&SPID1);
}
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port)
static GFXINLINE gU16 read_value(GMouse* m, gU16 port)
{
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
uint16_t ret;
static gU8 txbuf[3] = {0};
static gU8 rxbuf[3] = {0};
gU16 ret;
(void) m;
txbuf[0] = port;

View File

@ -0,0 +1,6 @@
GFXINC +=
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_FREEBSD=GFXON
GFXLIBS += rt
include $(GFXLIB)/drivers/multiple/SDL/driver.mk

View File

@ -0,0 +1,52 @@
# Possible Targets: all clean Debug cleanDebug Release cleanRelease
##############################################################################################
# Settings
#
# General settings
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
OPT_OS = freebsd
OPT_LINK_OPTIMIZE = yes
# Change this next setting (or add the explicit compiler flags) if you are not compiling for x86 linux
OPT_CPU = x64
# uGFX settings
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
GFXLIB = ../uGFX
GFXBOARD = FreeBSD-SDL
GFXDEMO = modules/gdisp/basics
# Linux settings
# See $(GFXLIB)/tools/gmake_scripts/os_linux.mk for the list of variables
##############################################################################################
# Set these for your project
#
ARCH =
XCC = gcc10
XAS = gcc10
XLD = gcc10
SRCFLAGS = -ggdb -O0
CFLAGS = `sdl2-config --libs --cflags`
CXXFLAGS =
ASFLAGS =
LDFLAGS =
SRC =
OBJS =
DEFS =
LIBS =
INCPATH =
LIBPATH =
##############################################################################################
# These should be at the end
#
include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk
include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
# *** EOF ***

View File

@ -0,0 +1,22 @@
This directory contains the interface for FreeBSD using SDL.
As of today, this is simply a wrapper around the Linux drivers/support.
On this board uGFX currently supports:
- GDISP via the SDL driver
- GINPUT-touch via the SDL driver
- GINPUT-keyboard via the SDL driver
The folowing packages are required to run uGFX using this driver on
a 64-bit FreeBSD system using SDL:
+ devel/gcc10
+ devel/sdl2
The following should be added to the CFLAGS of the target makefile:
CFLAGS = `sdl2-config --libs --cflags`
There is an example Makefile and project in the examples directory.

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/HY-MiniSTM32V
GFXSRC +=
GFXDEFS += -DGFX_USE_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_CHIBIOS=GFXON
include $(GFXLIB)/boards/base/HY-MiniSTM32V/chibios_board/board.mk
include $(GFXLIB)/drivers/gdisp/SSD1289/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef GDISP_LLD_BOARD_H
@ -40,8 +40,8 @@ static const PWMConfig pwmcfg =
/*
* LCD_RS is on A16 (PD11)
*/
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */
/*
* STM32_DMA1_STREAM7
* NOTE: conflicts w/ USART2_TX, TIM2_CH2, TIM2_CH4, TIM4_UP, I2C1_RX in case
@ -124,14 +124,14 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if(state) {}
else {}
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
if (percent > 100) { percent = 100; }
pwmEnableChannel(&PWMD3, 1, percent);
@ -145,12 +145,12 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
GDISP_RAM = data;
}
@ -163,13 +163,13 @@ static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | \
@ -182,7 +182,7 @@ static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
}
}
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | \

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/*
@ -46,7 +46,7 @@ static const SPIConfig spicfg = {
* TP_IRQ PB6
*/
static bool_t init_board(GMouse* m, unsigned driverinstance) {
static gBool init_board(GMouse* m, unsigned driverinstance) {
(void) m;
(void) driverinstance;
@ -63,7 +63,7 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
/*
* PB6 is connected to TP_IRQ (low active).
*/
static GFXINLINE bool_t getpin_pressed(GMouse* m) {
static GFXINLINE gBool getpin_pressed(GMouse* m) {
(void)m;
return (!palReadPad(GPIOB, 6));
}
@ -83,11 +83,11 @@ static GFXINLINE void release_bus(GMouse* m) {
spiReleaseBus(&SPID1);
}
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) {
static GFXINLINE gU16 read_value(GMouse* m, gU16 port) {
(void)m;
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
uint16_t ret;
static gU8 txbuf[3] = {0};
static gU8 rxbuf[3] = {0};
gU16 ret;
txbuf[0] = port;
spiExchange(&SPID1, 3, txbuf, rxbuf);

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Linux-Framebuffer-Touch
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_LINUX=TRUE
GFXDEFS += -DGFX_USE_OS_LINUX=GFXON
GFXLIBS += rt
include $(GFXLIB)/boards/base/Linux-Framebuffer/board.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GINPUT_LLD_MOUSE_BOARD_H
@ -21,12 +21,12 @@
// The linux device input used for touchscreen
#define GMOUSE_LINUX_EVENT_DEVICE "/dev/input/event0"
// Set this to TRUE if you want self-calibration.
// Set this to GFXON if you want self-calibration.
// NOTE: This is not as accurate as real calibration.
// It requires the orientation of the touch panel to match the display.
// It requires the active area of the touch panel to exactly match the display size.
#define GMOUSE_LINUX_EVENT_SELF_CALIBRATE FALSE
#define GMOUSE_LINUX_EVENT_SELF_CALIBRATE GFXOFF
#define GMOUSE_LINUX_EVENT_FINGERMODE TRUE
#define GMOUSE_LINUX_EVENT_FINGERMODE GFXON
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Linux-Framebuffer
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_LINUX=TRUE
GFXDEFS += -DGFX_USE_OS_LINUX=GFXON
GFXLIBS += rt
include $(GFXLIB)/drivers/gdisp/framebuffer/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
// Set this to your frame buffer pixel format. Note Linux frame buffer only supports RGB modes (no BGR modes).
@ -203,17 +203,17 @@
#endif
#if GDISP_NEED_CONTROL
static void board_backlight(GDisplay *g, uint8_t percent) {
static void board_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
static void board_contrast(GDisplay *g, uint8_t percent) {
static void board_contrast(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
static void board_power(GDisplay *g, powermode_t pwr) {
static void board_power(GDisplay *g, gPowermode pwr) {
(void) g;
(void) pwr;
}

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Linux
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_LINUX=TRUE
GFXDEFS += -DGFX_USE_OS_LINUX=GFXON
GFXLIBS += rt
include $(GFXLIB)/drivers/multiple/SDL/driver.mk

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Linux
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_LINUX=TRUE
GFXDEFS += -DGFX_USE_OS_LINUX=GFXON
GFXLIBS += rt
include $(GFXLIB)/drivers/multiple/X/driver.mk

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Marlin
GFXSRC +=
GFXDEFS += -DGFX_USE_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_CHIBIOS=GFXON
include $(GFXLIB)/boards/base/Marlin/chibios_board/board.mk
include $(GFXLIB)/drivers/gdisp/RA8875/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -15,8 +15,8 @@
// For a multiple display configuration we would put all this in a structure and then
// set g->board to that structure.
#define GDISP_RAM (*((volatile uint16_t *) 0x68000000)) /* RS = 0 */
#define GDISP_REG (*((volatile uint16_t *) 0x68020000)) /* RS = 1 */
#define GDISP_RAM (*((volatile gU16 *) 0x68000000)) /* RS = 0 */
#define GDISP_REG (*((volatile gU16 *) 0x68020000)) /* RS = 1 */
#define FSMC_BANK 4
@ -70,7 +70,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
FSMC_Bank1->BTCR[2] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
}
@ -83,13 +83,13 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
GDISP_RAM = data;
@ -103,7 +103,7 @@ static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;

View File

@ -1,88 +1,88 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012,2013 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT 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/RT 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/>.
*/
#include "ch.h"
#include "hal.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
const PALConfig pal_default_config =
{
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
};
#endif
/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
#if HAL_USE_SDC
/*
* Card detection through the card internal pull-up on D3.
*/
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
return (bool_t)!palReadPad(GPIOD, GPIOD_SDIO_CD_N);
}
/*
* Card write protection detection is not possible, the card is always
* reported as not protected.
*/
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
return FALSE;
}
#endif /* HAL_USE_SDC */
/**
* @brief Board-specific initialization code.
*/
void boardInit(void) {
}
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012,2013 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT 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/RT 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/>.
*/
#include "ch.h"
#include "hal.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
const PALConfig pal_default_config =
{
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
};
#endif
/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
#if HAL_USE_SDC
/*
* Card detection through the card internal pull-up on D3.
*/
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
return (bool_t)!palReadPad(GPIOD, GPIOD_SDIO_CD_N);
}
/*
* Card write protection detection is not possible, the card is always
* reported as not protected.
*/
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
return 0;
}
#endif /* HAL_USE_SDC */
/**
* @brief Board-specific initialization code.
*/
void boardInit(void) {
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
BOARDINC = $(GFXLIB)/boards/base/Marlin/chibios_board
BOARDSRC = $(BOARDINC)/board.c \
BOARDINC = $(GFXLIB)/boards/base/Marlin/chibios_board
BOARDSRC = $(BOARDINC)/board.c \

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GINPUT_LLD_MOUSE_BOARD_H
@ -19,11 +19,11 @@
// How much extra data to allocate at the end of the GMouse structure for the board's use
#define GMOUSE_FT5x06_BOARD_DATA_SIZE 0
// Set this to TRUE if you want self-calibration.
// Set this to GFXON if you want self-calibration.
// NOTE: This is not as accurate as real calibration.
// It requires the orientation of the touch panel to match the display.
// It requires the active area of the touch panel to exactly match the display size.
#define GMOUSE_FT5x06_SELF_CALIBRATE FALSE
#define GMOUSE_FT5x06_SELF_CALIBRATE GFXOFF
/* I2C interface #2 - Touchscreen controller */
static const I2CConfig i2ccfg2 = {
@ -32,13 +32,13 @@ static const I2CConfig i2ccfg2 = {
FAST_DUTY_CYCLE_2,
};
static bool_t init_board(GMouse* m, unsigned driverinstance) {
static gBool init_board(GMouse* m, unsigned driverinstance) {
(void) m;
// We only support one of these on this board
if (driverinstance)
return FALSE;
return TRUE;
return gFalse;
return gTrue;
}
static GFXINLINE void aquire_bus(GMouse* m) {
@ -51,8 +51,8 @@ static GFXINLINE void release_bus(GMouse* m) {
}
static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {
uint8_t txbuf[2];
static void write_reg(GMouse* m, gU8 reg, gU8 val) {
gU8 txbuf[2];
(void) m;
txbuf[0] = reg;
@ -63,8 +63,8 @@ static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {
i2cReleaseBus(&I2CD2);
}
static uint8_t read_byte(GMouse* m, uint8_t reg) {
uint8_t rxbuf[1];
static gU8 read_byte(GMouse* m, gU8 reg) {
gU8 rxbuf[1];
(void) m;
rxbuf[0] = 0;
@ -76,8 +76,8 @@ static uint8_t read_byte(GMouse* m, uint8_t reg) {
return rxbuf[0];
}
static uint16_t read_word(GMouse* m, uint8_t reg) {
uint8_t rxbuf[2];
static gU16 read_word(GMouse* m, gU8 reg) {
gU8 rxbuf[2];
(void) m;
rxbuf[0] = 0;
@ -87,7 +87,7 @@ static uint16_t read_word(GMouse* m, uint8_t reg) {
i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, &reg, 1, rxbuf, 2, MS2ST(FT5x06_TIMEOUT));
i2cReleaseBus(&I2CD2);
return (((uint16_t)rxbuf[0]) << 8) | rxbuf[1];
return (((gU16)rxbuf[0]) << 8) | rxbuf[1];
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */

View File

@ -19,10 +19,10 @@ static const SPIConfig flash_spicfg = {
};
bool flash_is_write_busy(void) {
static uint8_t is_write_busy_cmd[1];
static gU8 is_write_busy_cmd[1];
is_write_busy_cmd[0] = _SERIAL_FLASH_CMD_RDSR;
uint8_t result[1];
gU8 result[1];
spiAcquireBus(&SPID3);
spiStart(&SPID3, &flash_spicfg);
@ -44,9 +44,9 @@ void flash_write_enable(void) {
spiReleaseBus(&SPID3);
}
void flash_sector_erase(uint32_t sector) {
void flash_sector_erase(gU32 sector) {
flash_write_enable();
static uint8_t sector_erase_cmd[4];
static gU8 sector_erase_cmd[4];
sector_erase_cmd[0] = _SERIAL_FLASH_CMD_SER;
sector_erase_cmd[1] = (sector >> 16) & 0xFF;
sector_erase_cmd[2] = (sector >> 8) & 0xFF;
@ -64,8 +64,8 @@ void flash_sector_erase(uint32_t sector) {
while(flash_is_write_busy());
}
void flash_read(uint32_t address, size_t bytes, uint8_t *out) {
static uint8_t sector_read_cmd[4];
void flash_read(gU32 address, gMemSize bytes, gU8 *out) {
static gU8 sector_read_cmd[4];
sector_read_cmd[0] = _SERIAL_FLASH_CMD_READ;
sector_read_cmd[1] = (address >> 16) & 0xFF;
sector_read_cmd[2] = (address >> 8) & 0xFF;
@ -80,8 +80,8 @@ void flash_read(uint32_t address, size_t bytes, uint8_t *out) {
spiReleaseBus(&SPID3);
}
void flash_write(uint32_t address, size_t bytes, const uint8_t *data) {
static uint8_t flash_write_cmd[4];
void flash_write(gU32 address, gMemSize bytes, const gU8 *data) {
static gU8 flash_write_cmd[4];
flash_write_enable();
@ -103,21 +103,21 @@ void flash_write(uint32_t address, size_t bytes, const uint8_t *data) {
}
bool flash_tp_calibrated(void) {
uint8_t out[1];
gU8 out[1];
flash_read(0x0F0000, 1, out);
return (out[0] == 0x01);
}
void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz) {
void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz) {
if (instance) return;
flash_sector_erase(0x0F0000);
uint8_t calibrated = 0x01;
gU8 calibrated = 0x01;
flash_write(0x0F0000, 1, &calibrated);
flash_write(0x0F0001, sz, calbuf);
}
const char *flash_tp_calibration_load(uint16_t instance) {
static uint8_t foo[24];
const char *flash_tp_calibration_load(gU16 instance) {
static gU8 foo[24];
if (instance) return 0;
if (!flash_tp_calibrated()) return 0;

View File

@ -1,6 +1,6 @@
void flash_sector_erase(uint32_t sector);
void flash_read(uint32_t address, size_t bytes, uint8_t *out);
void flash_write(uint32_t address, size_t bytes, const uint8_t *data);
void flash_sector_erase(gU32 sector);
void flash_read(gU32 address, gMemSize bytes, gU8 *out);
void flash_write(gU32 address, gMemSize bytes, const gU8 *data);
bool flash_tp_calibrated(void);
void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz);
const char *flash_tp_calibration_load(uint16_t instance);
void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz);
const char *flash_tp_calibration_load(gU16 instance);

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Mikromedia-Plus-STM32-M4
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_OS_CHIBIOS=GFXON
include $(GFXLIB)/drivers/gdisp/SSD1963/driver.mk
include $(GFXLIB)/drivers/ginput/touch/STMPE610/driver.mk
include $(GFXLIB)/drivers/gaudio/vs1053/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -68,7 +68,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if (state) {
CLR_RST;
@ -87,7 +87,7 @@ static GFXINLINE void release_bus(GDisplay *g) {
SET_CS;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
CLR_DC;
@ -97,7 +97,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
SET_DC;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
palWriteBus(&busDataLo, (data & 0xFF));
@ -117,8 +117,8 @@ static GFXINLINE void setwritemode(GDisplay *g) {
palSetBusMode(&busDataHi, PAL_MODE_OUTPUT_PUSHPULL);
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
uint16_t data;
static GFXINLINE gU16 read_data(GDisplay *g) {
gU16 data;
(void) g;
CLR_RD;

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef GAUDIO_PLAY_BOARD_H

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GINPUT_LLD_MOUSE_BOARD_H
@ -20,16 +20,16 @@
#define GMOUSE_STMPE610_BOARD_DATA_SIZE 0
// Options - Leave these commented to make it user configurable in the gfxconf.h
//#define GMOUSE_STMPE610_READ_PRESSURE FALSE
//#define GMOUSE_STMPE610_SELF_CALIBRATE FALSE
//#define GMOUSE_STMPE610_TEST_MODE FALSE
//#define GMOUSE_STMPE610_READ_PRESSURE GFXOFF
//#define GMOUSE_STMPE610_SELF_CALIBRATE GFXOFF
//#define GMOUSE_STMPE610_TEST_MODE GFXOFF
// If TRUE this board has the STMPE610 IRQ pin connected to a GPIO.
// If GFXON this board has the STMPE610 IRQ pin connected to a GPIO.
// Note: Although this board has such a pin its reliability has not been tested on this board!!!!!
#define GMOUSE_STMPE610_GPIO_IRQPIN FALSE
#define GMOUSE_STMPE610_GPIO_IRQPIN GFXOFF
// If TRUE this is a really slow CPU and we should always clear the FIFO between reads.
#define GMOUSE_STMPE610_SLOW_CPU FALSE
// If GFXON this is a really slow CPU and we should always clear the FIFO between reads.
#define GMOUSE_STMPE610_SLOW_CPU GFXOFF
// Slave address
#define STMPE610_ADDR (0x88 >> 1)
@ -43,12 +43,12 @@ static const I2CConfig i2ccfg = {
FAST_DUTY_CYCLE_2,
};
static bool_t init_board(GMouse* m, unsigned driverinstance) {
static gBool init_board(GMouse* m, unsigned driverinstance) {
(void) m;
// This board only supports one touch panel
if (driverinstance)
return FALSE;
return gFalse;
palSetPadMode(GPIOA, 0, PAL_MODE_INPUT | PAL_STM32_PUDR_FLOATING); /* TP IRQ */
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SCL */
@ -56,11 +56,11 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
i2cStart(&I2CD1, &i2ccfg);
return TRUE;
return gTrue;
}
#if GMOUSE_STMPE610_GPIO_IRQPIN
static bool_t getpin_irq(GMouse* m) {
static gBool getpin_irq(GMouse* m) {
(void) m;
return !palReadPad(GPIOA, 0);
@ -77,8 +77,8 @@ static GFXINLINE void release_bus(GMouse* m) {
}
static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {
uint8_t txbuf[2];
static void write_reg(GMouse* m, gU8 reg, gU8 val) {
gU8 txbuf[2];
(void) m;
txbuf[0] = reg;
@ -89,8 +89,8 @@ static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {
i2cReleaseBus(&I2CD1);
}
static uint8_t read_byte(GMouse* m, uint8_t reg) {
uint8_t rxbuf[1];
static gU8 read_byte(GMouse* m, gU8 reg) {
gU8 rxbuf[1];
(void) m;
rxbuf[0] = 0;
@ -102,8 +102,8 @@ static uint8_t read_byte(GMouse* m, uint8_t reg) {
return rxbuf[0];
}
static uint16_t read_word(GMouse* m, uint8_t reg) {
uint8_t rxbuf[2];
static gU16 read_word(GMouse* m, gU8 reg) {
gU8 rxbuf[2];
(void) m;
rxbuf[0] = 0;
@ -113,7 +113,7 @@ static uint16_t read_word(GMouse* m, uint8_t reg) {
i2cMasterTransmitTimeout(&I2CD1, STMPE610_ADDR, &reg, 1, rxbuf, 2, MS2ST(STMPE610_TIMEOUT));
i2cReleaseBus(&I2CD1);
return (((uint16_t)rxbuf[0]) << 8) | rxbuf[1];
return (((gU16)rxbuf[0]) << 8) | rxbuf[1];
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */

View File

@ -1,106 +1,106 @@
/*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "hal.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
const PALConfig pal_default_config =
{
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
};
#endif
/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
#if HAL_USE_SDC || defined(__DOXYGEN__)
/**
* @brief SDC card detection.
*/
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
/* TODO: Fill the implementation.*/
return TRUE;
}
/**
* @brief SDC card write protection detection.
*/
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
/* TODO: Fill the implementation.*/
return FALSE;
}
#endif /* HAL_USE_SDC */
#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
/**
* @brief MMC_SPI card detection.
*/
bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) {
(void)mmcp;
return !palReadPad(GPIOD, GPIOD_SD_CD);
}
/**
* @brief MMC_SPI card write protection detection.
*/
bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) {
(void)mmcp;
/* Board has no write protection detection */
return FALSE;
}
#endif
/**
* @brief Board-specific initialization code.
* @todo Add your board-specific code, if any.
*/
void boardInit(void) {
}
/*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "hal.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
const PALConfig pal_default_config =
{
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
};
#endif
/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
#if HAL_USE_SDC || defined(__DOXYGEN__)
/**
* @brief SDC card detection.
*/
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
/* TODO: Fill the implementation.*/
return TRUE;
}
/**
* @brief SDC card write protection detection.
*/
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
/* TODO: Fill the implementation.*/
return FALSE;
}
#endif /* HAL_USE_SDC */
#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
/**
* @brief MMC_SPI card detection.
*/
bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) {
(void)mmcp;
return !palReadPad(GPIOD, GPIOD_SD_CD);
}
/**
* @brief MMC_SPI card write protection detection.
*/
bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) {
(void)mmcp;
/* Board has no write protection detection */
return FALSE;
}
#endif
/**
* @brief Board-specific initialization code.
* @todo Add your board-specific code, if any.
*/
void boardInit(void) {
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
# Required include directories
BOARDINC = $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board
# List of all the board related files.
BOARDSRC = $(BOARDINC)/board.c \
# Required include directories
BOARDINC = $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board
# List of all the board related files.
BOARDSRC = $(BOARDINC)/board.c \
$(BOARDINC)/flash_memory.c

View File

@ -19,10 +19,10 @@ static const SPIConfig flash_spicfg = {
};
bool flash_is_write_busy(void) {
static uint8_t is_write_busy_cmd[1];
static gU8 is_write_busy_cmd[1];
is_write_busy_cmd[0] = _SERIAL_FLASH_CMD_RDSR;
uint8_t result[1];
gU8 result[1];
spiAcquireBus(&SPID3);
spiStart(&SPID3, &flash_spicfg);
@ -44,9 +44,9 @@ void flash_write_enable(void) {
spiReleaseBus(&SPID3);
}
void flash_sector_erase(uint32_t sector) {
void flash_sector_erase(gU32 sector) {
flash_write_enable();
static uint8_t sector_erase_cmd[4];
static gU8 sector_erase_cmd[4];
sector_erase_cmd[0] = _SERIAL_FLASH_CMD_SER;
sector_erase_cmd[1] = (sector >> 16) & 0xFF;
sector_erase_cmd[2] = (sector >> 8) & 0xFF;
@ -64,8 +64,8 @@ void flash_sector_erase(uint32_t sector) {
while(flash_is_write_busy());
}
void flash_read(uint32_t address, size_t bytes, uint8_t *out) {
static uint8_t sector_read_cmd[4];
void flash_read(gU32 address, gMemSize bytes, gU8 *out) {
static gU8 sector_read_cmd[4];
sector_read_cmd[0] = _SERIAL_FLASH_CMD_READ;
sector_read_cmd[1] = (address >> 16) & 0xFF;
sector_read_cmd[2] = (address >> 8) & 0xFF;
@ -80,8 +80,8 @@ void flash_read(uint32_t address, size_t bytes, uint8_t *out) {
spiReleaseBus(&SPID3);
}
void flash_write(uint32_t address, size_t bytes, const uint8_t *data) {
static uint8_t flash_write_cmd[4];
void flash_write(gU32 address, gMemSize bytes, const gU8 *data) {
static gU8 flash_write_cmd[4];
flash_write_enable();
@ -103,21 +103,21 @@ void flash_write(uint32_t address, size_t bytes, const uint8_t *data) {
}
bool flash_tp_calibrated(void) {
uint8_t out[1];
gU8 out[1];
flash_read(0x0F0000, 1, out);
return (out[0] == 0x01);
}
void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz) {
void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz) {
if (instance) return;
flash_sector_erase(0x0F0000);
uint8_t calibrated = 0x01;
gU8 calibrated = 0x01;
flash_write(0x0F0000, 1, &calibrated);
flash_write(0x0F0001, sz, calbuf);
}
const char *flash_tp_calibration_load(uint16_t instance) {
static uint8_t foo[24];
const char *flash_tp_calibration_load(gU16 instance) {
static gU8 foo[24];
if (instance) return 0;
if (!flash_tp_calibrated()) return 0;

View File

@ -1,6 +1,6 @@
void flash_sector_erase(uint32_t sector);
void flash_read(uint32_t address, size_t bytes, uint8_t *out);
void flash_write(uint32_t address, size_t bytes, const uint8_t *data);
void flash_sector_erase(gU32 sector);
void flash_read(gU32 address, gMemSize bytes, gU8 *out);
void flash_write(gU32 address, gMemSize bytes, const gU8 *data);
bool flash_tp_calibrated(void);
void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz);
const char *flash_tp_calibration_load(uint16_t instance);
void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz);
const char *flash_tp_calibration_load(gU16 instance);

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_OS_CHIBIOS=GFXON
include $(GFXLIB)/drivers/gdisp/ILI9341/driver.mk
include $(GFXLIB)/drivers/ginput/touch/MCU/driver.mk
include $(GFXLIB)/drivers/gaudio/vs1053/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -39,7 +39,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if(state) {
// reset lcd
@ -49,7 +49,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
}
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
// TODO: can probably pwm this
if(percent) {
@ -76,19 +76,19 @@ static GFXINLINE void release_bus(GDisplay *g) {
*
* @notapi
*/
static GFXINLINE void ili9341_delay(uint16_t dly) {
static uint16_t i;
static GFXINLINE void ili9341_delay(gU16 dly) {
static gU16 i;
for(i = 0; i < dly; i++)
asm("nop");
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
palWriteGroup(GPIOE, 0x00FF, 0, index);
CLR_RS; CLR_WR; ili9341_delay(1); SET_WR; ili9341_delay(1); SET_RS;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
palWriteGroup(GPIOE, 0x00FF, 0, data);
CLR_WR; ili9341_delay(1); SET_WR; ili9341_delay(1);
@ -106,8 +106,8 @@ static GFXINLINE void setwritemode(GDisplay *g) {
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
uint16_t value;
static GFXINLINE gU16 read_data(GDisplay *g) {
gU16 value;
(void) g;
CLR_RD;
value = palReadPort(GPIOE);

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef GAUDIO_PLAY_BOARD_H

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _LLD_GMOUSE_MCU_BOARD_H
@ -27,7 +27,7 @@
#define ADC_BUF_DEPTH 1
static const ADCConversionGroup adcgrpcfg = {
FALSE,
0,
ADC_NUM_CHANNELS,
0,
0,
@ -41,12 +41,12 @@ static const ADCConversionGroup adcgrpcfg = {
ADC_SQR3_SQ2_N(ADC_CHANNEL_IN8) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN9)
};
static bool_t init_board(GMouse *m, unsigned driverinstance) {
static gBool init_board(GMouse *m, unsigned driverinstance) {
(void) m;
// Only one touch interface on this board
if (driverinstance)
return FALSE;
return gFalse;
adcStart(&ADCD1, 0);
@ -54,10 +54,10 @@ static bool_t init_board(GMouse *m, unsigned driverinstance) {
palClearPad(GPIOB, GPIOB_DRIVEA);
palClearPad(GPIOB, GPIOB_DRIVEB);
chThdSleepMilliseconds(1); // Settling time
return TRUE;
return gTrue;
}
static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
static gBool read_xyz(GMouse *m, GMouseReading *prd) {
adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
(void) m;
@ -89,7 +89,7 @@ static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
palClearPad(GPIOB, GPIOB_DRIVEA);
palClearPad(GPIOB, GPIOB_DRIVEB);
}
return TRUE;
return gTrue;
}
#endif /* _LLD_GMOUSE_MCU_BOARD_H */

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/OSX
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_OSX=TRUE
GFXDEFS += -DGFX_USE_OS_OSX=GFXON
GFXLIBS +=
include $(GFXLIB)/drivers/multiple/SDL/driver.mk

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Olimex-SAM7EX256-GE12 $(GFXLIB)/boards/base/Olimex-SAM7EX256-GE8
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_OS_CHIBIOS=GFXON
include $(GFXLIB)/drivers/gdisp/Nokia6610GE12/driver.mk
include $(GFXLIB)/drivers/gadc/AT91SAM7/driver.mk
include $(GFXLIB)/drivers/ginput/dial/GADC/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -17,7 +17,7 @@
* Set various display properties. These properties mostly depend on the exact controller chip you get.
* The defaults should work for most controllers.
*/
//#define GDISP_GE8_BROKEN_CONTROLLER FALSE // Uncomment this out if you have a controller thats not window wrap broken.
//#define GDISP_GE8_BROKEN_CONTROLLER GFXOFF // Uncomment this out if you have a controller thats not window wrap broken.
//#define GDISP_SCREEN_HEIGHT 130 // The visible display height
//#define GDISP_SCREEN_WIDTH 130 // The visible display width
//#define GDISP_RAM_X_OFFSET 0 // The x offset of the visible area
@ -57,7 +57,7 @@ static const PWMConfig pwmcfg = {
},
};
static bool_t pwmRunning = FALSE;
static gBool pwmRunning = gFalse;
/**
* @brief Initialise the board for the display.
@ -123,7 +123,7 @@ static GFXINLINE void init_board(GDisplay *g) {
pSPI->SPI_CSR[0] = 0x01010311; //9bit, CPOL=1, ClockPhase=0, SCLK = 48Mhz/3 = 16MHz
/* Display backlight control at 100% */
pwmRunning = FALSE;
pwmRunning = gFalse;
palSetPad(IOPORT2, PIOB_LCD_BL);
break;
}
@ -133,7 +133,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if (state)
palClearPad(IOPORT1, PIOA_LCD_RESET);
@ -141,27 +141,27 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(IOPORT1, PIOA_LCD_RESET);
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
if (percent == 100) {
/* Turn the pin on - No PWM */
if (pwmRunning) {
pwmStop(&PWMD2);
pwmRunning = FALSE;
pwmRunning = gFalse;
}
palSetPad(IOPORT2, PIOB_LCD_BL);
} else if (percent == 0) {
/* Turn the pin off - No PWM */
if (pwmRunning) {
pwmStop(&PWMD2);
pwmRunning = FALSE;
pwmRunning = gFalse;
}
palClearPad(IOPORT2, PIOB_LCD_BL);
} else {
/* Use the PWM */
if (!pwmRunning) {
pwmStart(&PWMD2, &pwmcfg);
pwmRunning = TRUE;
pwmRunning = gTrue;
}
pwmEnableChannel(&PWMD2, 0, PWM_VALUE(percent));
}
@ -175,7 +175,7 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
// wait for the previous transfer to complete
while(!(pSPI->SPI_SR & AT91C_SPI_TDRE));
@ -183,7 +183,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
pSPI->SPI_TDR = index & 0xFF;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
// wait for the previous transfer to complete
while(!(pSPI->SPI_SR & AT91C_SPI_TDRE));

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Olimex-SAM7EX256-GE8
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_OS_CHIBIOS=GFXON
include $(GFXLIB)/drivers/gdisp/Nokia6610GE8/driver.mk
include $(GFXLIB)/drivers/gadc/AT91SAM7/driver.mk
include $(GFXLIB)/drivers/ginput/dial/GADC/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -17,7 +17,7 @@
* Set various display properties. These properties mostly depend on the exact controller chip you get.
* The defaults should work for most controllers.
*/
//#define GDISP_GE8_BROKEN_CONTROLLER FALSE // Uncomment this out if you have a controller thats not window wrap broken.
//#define GDISP_GE8_BROKEN_CONTROLLER GFXOFF // Uncomment this out if you have a controller thats not window wrap broken.
//#define GDISP_SCREEN_HEIGHT 130 // The visible display height
//#define GDISP_SCREEN_WIDTH 130 // The visible display width
//#define GDISP_RAM_X_OFFSET 0 // The x offset of the visible area
@ -56,7 +56,7 @@ static const PWMConfig pwmcfg = {
},
};
static bool_t pwmRunning = FALSE;
static gBool pwmRunning = gFalse;
/**
* @brief Initialise the board for the display.
@ -121,7 +121,7 @@ static GFXINLINE void init_board(GDisplay *g) {
pSPI->SPI_CSR[0] = 0x00000311; //9bit, CPOL=1, ClockPhase=0, SCLK = 48Mhz/3 = 16MHz
/* Display backlight control at 100% */
pwmRunning = FALSE;
pwmRunning = gFalse;
palSetPad(IOPORT2, PIOB_LCD_BL);
break;
}
@ -131,7 +131,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if (state)
palClearPad(IOPORT1, PIOA_LCD_RESET);
@ -139,27 +139,27 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(IOPORT1, PIOA_LCD_RESET);
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
if (percent == 100) {
/* Turn the pin on - No PWM */
if (pwmRunning) {
pwmStop(&PWMD2);
pwmRunning = FALSE;
pwmRunning = gFalse;
}
palSetPad(IOPORT2, PIOB_LCD_BL);
} else if (percent == 0) {
/* Turn the pin off - No PWM */
if (pwmRunning) {
pwmStop(&PWMD2);
pwmRunning = FALSE;
pwmRunning = gFalse;
}
palClearPad(IOPORT2, PIOB_LCD_BL);
} else {
/* Use the PWM */
if (!pwmRunning) {
pwmStart(&PWMD2, &pwmcfg);
pwmRunning = TRUE;
pwmRunning = gTrue;
}
pwmEnableChannel(&PWMD2, 0, PWM_VALUE(percent));
}
@ -173,7 +173,7 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
// wait for the previous transfer to start
while(!(pSPI->SPI_SR & AT91C_SPI_TDRE));
@ -181,7 +181,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
pSPI->SPI_TDR = index & 0xFF;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
// wait for the previous transfer to start
while(!(pSPI->SPI_SR & AT91C_SPI_TDRE));

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -81,7 +81,7 @@
#define I2C_WAITCOMPLETE()
#define I2C_WRITECMDBYTE(cmd) { \
uint8_t data[2]; \
gU8 data[2]; \
data[0] = 0; \
data[1] = cmd; \
i2cMasterTransmitTimeout (UEXT_I2C, I2C_ADDRESS, data, 2, 0, 0, TIME_INFINITE); \
@ -102,12 +102,12 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
@ -125,7 +125,7 @@ static GFXINLINE void release_bus(GDisplay *g) {
I2C_RELEASEBUS();
}
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) {
(void) g;
I2C_WAITCOMPLETE();
@ -134,7 +134,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
I2C_WRITECMDBYTE(cmd);
}
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) {
(void) g;
I2C_WAITCOMPLETE();

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -63,8 +63,8 @@
static void spi_delay(volatile unsigned long a) { while (a!=0) a--; }
static void spi_write(uint8_t data) {
uint8_t bit;
static void spi_write(gU8 data) {
gU8 bit;
for(bit = 0x80; bit; bit >>= 1) {
if(data & bit)
@ -175,7 +175,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
@ -185,7 +185,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
PinSet(PORT_RESET, PIN_RESET);
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
@ -203,7 +203,7 @@ static GFXINLINE void release_bus(GDisplay *g) {
SPI_RELEASEBUS();
}
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) {
(void) g;
// Command mode please
@ -213,7 +213,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
SPI_WRITEBYTE(cmd);
}
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) {
(void) g;
// Data mode please

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -63,8 +63,8 @@
static void spi_delay(volatile unsigned long a) { while (a!=0) a--; }
static void spi_write(uint8_t data) {
uint8_t bit;
static void spi_write(gU8 data) {
gU8 bit;
for(bit = 0x80; bit; bit >>= 1) {
if(data & bit)
@ -172,7 +172,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
@ -182,7 +182,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
PinSet(PORT_RESET, PIN_RESET);
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
@ -200,7 +200,7 @@ static GFXINLINE void release_bus(GDisplay *g) {
SPI_RELEASEBUS();
}
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) {
(void) g;
// Command mode please
@ -210,7 +210,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
SPI_WRITEBYTE(cmd);
}
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, gU8 data) {
(void) g;
// Data mode please

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
@ -49,8 +49,8 @@
static void spi_delay(volatile unsigned long a) { while (a!=0) a--; }
static void spi_write(uint8_t data) {
uint8_t bit;
static void spi_write(gU8 data) {
gU8 bit;
for(bit = 0x80; bit; bit >>= 1) {
if(data & bit)
@ -161,7 +161,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
(void) state;
@ -171,7 +171,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
PinSet(PORT_RESET, PIN_RESET);
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
@ -189,7 +189,7 @@ static GFXINLINE void release_bus(GDisplay *g) {
SPI_RELEASEBUS();
}
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) {
(void) g;
// Command mode please
@ -199,7 +199,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
SPI_WRITEBYTE(cmd);
}
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) {
(void) g;
// Data mode please

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef GAUDIO_PLAY_BOARD_H
@ -33,17 +33,17 @@ static GPTConfig gptcfg = {
GPT_TRIGGER_NONE, // trigger
};
static uint16_t lastvalue;
static gU16 lastvalue;
static bool gaudio_play_pwm_setup(uint32_t frequency, ArrayDataFormat format) {
static gBool gaudio_play_pwm_setup(gU32 frequency, ArrayDataFormat format) {
if (format == ARRAY_DATA_10BITUNSIGNED)
pwmcfg.period = 1024;
else if (format == ARRAY_DATA_8BITUNSIGNED)
pwmcfg.period = 256;
else
return FALSE;
return gFalse;
gptcfg.frequency = frequency;
return TRUE;
return gTrue;
}
static void gaudio_play_pwm_start(void) {
@ -65,7 +65,7 @@ static void gaudio_play_pwm_stop(void) {
pwmStop(&PWMD1);
}
static void gaudio_play_pwm_setI(uint16_t value) {
static void gaudio_play_pwm_setI(gU16 value) {
if (value != lastvalue) {
lastvalue = value;
pwmEnableChannelI(&PWMD1, 0, value);

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -22,7 +22,7 @@
/**
* @brief Whether each channel is mono or stereo
*/
#define GAUDIO_RECORD_CHANNEL0_IS_STEREO FALSE
#define GAUDIO_RECORD_CHANNEL0_IS_STEREO GFXOFF
/**
* The list of audio channels and their uses
@ -30,7 +30,7 @@
#define GAUDIO_RECORD_MICROPHONE 0
#ifdef GAUDIO_RECORD_IMPLEMENTATION
static uint32_t gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = {
static gU32 gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = {
GADC_PHYSDEV_MICROPHONE,
};
#endif

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**
@ -22,7 +22,7 @@
#define GINPUT_DIAL_NUM_PORTS 1
#define GINPUT_DIAL_DEVICE0 GADC_PHYSDEV_DIAL
#define GINPUT_DIAL_POLL_PERIOD 200
#define GINPUT_DIAL_CYCLE_POLL FALSE
#define GINPUT_DIAL_CYCLE_POLL GFXOFF
#endif /* GFX_USE_GINPUT && GINPUT_NEED_DIAL */

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
/**

View File

@ -1,6 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Olimex-STM32-LCD
GFXSRC +=
GFXDEFS += -DGFX_USE_CHIBIOS=TRUE
GFXDEFS += -DGFX_USE_CHIBIOS=GFXON
include $(GFXLIB)/boards/base/Olimex-STM32-LCD/chibios_board/board.mk
include $(GFXLIB)/drivers/gdisp/ILI9320/driver.mk

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef GDISP_LLD_BOARD_H
@ -10,8 +10,8 @@
// For a multiple display configuration we would put all this in a structure and then
// set g->board to that structure.
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */
#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile gU16 *) 0x60100000)) /* RS = 1 */
static GFXINLINE void init_board(GDisplay *g) {
@ -45,7 +45,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
(void) g;
if(state)
@ -54,7 +54,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(GPIOE, GPIOE_TFT_RST);
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) {
(void) g;
if(percent)
@ -71,13 +71,13 @@ static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, gU16 index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, gU16 data) {
(void) g;
GDISP_RAM = data;
@ -91,7 +91,7 @@ static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
static GFXINLINE gU16 read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;

View File

@ -1,88 +1,88 @@
/*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "ch.h"
#include "hal.h"
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
#if HAL_USE_PAL || defined(__DOXYGEN__)
const PALConfig pal_default_config =
{
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
{VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
{VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
{VAL_GPIOFODR, VAL_GPIOFCRL, VAL_GPIOFCRH},
{VAL_GPIOGODR, VAL_GPIOGCRL, VAL_GPIOGCRH},
};
#endif
/*
* Early initialization code.
* This initialization must be performed just after stack setup and before
* any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
#if HAL_USE_SDC || defined(__DOXYGEN__)
/**
* @brief SDC card detection.
*/
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
return TRUE;
}
/**
* @brief SDC card write protection detection.
*/
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
return FALSE;
}
#endif /* HAL_USE_SDC */
#if HAL_USE_MMC_SPI
/* Board-related functions related to the MMC_SPI driver.*/
bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) {
(void)mmcp;
return TRUE;
}
bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) {
(void)mmcp;
return FALSE;
}
#endif
/*
* Board-specific initialization code.
*/
void boardInit(void) {
}
/*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "ch.h"
#include "hal.h"
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
#if HAL_USE_PAL || defined(__DOXYGEN__)
const PALConfig pal_default_config =
{
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
{VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
{VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
{VAL_GPIOFODR, VAL_GPIOFCRL, VAL_GPIOFCRH},
{VAL_GPIOGODR, VAL_GPIOGCRL, VAL_GPIOGCRH},
};
#endif
/*
* Early initialization code.
* This initialization must be performed just after stack setup and before
* any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
#if HAL_USE_SDC || defined(__DOXYGEN__)
/**
* @brief SDC card detection.
*/
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
return TRUE;
}
/**
* @brief SDC card write protection detection.
*/
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
return FALSE;
}
#endif /* HAL_USE_SDC */
#if HAL_USE_MMC_SPI
/* Board-related functions related to the MMC_SPI driver.*/
bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) {
(void)mmcp;
return TRUE;
}
bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) {
(void)mmcp;
return FALSE;
}
#endif
/*
* Board-specific initialization code.
*/
void boardInit(void) {
}

View File

@ -1,196 +1,196 @@
/*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef _BOARD_H_
#define _BOARD_H_
/*
* Setup for the Olimex STM32-LCD proto board.
*/
/*
* Board identifier.
*/
#define BOARD_OLIMEX_STM32_LCD
#define BOARD_NAME "Olimex STM32-LCD"
/*
* Board frequencies.
*/
#define STM32_LSECLK 32768
#define STM32_HSECLK 8000000
/*
* MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
*/
#define STM32F10X_HD
/*
* IO pins assignments.
*/
#define GPIOA_SPI1NSS 4
#define GPIOB_SPI2NSS 12
#define GPIOA_USB_P 0
#define GPIOD_USB_DISC 2
#define GPIOE_TFT_RST 2
#define GPIOD_TFT_LIGHT 13
#define GPIOC_TFT_YD 0
#define GPIOC_TFT_YU 1
#define GPIOC_TFT_XL 2
#define GPIOC_TFT_XR 3
/*
* I/O ports initial setup, this configuration is established soon after reset
* in the initialization code.
*
* The digits have the following meaning:
* 0 - Analog input.
* 1 - Push Pull output 10MHz.
* 2 - Push Pull output 2MHz.
* 3 - Push Pull output 50MHz.
* 4 - Digital input.
* 5 - Open Drain output 10MHz.
* 6 - Open Drain output 2MHz.
* 7 - Open Drain output 50MHz.
* 8 - Digital input with PullUp or PullDown resistor depending on ODR.
* 9 - Alternate Push Pull output 10MHz.
* A - Alternate Push Pull output 2MHz.
* B - Alternate Push Pull output 50MHz.
* C - Reserved.
* D - Alternate Open Drain output 10MHz.
* E - Alternate Open Drain output 2MHz.
* F - Alternate Open Drain output 50MHz.
* Please refer to the STM32 Reference Manual for details.
*/
/*
* Port A setup.
* Everything input with pull-up except:
* PA0 - Normal input (USB P).
* PA2 - Alternate output (USART2 TX).
* PA3 - Normal input (USART2 RX).
* PA11 - Normal input (USB DM).
* PA12 - Normal input (USB DP).
*/
#define VAL_GPIOACRL 0x88884B84 /* PA7...PA0 */
#define VAL_GPIOACRH 0x88844888 /* PA15...PA8 */
#define VAL_GPIOAODR 0xFFFFFFFF
/*
* Port B setup.
* Everything input with pull-up except:
*/
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
#define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */
#define VAL_GPIOBODR 0xFFFFFFFF
/*
* Port C setup.
* Everything input with pull-up except:
* PC0 - Analog Input (TP_YD).
* PC1 - Analog Input (TP_YU).
* PC2 - Analog Input (TP_XL).
* PC3 - Analog Input (TP_XR).
* PC8 - Alternate PP 50M (SD_D0).
* PC9 - Alternate PP 50M (SD_D1).
* PC10 - Alternate PP 50M (SD_D2).
* PC11 - Alternate PP 50M (SD_D3).
* PC12 - Alternate PP 50M (SD_CLK).
* PC14 - Normal input (XTAL).
* PC15 - Normal input (XTAL).
*/
#define VAL_GPIOCCRL 0x88880000 /* PC7...PC0 */
#define VAL_GPIOCCRH 0x448BBBBB /* PC15...PC8 */
#define VAL_GPIOCODR 0xFFFFFFFF
/*
* Port D setup.
* Everything input with pull-up except:
* PD2 - Alternate PP 50M (SD_CMD)
* PD0 - Alternate PP 50M (FSMC_D2)
* PD1 - Alternate PP 50M (FSMC_D3)
* PD4 - Alternate PP 50M (TFT_RD)
* PD5 - Alternate PP 50M (TFT_WR)
* PD7 - Alternate PP 50M (TFT_CS)
* PD8 - Alternate PP 50M (FSMC_D13)
* PD9 - Alternate PP 50M (FSMC_D14)
* PD10 - Alternate PP 50M (FSMC_D15)
* PD14 - Alternate PP 50M (FSMC_D0)
* PD15 - Alternate PP 50M (FSMC_D1)
*/
#define VAL_GPIODCRL 0xBBBB8BBB /* PD7...PD0 */
#define VAL_GPIODCRH 0xBB388BBB /* PD15...PD8 */
#define VAL_GPIODODR 0xFFFFFFFF
/*
* Port E setup.
* Everything input with pull-up except:
* PE2 - Digital Output (TFT_RST)
* PE3 - Alternate PP 50M (TFT_RS)
* PE7 - Alternate PP 50M (FSMC_D4)
* PE8 - Alternate PP 50M (FSMC_D5)
* PE9 - Alternate PP 50M (FSMC_D6)
* PE10 - Alternate PP 50M (FSMC_D7)
* PE11 - Alternate PP 50M (FSMC_D8)
* PE12 - Alternate PP 50M (FSMC_D9)
* PE13 - Alternate PP 50M (FSMC_D10)
* PE14 - Alternate PP 50M (FSMC_D11)
* PE15 - Alternate PP 50M (FSMC_D12)
*/
#define VAL_GPIOECRL 0xB888B388 /* PE7...PE0 */
#define VAL_GPIOECRH 0xBBBBBBBB /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF
/*
* Port F setup.
* Everything input with pull-up expect:
*/
#define VAL_GPIOFCRL 0x88888888 /* PF7...PF0 */
#define VAL_GPIOFCRH 0x88888888 /* PF15...PF8 */
#define VAL_GPIOFODR 0xFFFFFFFF
/*
* Port G setup.
* Everything input with pull-up expect:
*/
#define VAL_GPIOGCRL 0x88888888 /* PG7...PG0 */
#define VAL_GPIOGCRH 0x88888888 /* PG15...PG8 */
#define VAL_GPIOGODR 0xFFFFFFFF
/*
* USB bus activation macro, required by the USB driver.
*/
#define usb_lld_connect_bus(usbp) palClearPad(GPIOD, GPIOD_USB_DISC)
/*
* USB bus de-activation macro, required by the USB driver.
*/
#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOD, GPIOD_USB_DISC)
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */
#endif /* _BOARD_H_ */
/*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef _BOARD_H_
#define _BOARD_H_
/*
* Setup for the Olimex STM32-LCD proto board.
*/
/*
* Board identifier.
*/
#define BOARD_OLIMEX_STM32_LCD
#define BOARD_NAME "Olimex STM32-LCD"
/*
* Board frequencies.
*/
#define STM32_LSECLK 32768
#define STM32_HSECLK 8000000
/*
* MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
*/
#define STM32F10X_HD
/*
* IO pins assignments.
*/
#define GPIOA_SPI1NSS 4
#define GPIOB_SPI2NSS 12
#define GPIOA_USB_P 0
#define GPIOD_USB_DISC 2
#define GPIOE_TFT_RST 2
#define GPIOD_TFT_LIGHT 13
#define GPIOC_TFT_YD 0
#define GPIOC_TFT_YU 1
#define GPIOC_TFT_XL 2
#define GPIOC_TFT_XR 3
/*
* I/O ports initial setup, this configuration is established soon after reset
* in the initialization code.
*
* The digits have the following meaning:
* 0 - Analog input.
* 1 - Push Pull output 10MHz.
* 2 - Push Pull output 2MHz.
* 3 - Push Pull output 50MHz.
* 4 - Digital input.
* 5 - Open Drain output 10MHz.
* 6 - Open Drain output 2MHz.
* 7 - Open Drain output 50MHz.
* 8 - Digital input with PullUp or PullDown resistor depending on ODR.
* 9 - Alternate Push Pull output 10MHz.
* A - Alternate Push Pull output 2MHz.
* B - Alternate Push Pull output 50MHz.
* C - Reserved.
* D - Alternate Open Drain output 10MHz.
* E - Alternate Open Drain output 2MHz.
* F - Alternate Open Drain output 50MHz.
* Please refer to the STM32 Reference Manual for details.
*/
/*
* Port A setup.
* Everything input with pull-up except:
* PA0 - Normal input (USB P).
* PA2 - Alternate output (USART2 TX).
* PA3 - Normal input (USART2 RX).
* PA11 - Normal input (USB DM).
* PA12 - Normal input (USB DP).
*/
#define VAL_GPIOACRL 0x88884B84 /* PA7...PA0 */
#define VAL_GPIOACRH 0x88844888 /* PA15...PA8 */
#define VAL_GPIOAODR 0xFFFFFFFF
/*
* Port B setup.
* Everything input with pull-up except:
*/
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
#define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */
#define VAL_GPIOBODR 0xFFFFFFFF
/*
* Port C setup.
* Everything input with pull-up except:
* PC0 - Analog Input (TP_YD).
* PC1 - Analog Input (TP_YU).
* PC2 - Analog Input (TP_XL).
* PC3 - Analog Input (TP_XR).
* PC8 - Alternate PP 50M (SD_D0).
* PC9 - Alternate PP 50M (SD_D1).
* PC10 - Alternate PP 50M (SD_D2).
* PC11 - Alternate PP 50M (SD_D3).
* PC12 - Alternate PP 50M (SD_CLK).
* PC14 - Normal input (XTAL).
* PC15 - Normal input (XTAL).
*/
#define VAL_GPIOCCRL 0x88880000 /* PC7...PC0 */
#define VAL_GPIOCCRH 0x448BBBBB /* PC15...PC8 */
#define VAL_GPIOCODR 0xFFFFFFFF
/*
* Port D setup.
* Everything input with pull-up except:
* PD2 - Alternate PP 50M (SD_CMD)
* PD0 - Alternate PP 50M (FSMC_D2)
* PD1 - Alternate PP 50M (FSMC_D3)
* PD4 - Alternate PP 50M (TFT_RD)
* PD5 - Alternate PP 50M (TFT_WR)
* PD7 - Alternate PP 50M (TFT_CS)
* PD8 - Alternate PP 50M (FSMC_D13)
* PD9 - Alternate PP 50M (FSMC_D14)
* PD10 - Alternate PP 50M (FSMC_D15)
* PD14 - Alternate PP 50M (FSMC_D0)
* PD15 - Alternate PP 50M (FSMC_D1)
*/
#define VAL_GPIODCRL 0xBBBB8BBB /* PD7...PD0 */
#define VAL_GPIODCRH 0xBB388BBB /* PD15...PD8 */
#define VAL_GPIODODR 0xFFFFFFFF
/*
* Port E setup.
* Everything input with pull-up except:
* PE2 - Digital Output (TFT_RST)
* PE3 - Alternate PP 50M (TFT_RS)
* PE7 - Alternate PP 50M (FSMC_D4)
* PE8 - Alternate PP 50M (FSMC_D5)
* PE9 - Alternate PP 50M (FSMC_D6)
* PE10 - Alternate PP 50M (FSMC_D7)
* PE11 - Alternate PP 50M (FSMC_D8)
* PE12 - Alternate PP 50M (FSMC_D9)
* PE13 - Alternate PP 50M (FSMC_D10)
* PE14 - Alternate PP 50M (FSMC_D11)
* PE15 - Alternate PP 50M (FSMC_D12)
*/
#define VAL_GPIOECRL 0xB888B388 /* PE7...PE0 */
#define VAL_GPIOECRH 0xBBBBBBBB /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF
/*
* Port F setup.
* Everything input with pull-up expect:
*/
#define VAL_GPIOFCRL 0x88888888 /* PF7...PF0 */
#define VAL_GPIOFCRH 0x88888888 /* PF15...PF8 */
#define VAL_GPIOFODR 0xFFFFFFFF
/*
* Port G setup.
* Everything input with pull-up expect:
*/
#define VAL_GPIOGCRL 0x88888888 /* PG7...PG0 */
#define VAL_GPIOGCRH 0x88888888 /* PG15...PG8 */
#define VAL_GPIOGODR 0xFFFFFFFF
/*
* USB bus activation macro, required by the USB driver.
*/
#define usb_lld_connect_bus(usbp) palClearPad(GPIOD, GPIOD_USB_DISC)
/*
* USB bus de-activation macro, required by the USB driver.
*/
#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOD, GPIOD_USB_DISC)
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */
#endif /* _BOARD_H_ */

View File

@ -1,3 +1,3 @@
BOARDINC = $(GFXLIB)/boards/base/Olimex-STM32-LCD/chibios_board
BOARDSRC = $(BOARDINC)/board.c \
BOARDINC = $(GFXLIB)/boards/base/Olimex-STM32-LCD/chibios_board
BOARDSRC = $(BOARDINC)/board.c \

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
#ifndef _LLD_GMOUSE_MCU_BOARD_H
@ -27,7 +27,7 @@
#define ADC_BUF_DEPTH 1
static const ADCConversionGroup adc_y_config = {
FALSE,
0,
ADC_NUM_CHANNELS,
0,
0,
@ -39,7 +39,7 @@ static const ADCConversionGroup adc_y_config = {
};
static const ADCConversionGroup adc_x_config = {
FALSE,
0,
ADC_NUM_CHANNELS,
0,
0,
@ -58,24 +58,24 @@ static GFXINLINE void setup_z(void) {
palSetPad(GPIOC, 3);
}
static bool_t init_board(GMouse *m, unsigned driverinstance) {
static gBool init_board(GMouse *m, unsigned driverinstance) {
(void) m;
// Only one touch interface on this board
if (driverinstance)
return FALSE;
return gFalse;
adcStart(&ADCD1, 0);
// Set up for reading Z
setup_z();
chThdSleepMilliseconds(1); // Settling time
return TRUE;
return gTrue;
}
static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
static gBool read_xyz(GMouse *m, GMouseReading *prd) {
adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
uint16_t val1, val2;
gU16 val1, val2;
(void) m;
// No buttons and assume touch off
@ -130,7 +130,7 @@ static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
// Set up for reading z again. We know it will be 20ms before we get called again so don't worry about settling time
setup_z();
}
return TRUE;
return gTrue;
}
#endif /* _LLD_GMOUSE_MCU_BOARD_H */

View File

@ -6,16 +6,16 @@
#include <stdint.h>
// write to MMIO register
static GFXINLINE void mmio_write(uint32_t reg, uint32_t data) {
uint32_t *ptr = (uint32_t*)reg;
static GFXINLINE void mmio_write(gU32 reg, gU32 data) {
gU32 *ptr = (gU32*)reg;
asm volatile("str %[data], [%[reg]]"
: : [reg]"r"(ptr), [data]"r"(data));
}
// read from MMIO register
static GFXINLINE uint32_t mmio_read(uint32_t reg) {
uint32_t *ptr = (uint32_t*)reg;
uint32_t data;
static GFXINLINE gU32 mmio_read(gU32 reg) {
gU32 *ptr = (gU32*)reg;
gU32 data;
asm volatile("ldr %[data], [%[reg]]"
: [data]"=r"(data) : [reg]"r"(ptr));
return data;

View File

@ -46,12 +46,12 @@ enum {
/*
* delay function
* int32_t delay: number of cycles to delay
* gI32 delay: number of cycles to delay
*
* This just loops <delay> times in a way that the compiler
* wont optimize away.
*/
static void delay(int32_t count) {
static void delay(gI32 count) {
asm volatile("__delay_%=: subs %[count], %[count], #1; bne __delay_%=\n"
: : [count]"r"(count) : "cc");
}
@ -102,9 +102,9 @@ void uart_init() {
/*
* Transmit a byte via UART0.
* uint8_t Byte: byte to send.
* gU8 Byte: byte to send.
*/
void uart_putc(uint8_t byte) {
void uart_putc(gU8 byte) {
// wait for UART to become ready to transmit
while (1) {
if (!(mmio_read(UART0_FR) & (1 << 5))) {

View File

@ -12,9 +12,9 @@ void uart_init();
/*
* Transmit a byte via UART0.
* uint8_t Byte: byte to send.
* gU8 Byte: byte to send.
*/
void uart_putc(uint8_t byte);
void uart_putc(gU8 byte);
/*
* print a string to the UART one character at a time

View File

@ -2,7 +2,7 @@
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
* http://ugfx.io/license.html
*/
@ -26,16 +26,16 @@
#include "rpi_mailbox.h"
typedef struct FrameBufferDescription {
uint32_t width;
uint32_t height;
uint32_t vWidth;
uint32_t vHeight;
uint32_t pitch;
uint32_t bitDepth;
uint32_t x;
uint32_t y;
gU32 width;
gU32 height;
gU32 vWidth;
gU32 vHeight;
gU32 pitch;
gU32 bitDepth;
gU32 x;
gU32 y;
void * pointer;
uint32_t size;
gU32 size;
} FrameBufferDescription;
static FrameBufferDescription FrameBufferInfo __attribute__((aligned (16))) = { 1024, 768, 1024, 768, 0, 24, 0, 0, 0, 0 };
@ -49,7 +49,7 @@
FrameBufferInfo.vHeight = GDISP_SCREEN_HEIGHT;
FrameBufferInfo.bitDepth = LLDCOLOR_BITS;
rpi_writemailbox(1, 0x40000000 + (uint32_t) &FrameBufferInfo);
rpi_writemailbox(1, 0x40000000 + (gU32) &FrameBufferInfo);
if (rpi_readmailbox(1) != 0)
gfxHalt("Could not set display parameters")
@ -70,17 +70,17 @@
#endif
#if GDISP_NEED_CONTROL
static void board_backlight(GDisplay *g, uint8_t percent) {
static void board_backlight(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
static void board_contrast(GDisplay *g, uint8_t percent) {
static void board_contrast(GDisplay *g, gU8 percent) {
(void) g;
(void) percent;
}
static void board_power(GDisplay *g, powermode_t pwr) {
static void board_power(GDisplay *g, gPowermode pwr) {
(void) g;
(void) pwr;
}

View File

@ -1,7 +1,7 @@
GFXINC += $(GFXLIB)/boards/base/STM32F429i-Discovery/chibios
GFXSRC += $(GFXLIB)/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.c \
$(GFXLIB)/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.c
GFXDEFS += -DGFX_USE_OS_CHIBIOS=TRUE
include $(GFXLIB)/drivers/gdisp/STM32LTDC/driver.mk
include $(GFXLIB)/drivers/ginput/touch/STMPE811/driver.mk
GFXINC += $(GFXLIB)/boards/base/STM32F429i-Discovery/chibios
GFXSRC += $(GFXLIB)/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.c \
$(GFXLIB)/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.c
GFXDEFS += -DGFX_USE_OS_CHIBIOS=GFXON
include $(GFXLIB)/drivers/gdisp/STM32LTDC/driver.mk
include $(GFXLIB)/drivers/ginput/touch/STMPE811/driver.mk

Some files were not shown because too many files have changed in this diff Show More