Compare commits
162 Commits
Author | SHA1 | Date |
---|---|---|
Joel Bodenmann | 41eef9dede | |
Joel Bodenmann | b40425a0ae | |
inmarket | f1a34c9852 | |
inmarket | 025cef93cc | |
Joel Bodenmann | e028d196f5 | |
Joel Bodenmann | fa0c779b0c | |
Joel Bodenmann | 3d543b62bc | |
Joel Bodenmann | d1279f5ef2 | |
Joel Bodenmann | 6b0ce94b15 | |
Joel Bodenmann | ad90707866 | |
Joel Bodenmann | dee588888b | |
Joel Bodenmann | 9e9fc1e824 | |
Joel Bodenmann | 325a7c8b5f | |
Joel Bodenmann | da1c2233e7 | |
Joel Bodenmann | 168cd27633 | |
Joel Bodenmann | 143a3a8847 | |
Joel Bodenmann | 56a88c440d | |
Joel Bodenmann | cc0b175e7f | |
Joel Bodenmann | ba9b9fb62b | |
Joel Bodenmann | 0f11538656 | |
Joel Bodenmann | d66739a349 | |
Joel Bodenmann | ebf5033144 | |
Joel Bodenmann | 734c5cd421 | |
Joel Bodenmann | 831c23e2ac | |
Joel Bodenmann | 2ae3cf397d | |
inmarket | 33f6fa0eb0 | |
inmarket | 2c1c87ee1b | |
Joel Bodenmann | ae6a3bc18b | |
Joel Bodenmann | 68483139c9 | |
Joel Bodenmann | 64aa71339c | |
Joel Bodenmann | a4f225700f | |
Joel Bodenmann | 71a308a01a | |
Joel Bodenmann | 50be0d6432 | |
Joel Bodenmann | 7e2decd0cd | |
Joel Bodenmann | aa9e187581 | |
Joel Bodenmann | 05b547bbbb | |
Joel Bodenmann | 1d63573408 | |
Joel Bodenmann | 1c29a88ee1 | |
Joel Bodenmann | 4261a1fb0b | |
inmarket | 3d3555ec5a | |
Joel Bodenmann | 2f82247223 | |
Joel Bodenmann | cbf9c22adf | |
Joel Bodenmann | 6d6ce043d0 | |
Joel Bodenmann | 0a55fc94bd | |
Joel Bodenmann | 0dac6b4d0f | |
Joel Bodenmann | 14f26ec934 | |
Joel Bodenmann | 7845f44f20 | |
Joel Bodenmann | 1235a9056c | |
Joel Bodenmann | 3f1f1c6a95 | |
Joel Bodenmann | 8d6b2c4707 | |
Joel Bodenmann | 317db95c46 | |
Joel Bodenmann | ec257874a7 | |
Joel Bodenmann | b17cb215f4 | |
Joel Bodenmann | b3216fa0cc | |
Joel Bodenmann | 888c7e8640 | |
Joel Bodenmann | 853f2cba98 | |
Joel Bodenmann | c713719326 | |
Joel Bodenmann | b98a6c258c | |
Joel Bodenmann | c57bd08379 | |
Joel Bodenmann | 409b8d4490 | |
Joel Bodenmann | 77f10024e0 | |
Joel Bodenmann | 72200af286 | |
Joel Bodenmann | d980418e81 | |
Joel Bodenmann | 08c2358542 | |
Joel Bodenmann | 5e3159064a | |
Joel Bodenmann | 8804f3a381 | |
Joel Bodenmann | 7f78be1183 | |
Joel Bodenmann | 91247717a0 | |
Joel Bodenmann | 2de054b530 | |
Joel Bodenmann | 94fd096fdd | |
Joel Bodenmann | a9cf2bdfe2 | |
Joel Bodenmann | b1b264b6a1 | |
Joel Bodenmann | cf01cb2e7c | |
Joel Bodenmann | 37450998e1 | |
Joel Bodenmann | 6fa3520f2a | |
Joel Bodenmann | beb815e109 | |
Joel Bodenmann | 346375c001 | |
Joel Bodenmann | 85c7b08825 | |
Joel Bodenmann | 9c0678a291 | |
Joel Bodenmann | a587942305 | |
Joel Bodenmann | 47d9826a0a | |
Joel Bodenmann | 13d360b17f | |
Joel Bodenmann | df7027881a | |
Joel Bodenmann | 2d4bbea4a3 | |
inmarket | ff93884f71 | |
inmarket | 0586fd276d | |
inmarket | 127a7cd2a2 | |
inmarket | 701f697df5 | |
Joel Bodenmann | 39bde23dd9 | |
Joel Bodenmann | ac4b7fc8b4 | |
Joel Bodenmann | 785047b0aa | |
Joel Bodenmann | 835f0f197f | |
Joel Bodenmann | 138b49a1a0 | |
inmarket | 509fc7501e | |
inmarket | d528fb218d | |
inmarket | 8a9ed5195b | |
inmarket | 7c5a6c928f | |
inmarket | 8bd70d953b | |
inmarket | 6a69c5673f | |
inmarket | 0f3310dd34 | |
inmarket | 4c4cf51682 | |
Joel Bodenmann | b2b8b857ee | |
Tibo Clausen | 0840c8e784 | |
Joel Bodenmann | e414e77d23 | |
Tibo Clausen | 82287d168f | |
Joel Bodenmann | 3486e47579 | |
Joel Bodenmann | 7047dfa633 | |
Tibo Clausen | 00c99374b1 | |
Joel Bodenmann | fe8c80f434 | |
Tibo Clausen | e56ed290e3 | |
Joel Bodenmann | df0200c0f9 | |
Tibo Clausen | 601d8f893d | |
inmarket | 330f891081 | |
inmarket | 1fc4180d41 | |
inmarket | 93da5a0578 | |
inmarket | 215f31ee3d | |
inmarket | e23ae94e91 | |
inmarket | e61f0ae424 | |
inmarket | d9258efd4d | |
inmarket | cbf1d4dfa0 | |
inmarket | a24fab0d72 | |
inmarket | 2e8eaa3471 | |
inmarket | 788cbced62 | |
inmarket | bda8c738b1 | |
inmarket | f9c848e985 | |
inmarket | cfb1b2a488 | |
inmarket | 2ab2d77fcb | |
inmarket | 7e95acb731 | |
inmarket | e8b789bfb1 | |
inmarket | 63d6955992 | |
inmarket | 853863254f | |
inmarket | e2fb6820d0 | |
inmarket | 41271d632b | |
inmarket | 3b97fb798e | |
inmarket | b9b7d27c57 | |
kapacuk | b94fb2caad | |
Joel Bodenmann | ee4654b077 | |
kapacuk | 0f74d94288 | |
inmarket | ef9d93f0ef | |
inmarket | a70cc09ff9 | |
Joel Bodenmann | a411aea69f | |
inmarket | 0771c14817 | |
inmarket | 94f1cc2f0a | |
Thomas Sterren | bee02d5bb5 | |
Thomas Sterren | 509b4113ad | |
Thomas Sterren | 50cc1ad596 | |
Thomas Sterren | bbc4b8e551 | |
Thomas Sterren | 3cb7afbdec | |
Thomas Sterren | 65d00b16b9 | |
inmarket | f265924396 | |
Joel Bodenmann | 14786e97b6 | |
inmarket | d9eaba249f | |
inmarket | aeef03a83e | |
inmarket | 891b78a62c | |
Thomas Sterren | 992850bcb1 | |
Thomas Sterren | 9e51a3e586 | |
Thomas Sterren | 861e6b9869 | |
Steffen Schroeter | c119ca4a5d | |
Steffen Schroeter | e0f22d9cb8 | |
inmarket | 013bac84ce | |
inmarket | c41cbd05e9 | |
inmarket | 87ec4b7c77 |
|
@ -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-*/
|
||||
|
|
|
@ -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.
|
||||
|
|
4934
Doxygenfile
4934
Doxygenfile
File diff suppressed because it is too large
Load Diff
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
|
@ -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 */
|
|
@ -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>
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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, ®, 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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 \
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
GFXINC +=
|
||||
GFXSRC +=
|
||||
GFXDEFS += -DGFX_USE_OS_FREEBSD=GFXON
|
||||
GFXLIBS += rt
|
||||
|
||||
include $(GFXLIB)/drivers/multiple/SDL/driver.mk
|
|
@ -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 ***
|
||||
|
|
@ -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.
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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 | \
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
@ -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 \
|
||||
|
||||
|
|
|
@ -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, ®, 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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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, ®, 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 */
|
||||
|
|
|
@ -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
|
@ -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
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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 \
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
Loading…
Reference in New Issue