Merge branch 'master' into Keil

This commit is contained in:
inmarket 2015-10-23 18:28:42 +10:00
commit 00aeab86eb
103 changed files with 732 additions and 721 deletions

View File

@ -45,7 +45,7 @@
#define GPIOC_VPOS_CTRL 14
#define GPIOC_VNEG_CTRL 15
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -76,68 +76,68 @@ static void eink_delay(int us) {
}
/* Turn the E-ink panel Vdd supply (+3.3V) on or off. */
static inline void setpower_vdd(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vdd(GDisplay *g, bool_t 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 inline void setpower_vneg(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vneg(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOA, GPIOA_VNEG_CTRL, on);
}
/* Turn the E-ink panel positive supplies (-15V, -20V) on or off. */
static inline void setpower_vpos(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vpos(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOA, GPIOA_VPOS_CTRL, on);
}
/* Set the state of the LE (source driver Latch Enable) pin. */
static inline void setpin_le(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_le(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_LE, on);
}
/* Set the state of the OE (source driver Output Enable) pin. */
static inline void setpin_oe(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_oe(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_OE, on);
}
/* Set the state of the CL (source driver Clock) pin. */
static inline void setpin_cl(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_cl(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_CL, on);
}
/* Set the state of the SPH (source driver Start Pulse Horizontal) pin. */
static inline void setpin_sph(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_sph(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_SPH, on);
}
/* Set the state of the D0-D7 (source driver Data) pins. */
static inline void setpins_data(GDisplay *g, uint8_t value) {
static GFXINLINE void setpins_data(GDisplay *g, uint8_t value) {
(void) g;
palWriteGroup(GPIOB, 0xFF, GPIOB_EINK_D0, value);
}
/* Set the state of the CKV (gate driver Clock Vertical) pin. */
static inline void setpin_ckv(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_ckv(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_CKV, on);
}
/* Set the state of the GMODE (gate driver Gate Mode) pin. */
static inline void setpin_gmode(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_gmode(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOC, GPIOC_EINK_GMODE, on);
}
/* Set the state of the SPV (gate driver Start Pulse Vertical) pin. */
static inline void setpin_spv(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_spv(GDisplay *g, bool_t on) {
(void) g;
palWritePad(GPIOB, GPIOB_EINK_SPV, on);
}

View File

@ -67,7 +67,7 @@ static const SPIConfig spi1cfg_16bit = {
SPI_CR1_DFF //SPI_CR1_BR_0
};
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -99,11 +99,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if (state) {
CLR_RST;
@ -112,35 +112,35 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
}
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
pwmEnableChannel(&PWMD4, 1, percent);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
spiAcquireBus(&SPID1);
while(((SPI1->SR & SPI_SR_TXE) == 0) || ((SPI1->SR & SPI_SR_BSY) != 0)); // Safety
CLR_CS;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
SET_CS;
spiReleaseBus(&SPID1);
}
static inline void busmode16(GDisplay *g) {
static GFXINLINE void busmode16(GDisplay *g) {
(void) g;
spiStart(&SPID1, &spi1cfg_16bit);
}
static inline void busmode8(GDisplay *g) {
static GFXINLINE void busmode8(GDisplay *g) {
(void) g;
spiStart(&SPID1, &spi1cfg_8bit);
}
static inline void write_index(GDisplay *g, uint8_t index) {
static GFXINLINE void write_index(GDisplay *g, uint8_t index) {
(void) g;
CLR_DATA;
SPI1->DR = index;
@ -148,13 +148,13 @@ static inline void write_index(GDisplay *g, uint8_t index) {
SET_DATA;
}
static inline void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
(void) g;
SPI1->DR = data;
while(((SPI1->SR & SPI_SR_TXE) == 0) || ((SPI1->SR & SPI_SR_BSY) != 0));
}
static inline void write_ram16(GDisplay *g, uint16_t data) {
static GFXINLINE void write_ram16(GDisplay *g, uint16_t data) {
(void) g;
SPI1->DR = data;
while((SPI1->SR & SPI_SR_TXE) == 0);

View File

@ -64,7 +64,7 @@ static void init_board(GDisplay *g) {
#define PmpWaitBusy() do {} while (PMMODEbits.BUSY)
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
@ -84,11 +84,11 @@ static void set_backlight(GDisplay *g, uint8_t percent) {
palSetPad(IOPORTD, 3);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
@ -112,11 +112,11 @@ static noinline void write_data(GDisplay *g, uint16_t data) {
PmpWaitBusy();
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}

View File

@ -34,7 +34,7 @@
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -64,11 +64,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if(state)
palClearPad(GPIOE, GPIOE_TFT_RST);
@ -76,38 +76,38 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(GPIOE, GPIOE_TFT_RST);
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void)percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}

View File

@ -55,7 +55,7 @@ static void send_data(uint16_t data);
*
* @notapi
*/
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -75,7 +75,7 @@ static inline void init_board(GDisplay *g) {
*
* @notapi
*/
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
@ -87,7 +87,7 @@ static inline void post_init_board(GDisplay *g) {
*
* @notapi
*/
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if (state == TRUE) {
@ -105,7 +105,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
*
* @notapi
*/
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
@ -117,7 +117,7 @@ static inline void set_backlight(GDisplay *g, uint8_t percent) {
*
* @notapi
*/
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
@ -128,7 +128,7 @@ static inline void acquire_bus(GDisplay *g) {
*
* @notapi
*/
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
@ -139,7 +139,7 @@ static inline void release_bus(GDisplay *g) {
*
* @notapi
*/
static inline void send_data(uint16_t data) {
static GFXINLINE void send_data(uint16_t 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 inline void send_data(uint16_t data) {
*
* @notapi
*/
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
while (SPI2->SR & SPI_SR_BSY);
@ -177,7 +177,7 @@ static inline void write_index(GDisplay *g, uint16_t index) {
*
* @notapi
*/
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
send_data(data);
@ -190,7 +190,7 @@ static inline void write_data(GDisplay *g, uint16_t data) {
*
* @notapi
*/
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
@ -201,7 +201,7 @@ static inline void setreadmode(GDisplay *g) {
*
* @notapi
*/
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
@ -213,7 +213,7 @@ static inline void setwritemode(GDisplay *g) {
*
* @notapi
*/
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -27,7 +27,7 @@
#define SET_RD palSetPad(GPIOD, 15);
#define CLR_RD palClearPad(GPIOD, 15);
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -49,53 +49,53 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
palWritePort(GPIOE, index);
CLR_RS; CLR_WR; SET_WR; SET_RS;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
palWritePort(GPIOE, data);
CLR_WR; SET_WR;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
// change pin mode to digital input
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_INPUT);
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
// change pin mode back to digital output
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
uint16_t value;
(void) g;

View File

@ -21,7 +21,7 @@
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -50,43 +50,43 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}

View File

@ -53,12 +53,12 @@ static const SPIConfig hs_spicfg = {
#endif
#if USE_SOFT_SPI
static inline void soft_spi_sck(void){
static GFXINLINE void soft_spi_sck(void){
palSetPad(SPFD54124B_SPI_PORT, SPFD54124B_SPI_SCK);
palClearPad(SPFD54124B_SPI_PORT, SPFD54124B_SPI_SCK);
}
static inline void soft_spi_write_9bit(uint16_t data){
static GFXINLINE void soft_spi_write_9bit(uint16_t data){
uint8_t i;
@ -81,7 +81,7 @@ static inline void soft_spi_write_9bit(uint16_t data){
}
#endif
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if(state) {
CLR_RST;
@ -90,7 +90,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
}
}
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -127,7 +127,7 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
#if USE_HARD_SPI
#if GFX_USE_OS_CHIBIOS
@ -138,7 +138,7 @@ static inline void acquire_bus(GDisplay *g) {
#endif
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
#if USE_HARD_SPI
#if GFX_USE_OS_CHIBIOS
@ -148,7 +148,7 @@ static inline void release_bus(GDisplay *g) {
#endif
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
uint16_t b;
@ -176,7 +176,7 @@ static inline void write_data(GDisplay *g, uint16_t data) {
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
#if USE_HARD_SPI
@ -191,11 +191,11 @@ static inline void write_index(GDisplay *g, uint16_t index) {
#endif
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}

View File

@ -38,7 +38,7 @@ static const PWMConfig pwmcfg = {
0
};
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -101,55 +101,55 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
pwmEnableChannel(&PWMD3, 2, percent);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_3 | FSMC_BTR1_DATAST_3 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *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);
@ -160,7 +160,7 @@ static inline uint16_t read_data(GDisplay *g) {
}
}
static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);

View File

@ -49,7 +49,7 @@ static I2CConfig i2cconfig;
static int32_t thdPriority = 0;
#endif
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -78,11 +78,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if(state)
CLR_RST
@ -90,7 +90,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
SET_RST
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
#if GFX_USE_OS_CHIBIOS
thdPriority = (int32_t)chThdGetPriority();
@ -99,7 +99,7 @@ static inline void acquire_bus(GDisplay *g) {
i2cAcquireBus(&I2CD1);
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
#if GFX_USE_OS_CHIBIOS
chThdSetPriority(thdPriority);
@ -107,7 +107,7 @@ static inline void release_bus(GDisplay *g) {
i2cReleaseBus(&I2CD1);
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
uint8_t command[2];
(void) g;
@ -119,7 +119,7 @@ static inline void write_cmd(GDisplay *g, uint8_t cmd) {
i2cStop(&I2CD1);
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
i2cStart(&I2CD1, &i2cconfig);

View File

@ -52,7 +52,7 @@ static const SPIConfig spi1config = {
static int32_t thdPriority = 0;
#endif
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
unsigned i;
// As we are not using multiple displays we set g->board to NULL as we don't use it.
@ -78,11 +78,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if(state)
CLR_RST
@ -90,7 +90,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
SET_RST
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
#if GFX_USE_OS_CHIBIOS
thdPriority = (int32_t)chThdGetPriority();
@ -99,7 +99,7 @@ static inline void acquire_bus(GDisplay *g) {
spiAcquireBus(&SPID1);
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
#if GFX_USE_OS_CHIBIOS
chThdSetPriority(thdPriority);
@ -107,7 +107,7 @@ static inline void release_bus(GDisplay *g) {
spiReleaseBus(&SPID1);
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
uint8_t command[2];
(void) g;
@ -121,7 +121,7 @@ static inline void write_cmd(GDisplay *g, uint8_t cmd) {
spiStop(&SPID1);
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
spiStart(&SPID1, &spi1config);

View File

@ -33,7 +33,7 @@
static SPIConfig spi_cfg = { NULL, CS_PORT, CS_PAD, 0 };
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
g->board = 0;
// Maximum speed of SSD1306 is 10Mhz, so set SPI speed less or = to that.
@ -73,31 +73,31 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
palWritePad(RESET_PORT, RESET_PAD, !state);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
spiAcquireBus(SPI_DRIVER);
spiStart(SPI_DRIVER, &spi_cfg);
spiSelect(SPI_DRIVER);
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
spiUnselect(SPI_DRIVER);
spiStop(SPI_DRIVER);
spiReleaseBus(SPI_DRIVER);
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
static uint8_t buf;
palClearPad(DNC_PORT, DNC_PAD);
@ -105,7 +105,7 @@ static inline void write_cmd(GDisplay *g, uint8_t cmd) {
spiSend(SPI_DRIVER, 1, &buf);
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
palSetPad(DNC_PORT, DNC_PAD);
spiSend(SPI_DRIVER, length, data);

View File

@ -35,7 +35,7 @@ static const LCD_Parameters DisplayTimings[] = {
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -74,32 +74,32 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
/* FSMC delay reduced as the controller now runs at full speed */
FSMC_Bank1->BTCR[0+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0 ;
FSMC_Bank1->BTCR[0] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}

View File

@ -53,7 +53,7 @@ static const LCD_Parameters DisplayTimings[] = {
#define Set_RD palSetPad(GDISP_CMD_PORT, GDISP_RD);
#define Clr_RD palClearPad(GDISP_CMD_PORT, GDISP_RD);
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -68,33 +68,33 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
Set_CS;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
Clr_CS;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
Set_RS; Clr_RD; Set_WR;
palWritePort(GDISP_DATA_PORT, index);
Clr_WR;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
Clr_RS; Clr_RD; Set_WR;
palWritePort(GDISP_DATA_PORT, data);

View File

@ -44,13 +44,13 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
return TRUE;
}
static inline bool_t getpin_pressed(GMouse* m) {
static GFXINLINE bool_t getpin_pressed(GMouse* m) {
(void) m;
return (!palReadPad(GPIOG, 0));
}
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
(void) m;
spiAcquireBus(&SPID2);
@ -58,7 +58,7 @@ static inline void aquire_bus(GMouse* m) {
palClearPad(GPIOG, 10);
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
(void) m;
palSetPad(GPIOG, 10);
@ -66,7 +66,7 @@ static inline void release_bus(GMouse* m) {
//TOUCHSCREEN_SPI_EPILOGUE();
}
static inline uint16_t read_value(GMouse* m, uint16_t port) {
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) {
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
(void) m;

View File

@ -60,27 +60,27 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
return TRUE;
}
static inline bool_t getpin_pressed(GMouse* m) {
static GFXINLINE bool_t getpin_pressed(GMouse* m) {
(void) m;
return (!palReadPad(GPIOC, 5));
}
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
(void) m;
spiAcquireBus(&SPID2);
palClearPad(GPIOC, 4);
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
(void) m;
palSetPad(GPIOC, 4);
spiReleaseBus(&SPID2);
}
static inline uint16_t read_value(GMouse* m, uint16_t port) {
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) {
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
(void) m;

View File

@ -42,7 +42,7 @@ static const PWMConfig pwmcfg = {
0
};
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -95,11 +95,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if (state) {
CLR_RST;
@ -108,44 +108,44 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
}
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
pwmEnableChannel(&PWMD4, 1, percent);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#if defined(GDISP_USE_DMA)
static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *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 inline uint16_t read_data(GDisplay *g) {
}
}
static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);

View File

@ -67,12 +67,12 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
}
#endif
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
(void) m;
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
(void) m;
}

View File

@ -19,7 +19,7 @@
#define SET_RD palSetPad(GPIOD, 15);
#define CLR_RD palClearPad(GPIOD, 15);
static inline void init_board(GDisplay *g)
static GFXINLINE void init_board(GDisplay *g)
{
// As we are not using multiple displays we set g->board to NULL as we don't use it.
@ -43,12 +43,12 @@ static inline void init_board(GDisplay *g)
}
}
static inline void post_init_board(GDisplay *g)
static GFXINLINE void post_init_board(GDisplay *g)
{
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state)
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state)
{
(void) g;
(void) state;
@ -56,7 +56,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state)
/* Nothing to do here - reset pin tied to Vcc */
}
static inline void set_backlight(GDisplay *g, uint8_t percent)
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent)
{
(void) g;
(void) percent;
@ -64,17 +64,17 @@ static inline void set_backlight(GDisplay *g, uint8_t percent)
/* Nothing to do here - Backlight always on */
}
static inline void acquire_bus(GDisplay *g)
static GFXINLINE void acquire_bus(GDisplay *g)
{
(void) g;
}
static inline void release_bus(GDisplay *g)
static GFXINLINE void release_bus(GDisplay *g)
{
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index)
static GFXINLINE void write_index(GDisplay *g, uint16_t index)
{
(void) g;
@ -85,7 +85,7 @@ static inline void write_index(GDisplay *g, uint16_t index)
SET_RS;
}
static inline void write_data(GDisplay *g, uint16_t data)
static GFXINLINE void write_data(GDisplay *g, uint16_t data)
{
(void) g;
@ -94,7 +94,7 @@ static inline void write_data(GDisplay *g, uint16_t data)
SET_WR;
}
static inline void setreadmode(GDisplay *g)
static GFXINLINE void setreadmode(GDisplay *g)
{
(void) g;
@ -103,7 +103,7 @@ static inline void setreadmode(GDisplay *g)
CLR_RD;
}
static inline void setwritemode(GDisplay *g)
static GFXINLINE void setwritemode(GDisplay *g)
{
(void) g;
@ -112,7 +112,7 @@ static inline void setwritemode(GDisplay *g)
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return palReadPort(GPIOE);

View File

@ -43,14 +43,14 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
return TRUE;
}
static inline bool_t getpin_pressed(GMouse* m)
static GFXINLINE bool_t getpin_pressed(GMouse* m)
{
(void) m;
return (!palReadPad(GPIOC, 4));
}
static inline void aquire_bus(GMouse* m)
static GFXINLINE void aquire_bus(GMouse* m)
{
(void) m;
@ -58,7 +58,7 @@ static inline void aquire_bus(GMouse* m)
palClearPad(GPIOC, 6);
}
static inline void release_bus(GMouse* m)
static GFXINLINE void release_bus(GMouse* m)
{
(void) m;
@ -66,7 +66,7 @@ static inline void release_bus(GMouse* m)
spiReleaseBus(&SPID1);
}
static inline uint16_t read_value(GMouse* m, uint16_t port)
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port)
{
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};

View File

@ -49,7 +49,7 @@ static const PWMConfig pwmcfg =
#define GDISP_DMA_STREAM STM32_DMA1_STREAM7
#define FSMC_BANK 0
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
/*
* As we are not using multiple displays we set g->board to NULL as we don't
* use it.
@ -120,56 +120,56 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if(state) {}
else {}
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
if (percent > 100) { percent = 100; }
pwmEnableChannel(&PWMD3, 1, percent);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | \
@ -182,7 +182,7 @@ static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
}
}
static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | \

View File

@ -63,7 +63,7 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
/*
* PB6 is connected to TP_IRQ (low active).
*/
static inline bool_t getpin_pressed(GMouse* m) {
static GFXINLINE bool_t getpin_pressed(GMouse* m) {
(void)m;
return (!palReadPad(GPIOB, 6));
}
@ -71,19 +71,19 @@ static inline bool_t getpin_pressed(GMouse* m) {
/*
* PA4 is connected to TP_CS (low active):
*/
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
(void)m;
spiAcquireBus(&SPID1);
palClearPad(GPIOA, 4);
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
(void)m;
palSetPad(GPIOA, 4);
spiReleaseBus(&SPID1);
}
static inline uint16_t read_value(GMouse* m, uint16_t port) {
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) {
(void)m;
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};

View File

@ -20,7 +20,7 @@
#define FSMC_BANK 4
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -62,7 +62,7 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
// FSMC delay reduced as the controller now runs at full speed
@ -70,40 +70,40 @@ static inline void post_init_board(GDisplay *g) {
FSMC_Bank1->BTCR[2] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;

View File

@ -41,12 +41,12 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
return TRUE;
}
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
(void) m;
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
(void) m;
}

View File

@ -50,7 +50,7 @@ IOBus busDataLo = { GDISP_DATA_LO_PORT, 0xFF, 0 };
IOBus busDataHi = { GDISP_DATA_HI_PORT, 0xFF, 8 };
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
g->board = 0;
switch(g->controllerdisplay) {
case 0:
@ -64,11 +64,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if (state) {
CLR_RST;
@ -77,17 +77,17 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
}
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
CLR_CS;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
SET_CS;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
CLR_DC;
@ -97,7 +97,7 @@ static inline void write_index(GDisplay *g, uint16_t index) {
SET_DC;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
palWriteBus(&busDataLo, (data & 0xFF));
@ -105,19 +105,19 @@ static inline void write_data(GDisplay *g, uint16_t data) {
writeStrobe;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
palSetBusMode(&busDataLo, PAL_MODE_INPUT_PULLUP);
palSetBusMode(&busDataHi, PAL_MODE_INPUT_PULLUP);
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
palSetBusMode(&busDataLo, PAL_MODE_OUTPUT_PUSHPULL);
palSetBusMode(&busDataHi, PAL_MODE_OUTPUT_PUSHPULL);
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
uint16_t data;
(void) g;

View File

@ -32,7 +32,7 @@ static const SPIConfig spicfg = {
};
// Initialise the board
static inline void board_init(void) {
static GFXINLINE void board_init(void) {
palSetPadMode(GPIOD, GPIOD_MP3_CS, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOD, GPIOD_MP3_RST, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOD, GPIOD_MP3_DCS, PAL_MODE_OUTPUT_PUSHPULL);
@ -51,7 +51,7 @@ static inline void board_init(void) {
#define board_dreq() GET_DREQ
// Start a command write
static inline void board_startcmdwrite(void) {
static GFXINLINE void board_startcmdwrite(void) {
#if SPI_USE_MUTUAL_EXCLUSION
spiAcquireBus(SPI_PORT);
#endif
@ -59,7 +59,7 @@ static inline void board_startcmdwrite(void) {
}
// End a command write
static inline void board_endcmdwrite(void) {
static GFXINLINE void board_endcmdwrite(void) {
SET_CS;
#if SPI_USE_MUTUAL_EXCLUSION
spiReleaseBus(SPI_PORT);
@ -73,7 +73,7 @@ static inline void board_endcmdwrite(void) {
#define board_endcmdread() board_endcmdwrite()
// Start a data write
static inline void board_startdatawrite(void) {
static GFXINLINE void board_startdatawrite(void) {
#if SPI_USE_MUTUAL_EXCLUSION
spiAcquireBus(SPI_PORT);
#endif
@ -81,7 +81,7 @@ static inline void board_startdatawrite(void) {
}
// End a data write
static inline void board_enddatawrite(void) {
static GFXINLINE void board_enddatawrite(void) {
#if SPI_USE_MUTUAL_EXCLUSION
spiReleaseBus(SPI_PORT);
#endif

View File

@ -67,12 +67,12 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
}
#endif
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
(void) m;
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
(void) m;
}

View File

@ -19,7 +19,7 @@
#define SET_RD palSetPad(GPIOE, GPIOE_PMRD);
#define CLR_RD palClearPad(GPIOE, GPIOE_PMRD);
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -35,11 +35,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if(state) {
// reset lcd
@ -49,7 +49,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
}
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
// TODO: can probably pwm this
if(percent) {
@ -61,11 +61,11 @@ static inline void set_backlight(GDisplay *g, uint8_t percent) {
}
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
@ -76,37 +76,37 @@ static inline void release_bus(GDisplay *g) {
*
* @notapi
*/
static inline void ili9341_delay(uint16_t dly) {
static GFXINLINE void ili9341_delay(uint16_t dly) {
static uint16_t i;
for(i = 0; i < dly; i++)
asm("nop");
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
palWriteGroup(GPIOE, 0x00FF, 0, index);
CLR_RS; CLR_WR; ili9341_delay(1); SET_WR; ili9341_delay(1); SET_RS;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
palWriteGroup(GPIOE, 0x00FF, 0, data);
CLR_WR; ili9341_delay(1); SET_WR; ili9341_delay(1);
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
// change pin mode to digital input
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_INPUT);
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
// change pin mode back to digital output
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
uint16_t value;
(void) g;
CLR_RD;

View File

@ -32,7 +32,7 @@ static const SPIConfig spicfg = {
};
// Initialise the board
static inline void board_init(void) {
static GFXINLINE void board_init(void) {
palSetPadMode(GPIOC, GPIOC_MP3_CS, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOC, GPIOC_MP3_RST, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOC, GPIOC_MP3_DCS, PAL_MODE_OUTPUT_PUSHPULL);
@ -51,7 +51,7 @@ static inline void board_init(void) {
#define board_dreq() GET_DREQ
// Start a command write
static inline void board_startcmdwrite(void) {
static GFXINLINE void board_startcmdwrite(void) {
#if SPI_USE_MUTUAL_EXCLUSION
spiAcquireBus(SPI_PORT);
#endif
@ -59,7 +59,7 @@ static inline void board_startcmdwrite(void) {
}
// End a command write
static inline void board_endcmdwrite(void) {
static GFXINLINE void board_endcmdwrite(void) {
SET_CS;
#if SPI_USE_MUTUAL_EXCLUSION
spiReleaseBus(SPI_PORT);
@ -73,7 +73,7 @@ static inline void board_endcmdwrite(void) {
#define board_endcmdread() board_endcmdwrite()
// Start a data write
static inline void board_startdatawrite(void) {
static GFXINLINE void board_startdatawrite(void) {
#if SPI_USE_MUTUAL_EXCLUSION
spiAcquireBus(SPI_PORT);
#endif
@ -81,7 +81,7 @@ static inline void board_startdatawrite(void) {
}
// End a data write
static inline void board_enddatawrite(void) {
static GFXINLINE void board_enddatawrite(void) {
#if SPI_USE_MUTUAL_EXCLUSION
spiReleaseBus(SPI_PORT);
#endif

View File

@ -69,7 +69,7 @@ static bool_t pwmRunning = FALSE;
*
* @notapi
*/
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -129,11 +129,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if (state)
palClearPad(IOPORT1, PIOA_LCD_RESET);
@ -141,7 +141,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(IOPORT1, PIOA_LCD_RESET);
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
if (percent == 100) {
/* Turn the pin on - No PWM */
@ -167,15 +167,15 @@ static inline void set_backlight(GDisplay *g, uint8_t percent) {
}
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
// wait for the previous transfer to complete
while(!(pSPI->SPI_SR & AT91C_SPI_TDRE));
@ -183,7 +183,7 @@ static inline void write_index(GDisplay *g, uint16_t index) {
pSPI->SPI_TDR = index & 0xFF;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
// wait for the previous transfer to complete
while(!(pSPI->SPI_SR & AT91C_SPI_TDRE));

View File

@ -68,7 +68,7 @@ static bool_t pwmRunning = FALSE;
*
* @notapi
*/
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -127,11 +127,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if (state)
palClearPad(IOPORT1, PIOA_LCD_RESET);
@ -139,7 +139,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(IOPORT1, PIOA_LCD_RESET);
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
if (percent == 100) {
/* Turn the pin on - No PWM */
@ -165,15 +165,15 @@ static inline void set_backlight(GDisplay *g, uint8_t percent) {
}
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
// wait for the previous transfer to start
while(!(pSPI->SPI_SR & AT91C_SPI_TDRE));
@ -181,7 +181,7 @@ static inline void write_index(GDisplay *g, uint16_t index) {
pSPI->SPI_TDR = index & 0xFF;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
// wait for the previous transfer to start
while(!(pSPI->SPI_SR & AT91C_SPI_TDRE));

View File

@ -92,40 +92,40 @@
#error "SSD1306 board file: Unsupported I2C method"
#endif
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
I2C_INIT();
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
I2C_GETBUS();
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
I2C_WAITCOMPLETE();
I2C_RELEASEBUS();
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
I2C_WAITCOMPLETE();
@ -134,7 +134,7 @@ static inline void write_cmd(GDisplay *g, uint8_t cmd) {
I2C_WRITECMDBYTE(cmd);
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
I2C_WAITCOMPLETE();

View File

@ -161,7 +161,7 @@
#error "SSD1306 board file: Unsupported SPI method"
#endif
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
PinIsOutput (PORT_DC, PIN_DC);
@ -171,11 +171,11 @@ static inline void init_board(GDisplay *g) {
SPI_INIT();
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
@ -185,25 +185,25 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
PinSet(PORT_RESET, PIN_RESET);
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
SPI_GETBUS();
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
SPI_WAITCOMPLETE();
SPI_RELEASEBUS();
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
// Command mode please
@ -213,7 +213,7 @@ static inline void write_cmd(GDisplay *g, uint8_t cmd) {
SPI_WRITEBYTE(cmd);
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
// Data mode please

View File

@ -158,7 +158,7 @@
#error "SSD1331 board file: Unsupported SPI method"
#endif
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
PinIsOutput (PORT_DC, PIN_DC);
@ -168,11 +168,11 @@ static inline void init_board(GDisplay *g) {
SPI_INIT();
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
@ -182,25 +182,25 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
PinSet(PORT_RESET, PIN_RESET);
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
SPI_GETBUS();
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
SPI_WAITCOMPLETE();
SPI_RELEASEBUS();
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
// Command mode please
@ -210,7 +210,7 @@ static inline void write_cmd(GDisplay *g, uint8_t cmd) {
SPI_WRITEBYTE(cmd);
}
static inline void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
(void) g;
// Data mode please

View File

@ -147,7 +147,7 @@
#error "TLS8204 board file: Unsupported SPI method"
#endif
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
PinIsOutput (PORT_DC, PIN_DC);
@ -157,11 +157,11 @@ static inline void init_board(GDisplay *g) {
SPI_INIT();
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
@ -171,25 +171,25 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
PinSet(PORT_RESET, PIN_RESET);
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
SPI_GETBUS();
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
SPI_WAITCOMPLETE();
SPI_RELEASEBUS();
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
// Command mode please
@ -199,7 +199,7 @@ static inline void write_cmd(GDisplay *g, uint8_t cmd) {
SPI_WRITEBYTE(cmd);
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
// Data mode please

View File

@ -13,7 +13,7 @@
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -41,11 +41,11 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if(state)
@ -54,7 +54,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
palSetPad(GPIOE, GPIOE_TFT_RST);
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
if(percent)
@ -63,35 +63,35 @@ static inline void set_backlight(GDisplay *g, uint8_t percent) {
palSetPad(GPIOD, GPIOD_TFT_LIGHT);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;

View File

@ -50,7 +50,7 @@ static const ADCConversionGroup adc_x_config = {
ADC_SQR3_SQ2_N(ADC_CHANNEL_IN10) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN11)
};
static inline void setup_z(void) {
static GFXINLINE void setup_z(void) {
palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_PULLDOWN);
palSetPadMode(GPIOC, 1, PAL_MODE_INPUT);
palSetPadMode(GPIOC, 2, PAL_MODE_INPUT);

View File

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

View File

@ -48,7 +48,7 @@ static const ltdcConfig driverCfg = {
LTDC_UNUSED_LAYER_CONFIG
};
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -88,28 +88,28 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
spiSelect(SPI_PORT);
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
spiUnselect(SPI_PORT);
}
static inline void write_index(GDisplay *g, uint8_t index) {
static GFXINLINE void write_index(GDisplay *g, uint8_t index) {
static uint8_t sindex;
(void) g;
@ -118,7 +118,7 @@ static inline void write_index(GDisplay *g, uint8_t index) {
spiSend(SPI_PORT, 1, &sindex);
}
static inline void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
static uint8_t sdata;
(void) g;

View File

@ -68,12 +68,12 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
}
#endif
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
(void) m;
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
(void) m;
}

View File

@ -13,6 +13,11 @@
#include "stm32f7xx_hal_gpio.h"
#include <string.h>
#if !GFX_USE_OS_CHIBIOS
#define AFRL AFR[0]
#define AFRH AFR[1]
#endif
static const ltdcConfig driverCfg = {
480, 272, // Width, Height (pixels)
41, 10, // Horizontal, Vertical sync (pixels)
@ -56,181 +61,181 @@ static void configureLcdPins(void)
GPIOI->MODER |= GPIO_MODER_MODER15_1;
GPIOI->OTYPER &=~ GPIO_OTYPER_OT_15;
GPIOI->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR15_0 | GPIO_OSPEEDER_OSPEEDR15_1;
GPIOI->AFR[1] |= ((uint32_t)0xE << 4*7);
GPIOI->AFRH |= ((uint32_t)0xE << 4*7);
// PJ0: LCD_R1
GPIOJ->MODER |= GPIO_MODER_MODER0_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_0;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR0_0 | GPIO_OSPEEDER_OSPEEDR0_1;
GPIOJ->AFR[0] |= ((uint32_t)0xE << 4*0);
GPIOJ->AFRL |= ((uint32_t)0xE << 4*0);
// PJ1: LCD_R2
GPIOJ->MODER |= GPIO_MODER_MODER1_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_1;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR1_0 | GPIO_OSPEEDER_OSPEEDR1_1;
GPIOJ->AFR[0] |= ((uint32_t)0xE << 4*1);
GPIOJ->AFRL |= ((uint32_t)0xE << 4*1);
// PJ2: LCD_R3
GPIOJ->MODER |= GPIO_MODER_MODER2_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_2;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR2_0 | GPIO_OSPEEDER_OSPEEDR2_1;
GPIOJ->AFR[0] |= ((uint32_t)0xE << 4*2);
GPIOJ->AFRL |= ((uint32_t)0xE << 4*2);
// PJ3: LCD_R4
GPIOJ->MODER |= GPIO_MODER_MODER3_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_3;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR3_0 | GPIO_OSPEEDER_OSPEEDR3_1;
GPIOJ->AFR[0] |= ((uint32_t)0xE << 4*3);
GPIOJ->AFRL |= ((uint32_t)0xE << 4*3);
// PJ4: LCD_R5
GPIOJ->MODER |= GPIO_MODER_MODER4_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_4;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR4_0 | GPIO_OSPEEDER_OSPEEDR4_1;
GPIOJ->AFR[0] |= ((uint32_t)0xE << 4*4);
GPIOJ->AFRL |= ((uint32_t)0xE << 4*4);
// PJ5: LCD_R6
GPIOJ->MODER |= GPIO_MODER_MODER5_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_5;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR5_0 | GPIO_OSPEEDER_OSPEEDR5_1;
GPIOJ->AFR[0] |= ((uint32_t)0xE << 4*5);
GPIOJ->AFRL |= ((uint32_t)0xE << 4*5);
// PJ6: LCD_R7
GPIOJ->MODER |= GPIO_MODER_MODER6_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_6;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR6_0 | GPIO_OSPEEDER_OSPEEDR6_1;
GPIOJ->AFR[0] |= ((uint32_t)0xE << 4*6);
GPIOJ->AFRL |= ((uint32_t)0xE << 4*6);
// PJ7: LCD_G0
GPIOJ->MODER |= GPIO_MODER_MODER7_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_7;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR7_0 | GPIO_OSPEEDER_OSPEEDR7_1;
GPIOJ->AFR[0] |= ((uint32_t)0xE << 4*7);
GPIOJ->AFRL |= ((uint32_t)0xE << 4*7);
// PJ8: LCD_G1
GPIOJ->MODER |= GPIO_MODER_MODER8_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_8;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR8_0 | GPIO_OSPEEDER_OSPEEDR8_1;
GPIOJ->AFR[1] |= ((uint32_t)0xE << 4*0);
GPIOJ->AFRH |= ((uint32_t)0xE << 4*0);
// PJ9: LCD_G2
GPIOJ->MODER |= GPIO_MODER_MODER9_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_9;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR9_0 | GPIO_OSPEEDER_OSPEEDR9_1;
GPIOJ->AFR[1] |= ((uint32_t)0xE << 4*1);
GPIOJ->AFRH |= ((uint32_t)0xE << 4*1);
// PJ10: LCD_G3
GPIOJ->MODER |= GPIO_MODER_MODER10_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_10;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR10_0 | GPIO_OSPEEDER_OSPEEDR10_1;
GPIOJ->AFR[1] |= ((uint32_t)0xE << 4*2);
GPIOJ->AFRH |= ((uint32_t)0xE << 4*2);
// PJ11: LCD_G4
GPIOJ->MODER |= GPIO_MODER_MODER11_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_11;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR11_0 | GPIO_OSPEEDER_OSPEEDR11_1;
GPIOJ->AFR[1] |= ((uint32_t)0xE << 4*3);
GPIOJ->AFRH |= ((uint32_t)0xE << 4*3);
// PK0: LCD_G5
GPIOK->MODER |= GPIO_MODER_MODER0_0;
GPIOK->OTYPER &=~ GPIO_OTYPER_OT_0;
GPIOK->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR0_0 | GPIO_OSPEEDER_OSPEEDR0_1;
GPIOK->AFR[0] |= ((uint32_t)0xE << 4*0);
GPIOK->AFRL |= ((uint32_t)0xE << 4*0);
// PK1: LCD_G6
GPIOK->MODER |= GPIO_MODER_MODER1_1;
GPIOK->OTYPER &=~ GPIO_OTYPER_OT_1;
GPIOK->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR1_0 | GPIO_OSPEEDER_OSPEEDR1_1;
GPIOK->AFR[0] |= ((uint32_t)0xE << 4*1);
GPIOK->AFRL |= ((uint32_t)0xE << 4*1);
// PK2: LCD_G7
GPIOK->MODER |= GPIO_MODER_MODER2_1;
GPIOK->OTYPER &=~ GPIO_OTYPER_OT_2;
GPIOK->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR2_0 | GPIO_OSPEEDER_OSPEEDR2_1;
GPIOK->AFR[0] |= ((uint32_t)0xE << 4*2);
GPIOK->AFRL |= ((uint32_t)0xE << 4*2);
// PE4: LCD_B0
GPIOE->MODER |= GPIO_MODER_MODER4_1;
GPIOE->OTYPER &=~ GPIO_OTYPER_OT_4;
GPIOE->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR4_0 | GPIO_OSPEEDER_OSPEEDR4_1;
GPIOE->AFR[0] |= ((uint32_t)0xE << 4*4);
GPIOE->AFRL |= ((uint32_t)0xE << 4*4);
// PJ13: LCD_B1
GPIOJ->MODER |= GPIO_MODER_MODER13_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_13;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR13_0 | GPIO_OSPEEDER_OSPEEDR13_1;
GPIOJ->AFR[1] |= ((uint32_t)0xE << 4*5);
GPIOJ->AFRH |= ((uint32_t)0xE << 4*5);
// PJ14: LCD_B2
GPIOJ->MODER |= GPIO_MODER_MODER14_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_14;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR14_0 | GPIO_OSPEEDER_OSPEEDR14_1;
GPIOJ->AFR[1] |= ((uint32_t)0xE << 4*6);
GPIOJ->AFRH |= ((uint32_t)0xE << 4*6);
// PJ15: LCD_B3
GPIOJ->MODER |= GPIO_MODER_MODER15_1;
GPIOJ->OTYPER &=~ GPIO_OTYPER_OT_15;
GPIOJ->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR15_0 | GPIO_OSPEEDER_OSPEEDR15_1;
GPIOJ->AFR[1] |= ((uint32_t)0xE << 4*7);
GPIOJ->AFRH |= ((uint32_t)0xE << 4*7);
// PG12: LCD_B4
GPIOG->MODER |= GPIO_MODER_MODER12_1;
GPIOG->OTYPER &=~ GPIO_OTYPER_OT_12;
GPIOG->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR12_0 | GPIO_OSPEEDER_OSPEEDR12_1;
GPIOG->AFR[1] |= ((uint32_t)0xE << 4*4);
GPIOG->AFRH |= ((uint32_t)0xE << 4*4);
// PK4: LCD_B5
GPIOK->MODER |= GPIO_MODER_MODER4_1;
GPIOK->OTYPER &=~ GPIO_OTYPER_OT_4;
GPIOK->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR4_0 | GPIO_OSPEEDER_OSPEEDR4_1;
GPIOK->AFR[0] |= ((uint32_t)0xE << 4*4);
GPIOK->AFRL |= ((uint32_t)0xE << 4*4);
// PK5: LCD_B6
GPIOK->MODER |= GPIO_MODER_MODER5_1;
GPIOK->OTYPER &=~ GPIO_OTYPER_OT_5;
GPIOK->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR5_0 | GPIO_OSPEEDER_OSPEEDR5_1;
GPIOK->AFR[0] |= ((uint32_t)0xE << 4*5);
GPIOK->AFRL |= ((uint32_t)0xE << 4*5);
// PK6: LCD_B7
GPIOK->MODER |= GPIO_MODER_MODER6_1;
GPIOK->OTYPER &=~ GPIO_OTYPER_OT_6;
GPIOK->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR6_0 | GPIO_OSPEEDER_OSPEEDR6_1;
GPIOK->AFR[0] |= ((uint32_t)0xE << 4*6);
GPIOK->AFRL |= ((uint32_t)0xE << 4*6);
// PK7: LCD_DE
GPIOK->MODER |= GPIO_MODER_MODER7_1;
GPIOK->OTYPER &=~ GPIO_OTYPER_OT_7;
GPIOK->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR7_0 | GPIO_OSPEEDER_OSPEEDR7_1;
GPIOK->AFR[0] |= ((uint32_t)0xE << 4*7);
GPIOK->AFRL |= ((uint32_t)0xE << 4*7);
// PI9: LCD_VSYNC
GPIOI->MODER |= GPIO_MODER_MODER9_1;
GPIOI->OTYPER &=~ GPIO_OTYPER_OT_9;
GPIOI->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR9_0 | GPIO_OSPEEDER_OSPEEDR9_1;
GPIOI->AFR[1] |= ((uint32_t)0xE << 4*1);
GPIOI->AFRH |= ((uint32_t)0xE << 4*1);
// PI10: LCD_VSYNC
GPIOI->MODER |= GPIO_MODER_MODER10_1;
GPIOI->OTYPER &=~ GPIO_OTYPER_OT_10;
GPIOI->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR10_0 | GPIO_OSPEEDER_OSPEEDR10_1;
GPIOI->AFR[1] |= ((uint32_t)0xE << 4*2);
GPIOI->AFRH |= ((uint32_t)0xE << 4*2);
// PI13: LCD_INT
GPIOI->MODER |= GPIO_MODER_MODER13_1;
GPIOI->OTYPER &=~ GPIO_OTYPER_OT_13;
GPIOI->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR13_0 | GPIO_OSPEEDER_OSPEEDR13_1;
GPIOI->AFR[1] |= ((uint32_t)0xE << 4*5);
GPIOI->AFRH |= ((uint32_t)0xE << 4*5);
// PI14: LCD_CLK
GPIOI->MODER |= GPIO_MODER_MODER14_1;
GPIOI->OTYPER &=~ GPIO_OTYPER_OT_14;
GPIOI->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR14_0 | GPIO_OSPEEDER_OSPEEDR14_1;
GPIOI->AFR[1] |= ((uint32_t)0xE << 4*6);
GPIOI->AFRH |= ((uint32_t)0xE << 4*6);
// PI8: ???
GPIOI->MODER |= GPIO_MODER_MODER8_1;
GPIOI->OTYPER &=~ GPIO_OTYPER_OT_8;
GPIOI->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR8_0 | GPIO_OSPEEDER_OSPEEDR8_1;
GPIOI->AFR[1] |= ((uint32_t)0xE << 4*0);
GPIOI->AFRH |= ((uint32_t)0xE << 4*0);
// PI12: LCD_DISP_PIN
GPIOI->MODER |= GPIO_MODER_MODER12_0;
@ -243,7 +248,7 @@ static void configureLcdPins(void)
GPIOK->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR3_0 | GPIO_OSPEEDER_OSPEEDR3_1;
}
static void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it
g->board = 0;
@ -290,11 +295,11 @@ static void init_board(GDisplay *g) {
}
}
static void post_init_board(GDisplay* g) {
static GFXINLINE void post_init_board(GDisplay* g) {
(void) g;
}
static void set_backlight(GDisplay* g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) {
(void) g;
// ST was stupid enought not to hook this up to a pin that

View File

@ -40,14 +40,14 @@ static bool_t init_board(GMouse* m, unsigned instance)
GPIOH->MODER |= GPIO_MODER_MODER7_1; // Alternate function
GPIOH->OTYPER |= GPIO_OTYPER_OT_7; // OpenDrain
GPIOH->OSPEEDR &= ~GPIO_OSPEEDER_OSPEEDR7; // LowSpeed
GPIOH->AFRL |= (uint32_t)(0x04 << 4*7); // AF4
GPIOH->AFRL |= ((uint32_t)0x04 << 4*7); // AF4
// I2C3_SDA GPIOH8, alternate, opendrain, highspeed
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOHEN; // Enable clock
GPIOH->MODER |= GPIO_MODER_MODER8_1; // Alternate function
GPIOH->OTYPER |= GPIO_OTYPER_OT_8; // OpenDrain
GPIOH->OSPEEDR &= ~GPIO_OSPEEDER_OSPEEDR8; // LowSpeed
GPIOH->AFRH |= (uint32_t)(0x04 << 4*0); // AF4
GPIOH->AFRH |= ((uint32_t)0x04 << 4*0); // AF4
// Initialize the I2C3 peripheral
if (!(i2cInit(I2C3))) {

View File

@ -5,6 +5,10 @@
#include "stm32f7xx_hal_gpio.h"
#include "stm32f7xx_hal_sdram.h"
#if GFX_USE_OS_CHIBIOS
#define HAL_GPIO_Init(port, ptr) palSetGroupMode(port, (ptr)->Pin, 0, (ptr)->Mode|((ptr)->Speed<<3)|((ptr)->Pull<<5)|((ptr)->Alternate<<7))
#endif
#define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16
#define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
#define REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */

View File

@ -1,16 +1,18 @@
#include "gfx.h"
#include "stm32f7xx_hal.h"
#if !GFX_USE_OS_CHIBIOS
systemticks_t gfxSystemTicks(void)
{
return HAL_GetTick();
}
#if GFX_USE_OS_CHIBIOS
#define HAL_GPIO_Init(port, ptr) palSetGroupMode(port, (ptr)->Pin, 0, (ptr)->Mode|((ptr)->Speed<<3)|((ptr)->Pull<<5)|((ptr)->Alternate<<7))
#else
systemticks_t gfxSystemTicks(void)
{
return HAL_GetTick();
}
systemticks_t gfxMillisecondsToTicks(delaytime_t ms)
{
return ms;
}
systemticks_t gfxMillisecondsToTicks(delaytime_t ms)
{
return ms;
}
#endif
static void SystemClock_Config(void);

View File

@ -38,7 +38,7 @@ static const PWMConfig pwmcfg = {
0
};
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -103,55 +103,55 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
pwmEnableChannel(&PWMD3, 2, percent);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_3 | FSMC_BTR1_DATAST_3 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *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);
@ -162,7 +162,7 @@ static inline uint16_t read_data(GDisplay *g) {
}
}
static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);

View File

@ -15,7 +15,7 @@ static const SPIConfig spicfg = {
/* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0,
};
static inline void init_board(void)
static GFXINLINE void init_board(void)
{
palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOC, 4, PAL_MODE_INPUT);
@ -26,24 +26,24 @@ static inline void init_board(void)
spiStart(&SPID1, &spicfg);
}
static inline bool_t getpin_pressed(void)
static GFXINLINE bool_t getpin_pressed(void)
{
return (!palReadPad(GPIOC, 4));
}
static inline void aquire_bus(void)
static GFXINLINE void aquire_bus(void)
{
spiAcquireBus(&SPID1);
palClearPad(GPIOC, 6);
}
static inline void release_bus(void)
static GFXINLINE void release_bus(void)
{
palSetPad(GPIOC, 6);
spiReleaseBus(&SPID1);
}
static inline uint16_t read_value(uint16_t port)
static GFXINLINE uint16_t read_value(uint16_t port)
{
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};

View File

@ -65,27 +65,27 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
return TRUE;
}
static inline bool_t getpin_pressed(GMouse* m) {
static GFXINLINE bool_t getpin_pressed(GMouse* m) {
(void) m;
return (!palReadPad(GPIOC, 4));
}
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
(void) m;
spiAcquireBus(&SPID1);
palClearPad(GPIOC, 6);
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
(void) m;
palSetPad(GPIOC, 6);
spiReleaseBus(&SPID1);
}
static inline uint16_t read_value(GMouse* m, uint16_t port) {
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) {
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
(void) m;

View File

@ -43,21 +43,21 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
return TRUE;
}
inline bool_t getpin_pressed(void) {
GFXINLINE bool_t getpin_pressed(void) {
return (!palReadPad(GPIOC, 4));
}
static inline void aquire_bus(void) {
static GFXINLINE void aquire_bus(void) {
spiAcquireBus(&SPID1);
palClearPad(GPIOC, 6);
}
static inline void release_bus(void) {
static GFXINLINE void release_bus(void) {
palSetPad(GPIOC, 6);
spiReleaseBus(&SPID1);
}
static inline uint16_t read_value(uint16_t port) {
static GFXINLINE uint16_t read_value(uint16_t port) {
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
uint16_t ret;

View File

@ -38,7 +38,7 @@ static const PWMConfig pwmcfg = {
0
};
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -101,55 +101,55 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
pwmEnableChannel(&PWMD3, 2, percent);
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_3 | FSMC_BTR1_DATAST_3 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *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);
@ -160,7 +160,7 @@ static inline uint16_t read_data(GDisplay *g) {
}
}
static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
(void) g;
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);

View File

@ -15,7 +15,7 @@ static const SPIConfig spicfg = {
/* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0,
};
static inline void init_board(void)
static GFXINLINE void init_board(void)
{
palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOC, 4, PAL_MODE_INPUT);
@ -26,24 +26,24 @@ static inline void init_board(void)
spiStart(&SPID1, &spicfg);
}
static inline bool_t getpin_pressed(void)
static GFXINLINE bool_t getpin_pressed(void)
{
return (!palReadPad(GPIOC, 4));
}
static inline void aquire_bus(void)
static GFXINLINE void aquire_bus(void)
{
spiAcquireBus(&SPID1);
palClearPad(GPIOC, 6);
}
static inline void release_bus(void)
static GFXINLINE void release_bus(void)
{
palSetPad(GPIOC, 6);
spiReleaseBus(&SPID1);
}
static inline uint16_t read_value(uint16_t port)
static GFXINLINE uint16_t read_value(uint16_t port)
{
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};

View File

@ -43,21 +43,21 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
return TRUE;
}
inline bool_t getpin_pressed(void) {
GFXINLINE bool_t getpin_pressed(void) {
return (!palReadPad(GPIOC, 4));
}
static inline void aquire_bus(void) {
static GFXINLINE void aquire_bus(void) {
spiAcquireBus(&SPID1);
palClearPad(GPIOC, 6);
}
static inline void release_bus(void) {
static GFXINLINE void release_bus(void) {
palSetPad(GPIOC, 6);
spiReleaseBus(&SPID1);
}
static inline uint16_t read_value(uint16_t port) {
static GFXINLINE uint16_t read_value(uint16_t port) {
static uint8_t txbuf[3] = {0};
static uint8_t rxbuf[3] = {0};
uint16_t ret;

View File

@ -19,6 +19,8 @@ FEATURE: Added color to widget style for focused widgets
FEATURE: Added GWIN_FOCUS_HIGHLIGHT_WIDTH as an option in the configuration file
FEATURE: Added support for CMSIS RTOS
FEATURE: Added support for KEIL RTX
FEATURE: Replace all references to inline with a reference to GFXINLINE
FEATURE: Added config option GFX_NO_INLINE to run off inlining of ugfx functions.
*** Release 2.3 ***

View File

@ -81,7 +81,7 @@ static void cmd_write(uint16_t addr, uint16_t data) {
}
#if VS1053_CLK > 12288000
static inline void cmd_writenodreq(uint16_t addr, uint16_t data) {
static GFXINLINE void cmd_writenodreq(uint16_t addr, uint16_t data) {
uint8_t buf[4];
// This is the same as cmd_write() except for it doesn't wait for dreq first

View File

@ -46,7 +46,7 @@
* #define EINK_WRITECOUNT 4
*/
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
@ -54,57 +54,57 @@ static void eink_delay(int us) {
(void) us;
}
static inline void setpower_vdd(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vdd(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpower_vneg(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vneg(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpower_vpos(GDisplay *g, bool_t on) {
static GFXINLINE void setpower_vpos(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpin_le(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_le(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpin_oe(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_oe(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpin_cl(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_cl(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpin_sph(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_sph(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpins_data(GDisplay *g, uint8_t value) {
static GFXINLINE void setpins_data(GDisplay *g, uint8_t value) {
(void) g;
(void) value;
}
static inline void setpin_ckv(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_ckv(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpin_gmode(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_gmode(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}
static inline void setpin_spv(GDisplay *g, bool_t on) {
static GFXINLINE void setpin_spv(GDisplay *g, bool_t on) {
(void) g;
(void) on;
}

View File

@ -79,7 +79,7 @@
#define PRIV(g) ((drvPriv *)g->priv)
/* Delay between signal changes, to give time for IO pins to change state. */
static inline void clockdelay(void)
static GFXINLINE void clockdelay(void)
{
#if EINK_CLOCKDELAY & 1
asm("nop");

View File

@ -45,7 +45,7 @@
/* Set up IO pins for the panel connection. */
static inline void init_board(void) {
static GFXINLINE void init_board(void) {
/* Main SMPS power control, active low
* (open collector so that MOSFET gate can be pulled up to Vbat) */
palWritePad(GPIOC, GPIOC_SMPS_CTRL, true);
@ -69,58 +69,58 @@ static void eink_delay(int us)
}
/* Turn the E-ink panel Vdd supply (+3.3V) on or off. */
static inline void setpower_vdd(bool_t on) {
static GFXINLINE void setpower_vdd(bool_t on) {
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 inline void setpower_vneg(bool_t on) {
static GFXINLINE void setpower_vneg(bool_t on) {
palWritePad(GPIOA, GPIOA_VNEG_CTRL, on);
}
/* Turn the E-ink panel positive supplies (-15V, -20V) on or off. */
static inline void setpower_vpos(bool_t on) {
static GFXINLINE void setpower_vpos(bool_t on) {
palWritePad(GPIOA, GPIOA_VPOS_CTRL, on);
}
/* Set the state of the LE (source driver Latch Enable) pin. */
static inline void setpin_le(bool_t on) {
static GFXINLINE void setpin_le(bool_t on) {
palWritePad(GPIOB, GPIOB_EINK_LE, on);
}
/* Set the state of the OE (source driver Output Enable) pin. */
static inline void setpin_oe(bool_t on) {
static GFXINLINE void setpin_oe(bool_t on) {
palWritePad(GPIOB, GPIOB_EINK_OE, on);
}
/* Set the state of the CL (source driver Clock) pin. */
static inline void setpin_cl(bool_t on) {
static GFXINLINE void setpin_cl(bool_t on) {
palWritePad(GPIOB, GPIOB_EINK_CL, on);
}
/* Set the state of the SPH (source driver Start Pulse Horizontal) pin. */
static inline void setpin_sph(bool_t on) {
static GFXINLINE void setpin_sph(bool_t on) {
palWritePad(GPIOB, GPIOB_EINK_SPH, on);
}
/* Set the state of the D0-D7 (source driver Data) pins. */
static inline void setpins_data(uint8_t value) {
static GFXINLINE void setpins_data(uint8_t value) {
palWriteGroup(GPIOB, 0xFF, GPIOB_EINK_D0, value);
}
/* Set the state of the CKV (gate driver Clock Vertical) pin. */
static inline void setpin_ckv(bool_t on) {
static GFXINLINE void setpin_ckv(bool_t on) {
palWritePad(GPIOB, GPIOB_EINK_CKV, on);
}
/* Set the state of the GMODE (gate driver Gate Mode) pin. */
static inline void setpin_gmode(bool_t on) {
static GFXINLINE void setpin_gmode(bool_t on) {
palWritePad(GPIOC, GPIOC_EINK_GMODE, on);
}
/* Set the state of the SPV (gate driver Start Pulse Vertical) pin. */
static inline void setpin_spv(bool_t on) {
static GFXINLINE void setpin_spv(bool_t on) {
palWritePad(GPIOB, GPIOB_EINK_SPV, on);
}

View File

@ -15,7 +15,7 @@
#define _GDISP_LLD_BOARD_H
/* Set up IO pins for the panel connection. */
static inline void init_board(void) {
static GFXINLINE void init_board(void) {
#error Unimplemented
}
@ -26,57 +26,57 @@ static void eink_delay(int us)
}
/* Turn the E-ink panel Vdd supply (+3.3V) on or off. */
static inline void setpower_vdd(bool_t on) {
static GFXINLINE void setpower_vdd(bool_t on) {
#error Unimplemented
}
/* Turn the E-ink panel negative supplies (-15V, -20V) on or off. */
static inline void setpower_vneg(bool_t on) {
static GFXINLINE void setpower_vneg(bool_t on) {
#error Unimplemented
}
/* Turn the E-ink panel positive supplies (-15V, -20V) on or off. */
static inline void setpower_vpos(bool_t on) {
static GFXINLINE void setpower_vpos(bool_t on) {
#error Unimplemented
}
/* Set the state of the LE (source driver Latch Enable) pin. */
static inline void setpin_le(bool_t on) {
static GFXINLINE void setpin_le(bool_t on) {
#error Unimplemented
}
/* Set the state of the OE (source driver Output Enable) pin. */
static inline void setpin_oe(bool_t on) {
static GFXINLINE void setpin_oe(bool_t on) {
#error Unimplemented
}
/* Set the state of the CL (source driver Clock) pin. */
static inline void setpin_cl(bool_t on) {
static GFXINLINE void setpin_cl(bool_t on) {
#error Unimplemented
}
/* Set the state of the SPH (source driver Start Pulse Horizontal) pin. */
static inline void setpin_sph(bool_t on) {
static GFXINLINE void setpin_sph(bool_t on) {
#error Unimplemented
}
/* Set the state of the D0-D7 (source driver Data) pins. */
static inline void setpins_data(uint8_t value) {
static GFXINLINE void setpins_data(uint8_t value) {
#error Unimplemented
}
/* Set the state of the CKV (gate driver Clock Vertical) pin. */
static inline void setpin_ckv(bool_t on) {
static GFXINLINE void setpin_ckv(bool_t on) {
#error Unimplemented
}
/* Set the state of the GMODE (gate driver Gate Mode) pin. */
static inline void setpin_gmode(bool_t on) {
static GFXINLINE void setpin_gmode(bool_t on) {
#error Unimplemented
}
/* Set the state of the SPV (gate driver Start Pulse Vertical) pin. */
static inline void setpin_spv(bool_t on) {
static GFXINLINE void setpin_spv(bool_t on) {
#error Unimplemented
}

View File

@ -8,51 +8,51 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void busmode16(GDisplay *g) {
static GFXINLINE void busmode16(GDisplay *g) {
(void) g;
}
static inline void busmode8(GDisplay *g) {
static GFXINLINE void busmode8(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint8_t index) {
static GFXINLINE void write_index(GDisplay *g, uint8_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
(void) g;
(void) data;
}
static inline void write_ram16(GDisplay *g, uint16_t data) {
static GFXINLINE void write_ram16(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}

View File

@ -40,7 +40,7 @@
#define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); }
static inline void set_viewport(GDisplay* g) {
static GFXINLINE void set_viewport(GDisplay* g) {
write_reg(g, HX8347D_REG_SCL, g->p.x);
write_reg(g, HX8347D_REG_SCH, g->p.x >> 8);
write_reg(g, HX8347D_REG_ECL, g->p.x + g->p.cx -1);

View File

@ -8,51 +8,51 @@
#ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -8,51 +8,51 @@
#ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -8,51 +8,51 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -8,61 +8,61 @@
#ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g)
static GFXINLINE void init_board(GDisplay *g)
{
(void) g;
}
static inline void post_init_board(GDisplay *g)
static GFXINLINE void post_init_board(GDisplay *g)
{
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state)
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state)
{
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent)
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent)
{
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g)
static GFXINLINE void acquire_bus(GDisplay *g)
{
(void) g;
}
static inline void release_bus(GDisplay *g)
static GFXINLINE void release_bus(GDisplay *g)
{
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index)
static GFXINLINE void write_index(GDisplay *g, uint16_t index)
{
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data)
static GFXINLINE void write_data(GDisplay *g, uint16_t data)
{
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g)
static GFXINLINE void setreadmode(GDisplay *g)
{
(void) g
}
static inline void setwritemode(GDisplay *g)
static GFXINLINE void setwritemode(GDisplay *g)
{
(void) g;
}
static inline uint16_t read_data(GDisplay *g)
static GFXINLINE uint16_t read_data(GDisplay *g)
{
(void) g;

View File

@ -54,7 +54,7 @@
#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; }
#define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); }
static inline uint16_t read_reg(GDisplay *g, uint32_t reg) {
static GFXINLINE uint16_t read_reg(GDisplay *g, uint32_t reg) {
write_index(g, reg);
return read_data(g);
}

View File

@ -8,51 +8,51 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -8,61 +8,61 @@
#ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g)
static GFXINLINE void init_board(GDisplay *g)
{
(void) g;
}
static inline void post_init_board(GDisplay *g)
static GFXINLINE void post_init_board(GDisplay *g)
{
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state)
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state)
{
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent)
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent)
{
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g)
static GFXINLINE void acquire_bus(GDisplay *g)
{
(void) g;
}
static inline void release_bus(GDisplay *g)
static GFXINLINE void release_bus(GDisplay *g)
{
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index)
static GFXINLINE void write_index(GDisplay *g, uint16_t index)
{
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data)
static GFXINLINE void write_data(GDisplay *g, uint16_t data)
{
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g)
static GFXINLINE void setreadmode(GDisplay *g)
{
(void) g;
}
static inline void setwritemode(GDisplay *g)
static GFXINLINE void setwritemode(GDisplay *g)
{
(void) g;
}
static inline uint16_t read_data(GDisplay *g)
static GFXINLINE uint16_t read_data(GDisplay *g)
{
(void) g;
return 0;

View File

@ -20,38 +20,38 @@
//#define GDISP_INITIAL_CONTRAST 50 // The initial contrast percentage
//#define GDISP_INITIAL_BACKLIGHT 100 // The initial backlight percentage
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}

View File

@ -82,7 +82,7 @@
#define write_reg2(g, cmd, d1, d2) { write_index(g, cmd); write_data2(g, d1, d2); }
#define write_reg3(g, cmd, d1, d2, d3) { write_index(g, cmd); write_data3(g, d1, d2, d3); }
static inline void set_viewport(GDisplay* g) {
static GFXINLINE void set_viewport(GDisplay* g) {
write_reg2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x+g->p.cx-1); // Column address set
write_reg2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y+g->p.cy-1); // Page address set
write_index(g, RAMWR);

View File

@ -20,38 +20,38 @@
//#define GDISP_INITIAL_CONTRAST 50 // The initial contrast percentage
//#define GDISP_INITIAL_BACKLIGHT 100 // The initial backlight percentage
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}

View File

@ -129,7 +129,7 @@
#define write_cmd4(g, cmd, d1, d2, d3, d4) { write_index(g, cmd); write_data4(g, d1, d2, d3, d4); }
#if GDISP_HARDWARE_DRAWPIXEL
static inline void set_viewpoint(GDisplay* g) {
static GFXINLINE void set_viewpoint(GDisplay* g) {
#if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL
switch(g->g.Orientation) {
default:
@ -158,7 +158,7 @@
}
#endif
static inline void set_viewport(GDisplay* g) {
static GFXINLINE void set_viewport(GDisplay* g) {
#if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL
switch(g->g.Orientation) {
default:

View File

@ -8,38 +8,38 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
(void) cmd;
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
(void) data;
(void) length;

View File

@ -8,33 +8,33 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
(void) cmd;
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
(void) data;
(void) length;

View File

@ -8,51 +8,51 @@
#ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -8,46 +8,46 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
}

View File

@ -43,13 +43,13 @@
#define write_reg16(g, reg, data) { write_index(g, reg); write_data(g, data); write_index(g, reg+1); write_data(g, (data)>>8); }
#define write_reg8x2(g, reg, d1, d2) { write_index(g, reg); write_data(g, d1); write_data(g, d2); }
static inline void set_cursor(GDisplay *g) {
static GFXINLINE void set_cursor(GDisplay *g) {
write_reg16(g, 0x46, g->p.x);
write_reg16(g, 0x48, g->p.y);
write_index(g, 0x02);
}
static inline void set_viewport(GDisplay* g) {
static GFXINLINE void set_viewport(GDisplay* g) {
write_reg16(g, 0x30, g->p.x); //HSAW0 & HSAW1
write_reg16(g, 0x34, g->p.x+g->p.cx-1); //HEAW0 & HEAW1
write_reg16(g, 0x32, g->p.y); //VSAW0 & VSAW1
@ -58,7 +58,7 @@ static inline void set_viewport(GDisplay* g) {
// On this controller the back-light is controlled by the controllers internal PWM
// which is why it is in this file rather than the board file.
static inline void set_backlight(GDisplay* g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) {
uint8_t temp;
//Work in progress: the RA8875 has a built-in PWM, its output can

View File

@ -8,51 +8,51 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -51,7 +51,7 @@
#define delay(us) gfxSleepMicroseconds(us)
#define delayms(ms) gfxSleepMilliseconds(ms)
static inline void set_cursor(GDisplay *g) {
static GFXINLINE void set_cursor(GDisplay *g) {
/* R20h - 8 bit
* R21h - 9 bit
*/
@ -77,7 +77,7 @@ static inline void set_cursor(GDisplay *g) {
write_index(g, 0x22);
}
static inline void set_viewport(GDisplay *g) {
static GFXINLINE void set_viewport(GDisplay *g) {
/* HSA / HEA are 8 bit
* VSA / VEA are 9 bit
* use masks 0x00FF and 0x01FF to enforce this

View File

@ -8,45 +8,45 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g)
static GFXINLINE void init_board(GDisplay *g)
{
(void) g;
}
static inline void post_init_board(GDisplay *g)
static GFXINLINE void post_init_board(GDisplay *g)
{
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state)
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state)
{
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent)
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent)
{
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g)
static GFXINLINE void acquire_bus(GDisplay *g)
{
(void) g;
}
static inline void release_bus(GDisplay *g)
static GFXINLINE void release_bus(GDisplay *g)
{
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index)
static GFXINLINE void write_index(GDisplay *g, uint16_t index)
{
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data)
static GFXINLINE void write_data(GDisplay *g, uint16_t data)
{
(void) g;
(void) data;

View File

@ -82,7 +82,7 @@
#define write_reg2(g, cmd, d1, d2) { write_index(g, cmd); write_data2(g, d1, d2); }
#define write_reg3(g, cmd, d1, d2, d3) { write_index(g, cmd); write_data3(g, d1, d2, d3); }
static inline void set_viewport(GDisplay* g)
static GFXINLINE void set_viewport(GDisplay* g)
{
write_reg2(g, SPFD54124B_CMD_CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x+g->p.cx-1); // Column address set
write_reg2(g, SPFD54124B_CMD_RASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y+g->p.cy-1); // Page address set

View File

@ -8,51 +8,51 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}
@ -65,13 +65,13 @@ static inline uint16_t read_data(GDisplay *g) {
#if defined(GDISP_USE_DMA) && GDISP_USE_DMA
static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
(void) g;
(void) buffer;
(void) area;
}
static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
(void) g;
(void) buffer;
(void) area;

View File

@ -10,33 +10,33 @@
//#define SSD1306_PAGE_PREFIX 0x40
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
(void) cmd;
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
(void) data;
(void) length;

View File

@ -8,33 +8,33 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_cmd(GDisplay *g, uint8_t index) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
(void) g;
(void) data;
}

View File

@ -8,51 +8,51 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_cmd(GDisplay *g, uint8_t index) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}

View File

@ -22,33 +22,33 @@ static const LCD_Parameters DisplayTimings[] = {
},
};
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}

View File

@ -76,7 +76,7 @@ typedef struct LCD_Parameters {
#define write_data16(g, data) { write_data(g, (data)>>8); write_data(g, (data) & 0xFF); }
#define read_reg(g, reg) { write_index(g, reg); read_data(g); }
static inline void set_viewport(GDisplay* g) {
static GFXINLINE void set_viewport(GDisplay* g) {
switch(g->g.Orientation) {
default:
case GDISP_ROTATE_0:
@ -124,7 +124,7 @@ static inline void set_viewport(GDisplay* g) {
*
* Backlight appears to be forced off (by chip) when display blanked
*/
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
// The SSD1963 has a built-in PWM (duty_cycle 00..FF).
// Its output can be used by a Dynamic Background Control or by a host (user)
// Check your LCD's hardware, the PWM connection is default left open and instead

View File

@ -8,51 +8,51 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_index(GDisplay *g, uint16_t index) {
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static inline void write_data(GDisplay *g, uint16_t data) {
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static inline void setreadmode(GDisplay *g) {
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static inline void setwritemode(GDisplay *g) {
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static inline uint16_t read_data(GDisplay *g) {
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return 0;
}
@ -65,13 +65,13 @@ static inline uint16_t read_data(GDisplay *g) {
#if defined(GDISP_USE_DMA) && GDISP_USE_DMA
static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
(void) g;
(void) buffer;
(void) area;
}
static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
(void) g;
(void) buffer;
(void) area;

View File

@ -17,33 +17,33 @@
* #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3
*/
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
(void) cmd;
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
(void) data;
(void) length;

View File

@ -33,7 +33,7 @@ static const ltdcConfig driverCfg = {
LTDC_UNUSED_LAYER_CONFIG
};
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -45,22 +45,22 @@ static inline void init_board(GDisplay *g) {
}
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
}
static inline void write_index(GDisplay *g, uint8_t index) {
static GFXINLINE void write_index(GDisplay *g, uint8_t index) {
}
static inline void write_data(GDisplay *g, uint8_t data) {
static GFXINLINE void write_data(GDisplay *g, uint8_t data) {
}
#endif /* _GDISP_LLD_BOARD_H */

View File

@ -35,7 +35,7 @@ static const ltdcConfig driverCfg = {
LTDC_UNUSED_LAYER_CONFIG // Foreground layer config
};
static inline void init_board(GDisplay* g) {
static GFXINLINE void init_board(GDisplay* g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
@ -47,12 +47,12 @@ static inline void init_board(GDisplay* g) {
}
}
static inline void post_init_board(GDisplay* g)
static GFXINLINE void post_init_board(GDisplay* g)
{
(void)g;
}
static inline void set_backlight(GDisplay* g, uint8_t percent)
static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent)
{
(void)g;
(void)percent;

View File

@ -8,38 +8,38 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static inline void init_board(GDisplay *g) {
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static inline void post_init_board(GDisplay *g) {
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static inline void setpin_reset(GDisplay *g, bool_t state) {
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static inline void set_backlight(GDisplay *g, uint8_t percent) {
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void) percent;
}
static inline void acquire_bus(GDisplay *g) {
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static inline void release_bus(GDisplay *g) {
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static inline void write_cmd(GDisplay *g, uint8_t cmd) {
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
(void) g;
(void) cmd;
}
static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g;
(void) data;
(void) length;

View File

@ -23,19 +23,19 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
}
static inline bool_t getpin_pressed(GMouse* m) {
static GFXINLINE bool_t getpin_pressed(GMouse* m) {
}
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
}
static inline uint16_t read_value(GMouse* m, uint16_t port) {
static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) {
}

View File

@ -28,10 +28,10 @@
static bool_t init_board(GMouse* m, unsigned driverinstance) {
}
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
}
static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {

View File

@ -24,21 +24,21 @@
*
* Returns TRUE on success, FALSE on failure
*/
static inline bool_t init_board(GMouse* m, unsigned driverinstance) {
static GFXINLINE bool_t init_board(GMouse* m, unsigned driverinstance) {
}
/**
* Acquire the bus
*/
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
}
/**
* Release the bus
*/
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
}
@ -47,7 +47,7 @@ static inline void release_bus(GMouse* m) {
*
* Return the second byte read in case of interest
*/
static inline uint8_t write_command(GMouse* m, uint8_t command, uint8_t value) {
static GFXINLINE uint8_t write_command(GMouse* m, uint8_t command, uint8_t value) {
}
/**
@ -55,14 +55,14 @@ static inline uint8_t write_command(GMouse* m, uint8_t command, uint8_t value) {
*
* Return the byte read in case of interest
*/
static inline uint8_t gfintWriteCommand(GMouse* m, uint8_t command) {
static GFXINLINE uint8_t gfintWriteCommand(GMouse* m, uint8_t command) {
}
/*
* Read 2 bytes as 16-bit value (command to read must have been sent previously)
* Note: Analog value is in bits 15..4, tags (reading status) in bits 3..0
*/
static inline uint16_t read_value(GMouse* m) {
static GFXINLINE uint16_t read_value(GMouse* m) {
}

View File

@ -42,10 +42,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
}
#endif
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
}
static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {

View File

@ -42,10 +42,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
}
#endif
static inline void aquire_bus(GMouse* m) {
static GFXINLINE void aquire_bus(GMouse* m) {
}
static inline void release_bus(GMouse* m) {
static GFXINLINE void release_bus(GMouse* m) {
}
static void write_reg(GMouse* m, uint8_t reg, uint8_t val) {

26
gfx.h
View File

@ -51,21 +51,23 @@
#endif
#endif
/**
* __inline was standardized with C99. previous to that each compiler handles it differently.
*/
#undef INLINE
#ifdef __KEIL__
#define INLINE __inline
#elif __C51__
#define INLINE __inline
#else
#define INLINE inline
#endif
/* gfxconf.h is the user's project configuration for the GFX system. */
#include "gfxconf.h"
/**
* @brief Should various inline ugfx functions be non-inline.
* @details Defaults to FALSE
*/
#if GFX_NO_INLINE
#define GFXINLINE
#else
#if defined(__KEIL__) || defined(__C51__)
#define GFXINLINE __inline
#else
#define GFXINLINE inline
#endif
#endif
/**
* @name GFX sub-systems that can be turned on
* @{

View File

@ -41,6 +41,7 @@
// #define INTERRUPTS_ON() optional_code
// Options that (should where relevant) apply to all operating systems
// #define GFX_NO_INLINE FALSE
// #define GFX_COMPILER GFX_COMPILER_UNKNOWN
// #define GFX_CPU GFX_CPU_UNKNOWN
// #define GFX_OS_HEAP_SIZE 0

View File

@ -69,7 +69,7 @@ GDisplay *GDISP;
/*==========================================================================*/
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
static INLINE void setglobalwindow(GDisplay *g) {
static GFXINLINE void setglobalwindow(GDisplay *g) {
coord_t x, y;
x = g->p.x; y = g->p.y;
g->p.x = g->p.y = 0;
@ -105,7 +105,7 @@ GDisplay *GDISP;
// Parameters: x,y
// Alters: cx, cy (if using streaming)
// Does not clip
static INLINE void drawpixel(GDisplay *g) {
static GFXINLINE void drawpixel(GDisplay *g) {
// Best is hardware accelerated pixel draw
#if GDISP_HARDWARE_DRAWPIXEL
@ -152,7 +152,7 @@ static INLINE void drawpixel(GDisplay *g) {
// Parameters: x,y
// Alters: cx, cy (if using streaming)
#if NEED_CLIPPING
static INLINE void drawpixel_clip(GDisplay *g) {
static GFXINLINE void drawpixel_clip(GDisplay *g) {
#if GDISP_HARDWARE_CLIP == HARDWARE_AUTODETECT
if (!gvmt(g)->setclip)
#endif
@ -171,7 +171,7 @@ static INLINE void drawpixel(GDisplay *g) {
// Alters: nothing
// Note: This is not clipped
// Resets the streaming area if GDISP_HARDWARE_STREAM_WRITE and GDISP_HARDWARE_STREAM_POS is set.
static INLINE void fillarea(GDisplay *g) {
static GFXINLINE void fillarea(GDisplay *g) {
// Best is hardware accelerated area fill
#if GDISP_HARDWARE_FILLS

View File

@ -55,7 +55,7 @@ static GTIMER_DECL(MouseTimer);
#if !GINPUT_TOUCH_NOCALIBRATE
#include <string.h> // Required for memcpy
static INLINE void CalibrationTransform(GMouseReading *pt, const GMouseCalibration *c) {
static GFXINLINE void CalibrationTransform(GMouseReading *pt, const GMouseCalibration *c) {
pt->x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx);
pt->y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy);
}
@ -330,7 +330,7 @@ static void MousePoll(void *param) {
#error "GINPUT: GFX_USE_GDISP must be defined when calibration is required"
#endif
static INLINE void CalibrationCrossDraw(GMouse *m, const point *pp) {
static GFXINLINE void CalibrationCrossDraw(GMouse *m, const point *pp) {
gdispGDrawLine(m->display, pp->x-CALIBRATION_CROSS_RADIUS, pp->y, pp->x-CALIBRATION_CROSS_INNERGAP, pp->y, CALIBRATION_CROSS_COLOR1);
gdispGDrawLine(m->display, pp->x+CALIBRATION_CROSS_INNERGAP, pp->y, pp->x+CALIBRATION_CROSS_RADIUS, pp->y, CALIBRATION_CROSS_COLOR1);
gdispGDrawLine(m->display, pp->x, pp->y-CALIBRATION_CROSS_RADIUS, pp->x, pp->y-CALIBRATION_CROSS_INNERGAP, CALIBRATION_CROSS_COLOR1);
@ -345,11 +345,11 @@ static void MousePoll(void *param) {
gdispGDrawLine(m->display, pp->x+CALIBRATION_CROSS_RADIUS, pp->y-CALIBRATION_CROSS_RADIUS, pp->x+CALIBRATION_CROSS_RADIUS, pp->y-CALIBRATION_CROSS_RADIUS/2, CALIBRATION_CROSS_COLOR2);
}
static INLINE void CalibrationCrossClear(GMouse *m, const point *pp) {
static GFXINLINE void CalibrationCrossClear(GMouse *m, const point *pp) {
gdispGFillArea(m->display, pp->x - CALIBRATION_CROSS_RADIUS, pp->y - CALIBRATION_CROSS_RADIUS, CALIBRATION_CROSS_RADIUS*2+1, CALIBRATION_CROSS_RADIUS*2+1, CALIBRATION_BACKGROUND);
}
static INLINE void CalibrationCalculate(GMouse *m, const point *cross, const point *points) {
static GFXINLINE void CalibrationCalculate(GMouse *m, const point *cross, const point *points) {
float dx;
coord_t c0, c1, c2;
(void) m;

View File

@ -77,7 +77,7 @@
*
* @param[in] reval The value which should be returned
*/
#define THREAD_RETURN(retval);
#define THREAD_RETURN(retval) return retval
/**
* @name Various platform (and operating system) constants
@ -474,10 +474,6 @@
#include "src/gos/gos_ecos.h"
#elif GFX_USE_OS_ARDUINO
#include "src/gos/gos_arduino.h"
#elif GFX_USE_OS_CMSIS
#include "src/gos/gos_cmsis.h"
#elif GFX_USE_OS_KEIL
#include "src/gos/gos_keil.h"
#else
#error "Your operating system is not supported yet"
#endif

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