Replace all inline definitions with GFXINLINE

ugfx_release_2.6
inmarket 2015-10-23 18:24:49 +10:00
parent 17c940423b
commit 48a9d334b7
99 changed files with 728 additions and 712 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);

8