|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
6148
demos/modules/gdisp/gdisp_pictures/fruits1.h
Normal file
BIN
demos/modules/gdisp/gdisp_pictures/fruits1.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
43
demos/modules/gdisp/gdisp_pictures/gfxconf.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/**
|
||||||
|
* This file has a different license to the rest of the GFX system.
|
||||||
|
* You can copy, modify and distribute this file as you see fit.
|
||||||
|
* You do not need to publish your source modifications to this file.
|
||||||
|
* The only thing you are not permitted to do is to relicense it
|
||||||
|
* under a different license.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _GFXCONF_H
|
||||||
|
#define _GFXCONF_H
|
||||||
|
|
||||||
|
/* GFX sub-systems to turn on */
|
||||||
|
#define GFX_USE_GDISP TRUE
|
||||||
|
#define GFX_USE_GWIN FALSE
|
||||||
|
#define GFX_USE_GEVENT FALSE
|
||||||
|
#define GFX_USE_GTIMER FALSE
|
||||||
|
#define GFX_USE_GINPUT FALSE
|
||||||
|
|
||||||
|
/* Features for the GDISP sub-system. */
|
||||||
|
#define GDISP_NEED_VALIDATION TRUE
|
||||||
|
#define GDISP_NEED_CLIP TRUE
|
||||||
|
#define GDISP_NEED_TEXT TRUE
|
||||||
|
#define GDISP_NEED_CIRCLE TRUE
|
||||||
|
#define GDISP_NEED_ELLIPSE FALSE
|
||||||
|
#define GDISP_NEED_ARC FALSE
|
||||||
|
#define GDISP_NEED_SCROLL FALSE
|
||||||
|
#define GDISP_NEED_PIXELREAD FALSE
|
||||||
|
#define GDISP_NEED_CONTROL TRUE
|
||||||
|
#define GDISP_NEED_MULTITHREAD TRUE
|
||||||
|
#define GDISP_NEED_ASYNC FALSE
|
||||||
|
#define GDISP_NEED_MSGAPI FALSE
|
||||||
|
|
||||||
|
/* Builtin Fonts */
|
||||||
|
#define GDISP_INCLUDE_FONT_SMALL FALSE
|
||||||
|
#define GDISP_INCLUDE_FONT_LARGER FALSE
|
||||||
|
#define GDISP_INCLUDE_FONT_UI1 FALSE
|
||||||
|
#define GDISP_INCLUDE_FONT_UI2 TRUE
|
||||||
|
#define GDISP_INCLUDE_FONT_LARGENUMBERS TRUE
|
||||||
|
|
||||||
|
/* Features for the GINPUT sub-system. */
|
||||||
|
#define GINPUT_NEED_MOUSE FALSE
|
||||||
|
|
||||||
|
#endif /* _GFXCONF_H */
|
26
demos/modules/gdisp/gdisp_pictures/main.c
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#include "ch.h"
|
||||||
|
#include "hal.h"
|
||||||
|
#include "gfx.h"
|
||||||
|
#include "matterhorn1.h"
|
||||||
|
#include "matterhorn2.h"
|
||||||
|
#include "fruits1.h"
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
halInit();
|
||||||
|
chSysInit();
|
||||||
|
|
||||||
|
gdispInit();
|
||||||
|
gdispSetOrientation(GDISP_ROTATE_90);
|
||||||
|
|
||||||
|
while(1) {
|
||||||
|
gdispBlitArea(0, 0, fruits1.width, fruits1.height, (const pixel_t*)fruits1.pixel_data);
|
||||||
|
chThdSleepMilliseconds(3000);
|
||||||
|
|
||||||
|
gdispBlitArea(0, 0, matterhorn1.width, matterhorn1.height, (const pixel_t*)matterhorn1.pixel_data);
|
||||||
|
chThdSleepMilliseconds(3000);
|
||||||
|
|
||||||
|
gdispBlitArea(0, 0, matterhorn2.width, matterhorn2.height, (const pixel_t*)matterhorn2.pixel_data);
|
||||||
|
chThdSleepMilliseconds(3000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
BIN
demos/modules/gdisp/gdisp_pictures/matterhorn.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
6465
demos/modules/gdisp/gdisp_pictures/matterhorn1.h
Normal file
5773
demos/modules/gdisp/gdisp_pictures/matterhorn2.h
Normal file
BIN
demos/modules/gdisp/gdisp_pictures/matterhorn2.jpg
Normal file
After Width: | Height: | Size: 35 KiB |
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -76,30 +76,30 @@ uint32_t DISPLAY_CODE;
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local functions. */
|
/* Driver local functions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
static __inline void lld_lcdDelay(uint16_t us) {
|
static inline void lld_lcdDelay(uint16_t us) {
|
||||||
chThdSleepMicroseconds(us);
|
chThdSleepMicroseconds(us);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteIndex(uint16_t index) {
|
static inline void lld_lcdWriteIndex(uint16_t index) {
|
||||||
gdisp_lld_write_index(index);
|
gdisp_lld_write_index(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteData(uint16_t data) {
|
static inline void lld_lcdWriteData(uint16_t data) {
|
||||||
gdisp_lld_write_data(data);
|
gdisp_lld_write_data(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
|
static inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
|
||||||
gdisp_lld_write_index(lcdReg);
|
gdisp_lld_write_index(lcdReg);
|
||||||
gdisp_lld_write_data(lcdRegValue);
|
gdisp_lld_write_data(lcdRegValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline uint16_t lld_lcdReadData(void) {
|
static inline uint16_t lld_lcdReadData(void) {
|
||||||
/* fix this! */
|
/* fix this! */
|
||||||
//return gdisp_lld_read_data;
|
//return gdisp_lld_read_data;
|
||||||
return GDISP_RAM;
|
return GDISP_RAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
|
static inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
|
||||||
volatile uint16_t dummy;
|
volatile uint16_t dummy;
|
||||||
|
|
||||||
gdisp_lld_write_index(lcdReg);
|
gdisp_lld_write_index(lcdReg);
|
||||||
|
@ -109,30 +109,30 @@ static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
|
||||||
return lld_lcdReadData();
|
return lld_lcdReadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteStreamStart(void) {
|
static inline void lld_lcdWriteStreamStart(void) {
|
||||||
lld_lcdWriteIndex(0x0022);
|
lld_lcdWriteIndex(0x0022);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteStreamStop(void) {
|
static inline void lld_lcdWriteStreamStop(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
|
static inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
|
|
||||||
for(i = 0; i < size; i++)
|
for(i = 0; i < size; i++)
|
||||||
lld_lcdWriteData(buffer[i]);
|
lld_lcdWriteData(buffer[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdReadStreamStart(void) {
|
static inline void lld_lcdReadStreamStart(void) {
|
||||||
lld_lcdWriteIndex(0x0022);
|
lld_lcdWriteIndex(0x0022);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdReadStreamStop(void) {
|
static inline void lld_lcdReadStreamStop(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
|
static inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
volatile uint16_t dummy;
|
volatile uint16_t dummy;
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy)
|
||||||
lld_lcdSetCursor(x, y);
|
lld_lcdSetCursor(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdResetViewPort(void) {
|
static inline void lld_lcdResetViewPort(void) {
|
||||||
switch(GDISP.Orientation) {
|
switch(GDISP.Orientation) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -29,28 +29,28 @@
|
||||||
#ifndef GDISP_LLD_BOARD_H
|
#ifndef GDISP_LLD_BOARD_H
|
||||||
#define GDISP_LLD_BOARD_H
|
#define GDISP_LLD_BOARD_H
|
||||||
|
|
||||||
static __inline void gdisp_lld_init_board(void) {
|
static inline void gdisp_lld_init_board(void) {
|
||||||
#error "ILI9320: You must implement the init_board routine for your board"
|
#error "ILI9320: You must implement the init_board routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_reset_pin(bool_t state) {
|
static inline void gdisp_lld_reset_pin(bool_t state) {
|
||||||
#error "ILI9320: You must implement setpin_reset routine for your board"
|
#error "ILI9320: You must implement setpin_reset routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_write_index(uint16_t data) {
|
static inline void gdisp_lld_write_index(uint16_t data) {
|
||||||
#error "ILI9320: You must implement write_index routine for your board"
|
#error "ILI9320: You must implement write_index routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_write_data(uint16_t data) {
|
static inline void gdisp_lld_write_data(uint16_t data) {
|
||||||
#error "ILI9320: You must implement write_data routine for your board"
|
#error "ILI9320: You must implement write_data routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline uint16_t gdisp_lld_read_data(void) {
|
static inline uint16_t gdisp_lld_read_data(void) {
|
||||||
#error "ILI9320: You must implement read_data routine for your board"
|
#error "ILI9320: You must implement read_data routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if not available, just ignore the argument and return */
|
/* if not available, just ignore the argument and return */
|
||||||
static __inline uint16_t gdisp_lld_backlight(uint8_t percentage) {
|
static inline uint16_t gdisp_lld_backlight(uint8_t percentage) {
|
||||||
#error "ILI9320: You must implement set_backlight routine for your board"
|
#error "ILI9320: You must implement set_backlight routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
|
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
|
||||||
#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */
|
#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */
|
||||||
|
|
||||||
static __inline void gdisp_lld_init_board(void) {
|
static inline void gdisp_lld_init_board(void) {
|
||||||
/* FSMC setup for F1 */
|
/* FSMC setup for F1 */
|
||||||
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
|
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
|
||||||
|
|
||||||
|
@ -54,26 +54,26 @@ static __inline void gdisp_lld_init_board(void) {
|
||||||
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
|
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_reset_pin(bool_t state) {
|
static inline void gdisp_lld_reset_pin(bool_t state) {
|
||||||
if(state)
|
if(state)
|
||||||
palClearPad(GPIOE, GPIOE_TFT_RST);
|
palClearPad(GPIOE, GPIOE_TFT_RST);
|
||||||
else
|
else
|
||||||
palSetPad(GPIOE, GPIOE_TFT_RST);
|
palSetPad(GPIOE, GPIOE_TFT_RST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_write_index(uint16_t reg) {
|
static inline void gdisp_lld_write_index(uint16_t reg) {
|
||||||
GDISP_REG = reg;
|
GDISP_REG = reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_write_data(uint16_t data) {
|
static inline void gdisp_lld_write_data(uint16_t data) {
|
||||||
GDISP_RAM = data;
|
GDISP_RAM = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline uint16_t gdisp_lld_read_data(void) {
|
static inline uint16_t gdisp_lld_read_data(void) {
|
||||||
return GDISP_RAM;
|
return GDISP_RAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_backlight(uint8_t percent) {
|
static inline void gdisp_lld_backlight(uint8_t percent) {
|
||||||
if(percent == 100)
|
if(percent == 100)
|
||||||
palClearPad(GPIOD, GPIOD_TFT_LIGHT);
|
palClearPad(GPIOD, GPIOD_TFT_LIGHT);
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -76,30 +76,30 @@ uint32_t DISPLAY_CODE;
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local functions. */
|
/* Driver local functions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
static __inline void lld_lcdDelay(uint16_t us) {
|
static inline void lld_lcdDelay(uint16_t us) {
|
||||||
chThdSleepMicroseconds(us);
|
chThdSleepMicroseconds(us);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteIndex(uint16_t index) {
|
static inline void lld_lcdWriteIndex(uint16_t index) {
|
||||||
gdisp_lld_write_index(index);
|
gdisp_lld_write_index(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteData(uint16_t data) {
|
static inline void lld_lcdWriteData(uint16_t data) {
|
||||||
gdisp_lld_write_data(data);
|
gdisp_lld_write_data(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
|
static inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
|
||||||
gdisp_lld_write_index(lcdReg);
|
gdisp_lld_write_index(lcdReg);
|
||||||
gdisp_lld_write_data(lcdRegValue);
|
gdisp_lld_write_data(lcdRegValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline uint16_t lld_lcdReadData(void) {
|
static inline uint16_t lld_lcdReadData(void) {
|
||||||
/* fix this! */
|
/* fix this! */
|
||||||
//return gdisp_lld_read_data;
|
//return gdisp_lld_read_data;
|
||||||
return GDISP_RAM;
|
return GDISP_RAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
|
static inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
|
||||||
volatile uint16_t dummy;
|
volatile uint16_t dummy;
|
||||||
|
|
||||||
gdisp_lld_write_index(lcdReg);
|
gdisp_lld_write_index(lcdReg);
|
||||||
|
@ -109,30 +109,30 @@ static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
|
||||||
return lld_lcdReadData();
|
return lld_lcdReadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteStreamStart(void) {
|
static inline void lld_lcdWriteStreamStart(void) {
|
||||||
lld_lcdWriteIndex(0x0022);
|
lld_lcdWriteIndex(0x0022);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteStreamStop(void) {
|
static inline void lld_lcdWriteStreamStop(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
|
static inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
|
|
||||||
for(i = 0; i < size; i++)
|
for(i = 0; i < size; i++)
|
||||||
lld_lcdWriteData(buffer[i]);
|
lld_lcdWriteData(buffer[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdReadStreamStart(void) {
|
static inline void lld_lcdReadStreamStart(void) {
|
||||||
lld_lcdWriteIndex(0x0022);
|
lld_lcdWriteIndex(0x0022);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdReadStreamStop(void) {
|
static inline void lld_lcdReadStreamStop(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
|
static inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
volatile uint16_t dummy;
|
volatile uint16_t dummy;
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy)
|
||||||
lld_lcdSetCursor(x, y);
|
lld_lcdSetCursor(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void lld_lcdResetViewPort(void) {
|
static inline void lld_lcdResetViewPort(void) {
|
||||||
switch(GDISP.Orientation) {
|
switch(GDISP.Orientation) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -29,28 +29,28 @@
|
||||||
#ifndef GDISP_LLD_BOARD_H
|
#ifndef GDISP_LLD_BOARD_H
|
||||||
#define GDISP_LLD_BOARD_H
|
#define GDISP_LLD_BOARD_H
|
||||||
|
|
||||||
static __inline void gdisp_lld_init_board(void) {
|
static inline void gdisp_lld_init_board(void) {
|
||||||
#error "ILI9325: You must implement the init_board routine for your board"
|
#error "ILI9325: You must implement the init_board routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_reset_pin(bool_t state) {
|
static inline void gdisp_lld_reset_pin(bool_t state) {
|
||||||
#error "ILI9325: You must implement setpin_reset routine for your board"
|
#error "ILI9325: You must implement setpin_reset routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_write_index(uint16_t data) {
|
static inline void gdisp_lld_write_index(uint16_t data) {
|
||||||
#error "ILI9325: You must implement write_index routine for your board"
|
#error "ILI9325: You must implement write_index routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_write_data(uint16_t data) {
|
static inline void gdisp_lld_write_data(uint16_t data) {
|
||||||
#error "ILI9325: You must implement write_data routine for your board"
|
#error "ILI9325: You must implement write_data routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline uint16_t gdisp_lld_read_data(void) {
|
static inline uint16_t gdisp_lld_read_data(void) {
|
||||||
#error "ILI9325: You must implement read_data routine for your board"
|
#error "ILI9325: You must implement read_data routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if not available, just ignore the argument and return */
|
/* if not available, just ignore the argument and return */
|
||||||
static __inline uint16_t gdisp_lld_backlight(uint8_t percentage) {
|
static inline uint16_t gdisp_lld_backlight(uint8_t percentage) {
|
||||||
#error "ILI9325: You must implement set_backlight routine for your board"
|
#error "ILI9325: You must implement set_backlight routine for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
|
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
|
||||||
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
|
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
|
||||||
|
|
||||||
static __inline void gdisp_lld_init_board(void) {
|
static inline void gdisp_lld_init_board(void) {
|
||||||
/* FSMC setup for F1 */
|
/* FSMC setup for F1 */
|
||||||
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
|
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
|
||||||
|
|
||||||
|
@ -68,26 +68,26 @@ static __inline void gdisp_lld_init_board(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_reset_pin(bool_t state) {
|
static inline void gdisp_lld_reset_pin(bool_t state) {
|
||||||
if(state)
|
if(state)
|
||||||
palClearPad(GPIOE, GPIOE_TFT_RST);
|
palClearPad(GPIOE, GPIOE_TFT_RST);
|
||||||
else
|
else
|
||||||
palSetPad(GPIOE, GPIOE_TFT_RST);
|
palSetPad(GPIOE, GPIOE_TFT_RST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_write_index(uint16_t reg) {
|
static inline void gdisp_lld_write_index(uint16_t reg) {
|
||||||
GDISP_REG = reg;
|
GDISP_REG = reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_write_data(uint16_t data) {
|
static inline void gdisp_lld_write_data(uint16_t data) {
|
||||||
GDISP_RAM = data;
|
GDISP_RAM = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline uint16_t gdisp_lld_read_data(void) {
|
static inline uint16_t gdisp_lld_read_data(void) {
|
||||||
return GDISP_RAM;
|
return GDISP_RAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void gdisp_lld_backlight(uint8_t percent) {
|
static inline void gdisp_lld_backlight(uint8_t percent) {
|
||||||
percent=percent; // avoid a warning
|
percent=percent; // avoid a warning
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
|
|
||||||
// A very common thing to do.
|
// A very common thing to do.
|
||||||
// An inline function has been used here incase the parameters have side effects with the internal calculations.
|
// An inline function has been used here incase the parameters have side effects with the internal calculations.
|
||||||
static __inline void setviewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
static inline void setviewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
write_cmd2(CASET, x, x+cx-1); // Column address set
|
write_cmd2(CASET, x, x+cx-1); // Column address set
|
||||||
write_cmd2(PASET, y, y+cy-1); // Page address set
|
write_cmd2(PASET, y, y+cy-1); // Page address set
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE12: You must supply a definition for init_board for your board"
|
#error "gdispNokia6610GE12: You must supply a definition for init_board for your board"
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE12: You must supply a definition for setpin_reset for your board"
|
#error "gdispNokia6610GE12: You must supply a definition for setpin_reset for your board"
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE12: You must supply a definition for set_backlight for your board"
|
#error "gdispNokia6610GE12: You must supply a definition for set_backlight for your board"
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE12: You must supply a definition for acquire_bus for your board"
|
#error "gdispNokia6610GE12: You must supply a definition for acquire_bus for your board"
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE12: You must supply a definition for release_bus for your board"
|
#error "gdispNokia6610GE12: You must supply a definition for release_bus for your board"
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_cmd(uint16_t cmd) {
|
static inline void write_cmd(uint16_t cmd) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE12: You must supply a definition for write_cmd for your board"
|
#error "gdispNokia6610GE12: You must supply a definition for write_cmd for your board"
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ static __inline void write_cmd(uint16_t cmd) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE12: You must supply a definition for write_data for your board"
|
#error "gdispNokia6610GE12: You must supply a definition for write_data for your board"
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ static __inline void write_data(uint16_t data) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE12: You must supply a definition for read_data for your board"
|
#error "gdispNokia6610GE12: You must supply a definition for read_data for your board"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -48,7 +48,7 @@ volatile AT91PS_PDC pPDC = AT91C_BASE_PDC_SPI0;
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
// *********************************************************************************************
|
// *********************************************************************************************
|
||||||
// InitSpi( )
|
// InitSpi( )
|
||||||
//
|
//
|
||||||
|
@ -108,7 +108,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
if (state)
|
if (state)
|
||||||
palClearPad(IOPORT1, PIOA_LCD_RESET);
|
palClearPad(IOPORT1, PIOA_LCD_RESET);
|
||||||
else
|
else
|
||||||
|
@ -125,7 +125,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
if (percent)
|
if (percent)
|
||||||
palSetPad(IOPORT2, PIOB_LCD_BL);
|
palSetPad(IOPORT2, PIOB_LCD_BL);
|
||||||
else
|
else
|
||||||
|
@ -137,7 +137,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
/* Nothing to do for this board as the LCD is the only device on the SPI port */
|
/* Nothing to do for this board as the LCD is the only device on the SPI port */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
// Nothing to do for this board as the LCD is the only device on the SPI port
|
// Nothing to do for this board as the LCD is the only device on the SPI port
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_cmd(uint16_t cmd) {
|
static inline void write_cmd(uint16_t cmd) {
|
||||||
// wait for the previous transfer to complete
|
// wait for the previous transfer to complete
|
||||||
while((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
|
while((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
|
||||||
// send the command
|
// send the command
|
||||||
|
@ -171,7 +171,7 @@ static __inline void write_cmd(uint16_t cmd) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
// wait for the previous transfer to complete
|
// wait for the previous transfer to complete
|
||||||
while((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
|
while((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
|
||||||
// send the data
|
// send the data
|
||||||
|
@ -186,7 +186,7 @@ static __inline void write_data(uint16_t data) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
#error "gdispNokia6610GE12: GDISP_HARDWARE_READPIXEL and GDISP_HARDWARE_SCROLL are not supported on this board"
|
#error "gdispNokia6610GE12: GDISP_HARDWARE_READPIXEL and GDISP_HARDWARE_SCROLL are not supported on this board"
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
|
|
||||||
// A very common thing to do.
|
// A very common thing to do.
|
||||||
// An inline function has been used here incase the parameters have side effects with the internal calculations.
|
// An inline function has been used here incase the parameters have side effects with the internal calculations.
|
||||||
static __inline void setviewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
static inline void setviewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
write_cmd2(CASET, x, x+cx-1); // Column address set
|
write_cmd2(CASET, x, x+cx-1); // Column address set
|
||||||
write_cmd2(PASET, y, y+cy-1); // Page address set
|
write_cmd2(PASET, y, y+cy-1); // Page address set
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE8: You must supply a definition for init_board for your board"
|
#error "gdispNokia6610GE8: You must supply a definition for init_board for your board"
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE8: You must supply a definition for setpin_reset for your board"
|
#error "gdispNokia6610GE8: You must supply a definition for setpin_reset for your board"
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE8: You must supply a definition for set_backlight for your board"
|
#error "gdispNokia6610GE8: You must supply a definition for set_backlight for your board"
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE8: You must supply a definition for acquire_bus for your board"
|
#error "gdispNokia6610GE8: You must supply a definition for acquire_bus for your board"
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE8: You must supply a definition for release_bus for your board"
|
#error "gdispNokia6610GE8: You must supply a definition for release_bus for your board"
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_cmd(uint16_t cmd) {
|
static inline void write_cmd(uint16_t cmd) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE8: You must supply a definition for write_cmd for your board"
|
#error "gdispNokia6610GE8: You must supply a definition for write_cmd for your board"
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ static __inline void write_cmd(uint16_t cmd) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE8: You must supply a definition for write_data for your board"
|
#error "gdispNokia6610GE8: You must supply a definition for write_data for your board"
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ static __inline void write_data(uint16_t data) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "gdispNokia6610GE8: You must supply a definition for read_data for your board"
|
#error "gdispNokia6610GE8: You must supply a definition for read_data for your board"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -68,7 +68,7 @@ static bool_t pwmRunning = FALSE;
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
// *********************************************************************************************
|
// *********************************************************************************************
|
||||||
// InitSpi( )
|
// InitSpi( )
|
||||||
//
|
//
|
||||||
|
@ -132,7 +132,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
if (state)
|
if (state)
|
||||||
palClearPad(IOPORT1, PIOA_LCD_RESET);
|
palClearPad(IOPORT1, PIOA_LCD_RESET);
|
||||||
else
|
else
|
||||||
|
@ -149,7 +149,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
if (percent == 100) {
|
if (percent == 100) {
|
||||||
/* Turn the pin on - No PWM */
|
/* Turn the pin on - No PWM */
|
||||||
if (pwmRunning) {
|
if (pwmRunning) {
|
||||||
|
@ -179,7 +179,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
/* Nothing to do for this board as the LCD is the only device on the SPI port */
|
/* Nothing to do for this board as the LCD is the only device on the SPI port */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
// Nothing to do for this board as the LCD is the only device on the SPI port
|
// Nothing to do for this board as the LCD is the only device on the SPI port
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_cmd(uint16_t cmd) {
|
static inline void write_cmd(uint16_t cmd) {
|
||||||
// wait for the previous transfer to complete
|
// wait for the previous transfer to complete
|
||||||
while((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
|
while((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
|
||||||
// send the command
|
// send the command
|
||||||
|
@ -213,7 +213,7 @@ static __inline void write_cmd(uint16_t cmd) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
// wait for the previous transfer to complete
|
// wait for the previous transfer to complete
|
||||||
while((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
|
while((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
|
||||||
// send the data
|
// send the data
|
||||||
|
@ -228,7 +228,7 @@ static __inline void write_data(uint16_t data) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
#error "gdispNokia6610GE8: GDISP_HARDWARE_READPIXEL and GDISP_HARDWARE_SCROLL are not supported on this board"
|
#error "gdispNokia6610GE8: GDISP_HARDWARE_READPIXEL and GDISP_HARDWARE_SCROLL are not supported on this board"
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
#define delay(us) chThdSleepMicroseconds(us)
|
#define delay(us) chThdSleepMicroseconds(us)
|
||||||
#define delayms(ms) chThdSleepMilliseconds(ms)
|
#define delayms(ms) chThdSleepMilliseconds(ms)
|
||||||
|
|
||||||
static __inline void set_cursor(coord_t x, coord_t y) {
|
static inline void set_cursor(coord_t x, coord_t y) {
|
||||||
/* R20h - 8 bit
|
/* R20h - 8 bit
|
||||||
* R21h - 9 bit
|
* R21h - 9 bit
|
||||||
*/
|
*/
|
||||||
|
@ -99,7 +99,7 @@ static __inline void set_cursor(coord_t x, coord_t y) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void set_viewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
static inline void set_viewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
/* HSA / HEA are 8 bit
|
/* HSA / HEA are 8 bit
|
||||||
* VSA / VEA are 9 bit
|
* VSA / VEA are 9 bit
|
||||||
* use masks 0x00FF and 0x01FF to enforce this
|
* use masks 0x00FF and 0x01FF to enforce this
|
||||||
|
@ -137,7 +137,7 @@ static __inline void set_viewport(coord_t x, coord_t y, coord_t cx, coord_t cy)
|
||||||
set_cursor(x, y);
|
set_cursor(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void reset_viewport(void) {
|
static inline void reset_viewport(void) {
|
||||||
switch(GDISP.Orientation) {
|
switch(GDISP.Orientation) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for init_board for your board"
|
#error "SSD1289: You must supply a definition for init_board for your board"
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for setpin_reset for your board"
|
#error "SSD1289: You must supply a definition for setpin_reset for your board"
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for set_backlight for your board"
|
#error "SSD1289: You must supply a definition for set_backlight for your board"
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
#error "SSD1289: You must supply a definition for acquire_bus for your board"
|
#error "SSD1289: You must supply a definition for acquire_bus for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
#error "SSD1289: You must supply a definition for release_bus for your board"
|
#error "SSD1289: You must supply a definition for release_bus for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_index(uint16_t index) {
|
static inline void write_index(uint16_t index) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for write_index for your board"
|
#error "SSD1289: You must supply a definition for write_index for your board"
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ static __inline void write_index(uint16_t index) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for write_data for your board"
|
#error "SSD1289: You must supply a definition for write_data for your board"
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ static __inline void write_data(uint16_t data) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for read_data for your board"
|
#error "SSD1289: You must supply a definition for read_data for your board"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
|
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
|
||||||
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
|
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
|
||||||
|
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
int FSMC_Bank = 0;
|
int FSMC_Bank = 0;
|
||||||
|
|
||||||
/* STM32F4 FSMC init */
|
/* STM32F4 FSMC init */
|
||||||
|
@ -55,36 +55,36 @@ static __inline void init_board(void) {
|
||||||
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
|
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
(void)state;
|
(void)state;
|
||||||
|
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
(void)percent;
|
(void)percent;
|
||||||
|
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void write_index(uint16_t index) {
|
static inline void write_index(uint16_t index) {
|
||||||
GDISP_REG = index;
|
GDISP_REG = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
GDISP_RAM = data;
|
GDISP_RAM = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GDISP_HARDWARE_READPIXEL || GDISP_HARDWARE_SCROLL || defined(__DOXYGEN__)
|
#if GDISP_HARDWARE_READPIXEL || GDISP_HARDWARE_SCROLL || defined(__DOXYGEN__)
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
return GDISP_RAM;
|
return GDISP_RAM;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
#define delay(us) chThdSleepMicroseconds(us)
|
#define delay(us) chThdSleepMicroseconds(us)
|
||||||
#define delayms(ms) chThdSleepMilliseconds(ms)
|
#define delayms(ms) chThdSleepMilliseconds(ms)
|
||||||
|
|
||||||
static __inline void set_cursor(coord_t x, coord_t y) {
|
static inline void set_cursor(coord_t x, coord_t y) {
|
||||||
/* Reg 0x004E is an 8 bit value
|
/* Reg 0x004E is an 8 bit value
|
||||||
* Reg 0x004F is 9 bit
|
* Reg 0x004F is 9 bit
|
||||||
* Use a bit mask to make sure they are not set too high
|
* Use a bit mask to make sure they are not set too high
|
||||||
|
@ -134,7 +134,7 @@ static void set_viewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
set_cursor(x, y);
|
set_cursor(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void reset_viewport(void) {
|
static inline void reset_viewport(void) {
|
||||||
set_viewport(0, 0, GDISP.Width, GDISP.Height);
|
set_viewport(0, 0, GDISP.Width, GDISP.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for init_board for your board"
|
#error "SSD1289: You must supply a definition for init_board for your board"
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for setpin_reset for your board"
|
#error "SSD1289: You must supply a definition for setpin_reset for your board"
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for set_backlight for your board"
|
#error "SSD1289: You must supply a definition for set_backlight for your board"
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
#error "SSD1289: You must supply a definition for acquire_bus for your board"
|
#error "SSD1289: You must supply a definition for acquire_bus for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
#error "SSD1289: You must supply a definition for release_bus for your board"
|
#error "SSD1289: You must supply a definition for release_bus for your board"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_index(uint16_t index) {
|
static inline void write_index(uint16_t index) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for write_index for your board"
|
#error "SSD1289: You must supply a definition for write_index for your board"
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ static __inline void write_index(uint16_t index) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for write_data for your board"
|
#error "SSD1289: You must supply a definition for write_data for your board"
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ static __inline void write_data(uint16_t data) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "SSD1289: You must supply a definition for read_data for your board"
|
#error "SSD1289: You must supply a definition for read_data for your board"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
const unsigned char FSMC_Bank;
|
const unsigned char FSMC_Bank;
|
||||||
|
|
||||||
#if defined(STM32F1XX) || defined(STM32F3XX)
|
#if defined(STM32F1XX) || defined(STM32F3XX)
|
||||||
|
@ -94,7 +94,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
(void) state;
|
(void) state;
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
(void) percent;
|
(void) percent;
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_index(uint16_t index) { GDISP_REG = index; }
|
static inline void write_index(uint16_t index) { GDISP_REG = index; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Send data to the lcd.
|
* @brief Send data to the lcd.
|
||||||
|
@ -145,7 +145,7 @@ static __inline void write_index(uint16_t index) { GDISP_REG = index; }
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) { GDISP_RAM = data; }
|
static inline void write_data(uint16_t data) { GDISP_RAM = data; }
|
||||||
|
|
||||||
#if GDISP_HARDWARE_READPIXEL || GDISP_HARDWARE_SCROLL || defined(__DOXYGEN__)
|
#if GDISP_HARDWARE_READPIXEL || GDISP_HARDWARE_SCROLL || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
|
@ -157,7 +157,7 @@ static __inline void write_data(uint16_t data) { GDISP_RAM = data; }
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) { return GDISP_RAM; }
|
static inline uint16_t read_data(void) { return GDISP_RAM; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _GDISP_LLD_BOARD_H */
|
#endif /* _GDISP_LLD_BOARD_H */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
palSetPadMode(GPIOD, 12, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetPadMode(GPIOD, 12, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
palSetPadMode(GPIOD, 13, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetPadMode(GPIOD, 13, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
|
@ -66,7 +66,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
(void) state;
|
(void) state;
|
||||||
/* Nothing to do here - reset pin tied to Vcc */
|
/* Nothing to do here - reset pin tied to Vcc */
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
(void) percent;
|
(void) percent;
|
||||||
/* Nothing to do here - Backlight always on */
|
/* Nothing to do here - Backlight always on */
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
/* Nothing to do here since LCD is the only device on that bus */
|
/* Nothing to do here since LCD is the only device on that bus */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
/* Nothing to do here since LCD is the only device on that bus */
|
/* Nothing to do here since LCD is the only device on that bus */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_index(uint16_t index) {
|
static inline void write_index(uint16_t index) {
|
||||||
palWritePort(GPIOE, index);
|
palWritePort(GPIOE, index);
|
||||||
CLR_RS; CLR_WR; SET_WR; SET_RS;
|
CLR_RS; CLR_WR; SET_WR; SET_RS;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ static __inline void write_index(uint16_t index) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
palWritePort(GPIOE, data);
|
palWritePort(GPIOE, data);
|
||||||
CLR_WR; SET_WR;
|
CLR_WR; SET_WR;
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ static __inline void write_data(uint16_t data) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
uint16_t value;
|
uint16_t value;
|
||||||
|
|
||||||
// change pin mode to digital input
|
// change pin mode to digital input
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -64,43 +64,43 @@
|
||||||
|
|
||||||
|
|
||||||
#if defined(GDISP_USE_FSMC)
|
#if defined(GDISP_USE_FSMC)
|
||||||
__inline void GDISP_LLD(writeindex)(uint8_t cmd) {
|
inline void GDISP_LLD(writeindex)(uint8_t cmd) {
|
||||||
GDISP_REG = cmd;
|
GDISP_REG = cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(writereg)(uint16_t lcdReg,uint16_t lcdRegValue) {
|
inline void GDISP_LLD(writereg)(uint16_t lcdReg,uint16_t lcdRegValue) {
|
||||||
GDISP_REG = lcdReg;
|
GDISP_REG = lcdReg;
|
||||||
GDISP_RAM = lcdRegValue;
|
GDISP_RAM = lcdRegValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(writedata)(uint16_t data) {
|
inline void GDISP_LLD(writedata)(uint16_t data) {
|
||||||
GDISP_RAM = data;
|
GDISP_RAM = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline uint16_t GDISP_LLD(readdata)(void) {
|
inline uint16_t GDISP_LLD(readdata)(void) {
|
||||||
return (GDISP_RAM);
|
return (GDISP_RAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline uint8_t GDISP_LLD(readreg)(uint8_t lcdReg) {
|
inline uint8_t GDISP_LLD(readreg)(uint8_t lcdReg) {
|
||||||
GDISP_REG = lcdReg;
|
GDISP_REG = lcdReg;
|
||||||
return (GDISP_RAM);
|
return (GDISP_RAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(writestreamstart)(void) {
|
inline void GDISP_LLD(writestreamstart)(void) {
|
||||||
GDISP_LLD(writeindex)(SSD1963_WRITE_MEMORY_START);
|
GDISP_LLD(writeindex)(SSD1963_WRITE_MEMORY_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(readstreamstart)(void) {
|
inline void GDISP_LLD(readstreamstart)(void) {
|
||||||
GDISP_LLD(writeindex)(SSD1963_READ_MEMORY_START);
|
GDISP_LLD(writeindex)(SSD1963_READ_MEMORY_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(writestream)(uint16_t *buffer, uint16_t size) {
|
inline void GDISP_LLD(writestream)(uint16_t *buffer, uint16_t size) {
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
for(i = 0; i < size; i++)
|
for(i = 0; i < size; i++)
|
||||||
GDISP_RAM = buffer[i];
|
GDISP_RAM = buffer[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(readstream)(uint16_t *buffer, size_t size) {
|
inline void GDISP_LLD(readstream)(uint16_t *buffer, size_t size) {
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
|
|
||||||
for(i = 0; i < size; i++) {
|
for(i = 0; i < size; i++) {
|
||||||
|
@ -110,33 +110,33 @@ __inline void GDISP_LLD(readstream)(uint16_t *buffer, size_t size) {
|
||||||
|
|
||||||
#elif defined(GDISP_USE_GPIO)
|
#elif defined(GDISP_USE_GPIO)
|
||||||
|
|
||||||
__inline void GDISP_LLD(writeindex)(uint8_t cmd) {
|
inline void GDISP_LLD(writeindex)(uint8_t cmd) {
|
||||||
Set_CS; Set_RS; Set_WR; Clr_RD;
|
Set_CS; Set_RS; Set_WR; Clr_RD;
|
||||||
palWritePort(GDISP_DATA_PORT, cmd);
|
palWritePort(GDISP_DATA_PORT, cmd);
|
||||||
Clr_CS;
|
Clr_CS;
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(writereg)(uint16_t lcdReg,uint16_t lcdRegValue) {
|
inline void GDISP_LLD(writereg)(uint16_t lcdReg,uint16_t lcdRegValue) {
|
||||||
Set_CS; Set_RS; Set_WR; Clr_RD;
|
Set_CS; Set_RS; Set_WR; Clr_RD;
|
||||||
palWritePort(GDISP_DATA_PORT, lcdReg);
|
palWritePort(GDISP_DATA_PORT, lcdReg);
|
||||||
Clr_RS;
|
Clr_RS;
|
||||||
palWritePort(GDISP_DATA_PORT, lcdRegValue);
|
palWritePort(GDISP_DATA_PORT, lcdRegValue);
|
||||||
Clr_CS;
|
Clr_CS;
|
||||||
}
|
}
|
||||||
__inline void GDISP_LLD(writedata)(uint16_t data) {
|
inline void GDISP_LLD(writedata)(uint16_t data) {
|
||||||
Set_CS; Clr_RS; Set_WR; Clr_RD;
|
Set_CS; Clr_RS; Set_WR; Clr_RD;
|
||||||
palWritePort(GDISP_DATA_PORT, data);
|
palWritePort(GDISP_DATA_PORT, data);
|
||||||
Clr_CS;
|
Clr_CS;
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline uint16_t GDISP_LLD(readdata)(void) {
|
inline uint16_t GDISP_LLD(readdata)(void) {
|
||||||
Set_CS; Clr_RS; Clr_WR; Set_RD;
|
Set_CS; Clr_RS; Clr_WR; Set_RD;
|
||||||
uint16_t data = palReadPort(GDISP_DATA_PORT);
|
uint16_t data = palReadPort(GDISP_DATA_PORT);
|
||||||
Clr_CS;
|
Clr_CS;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline uint8_t GDISP_LLD(readreg)(uint8_t lcdReg) {
|
inline uint8_t GDISP_LLD(readreg)(uint8_t lcdReg) {
|
||||||
Set_CS; Set_RS; Clr_WR; Set_RD;
|
Set_CS; Set_RS; Clr_WR; Set_RD;
|
||||||
palWritePort(GDISP_DATA_PORT, lcdReg);
|
palWritePort(GDISP_DATA_PORT, lcdReg);
|
||||||
Clr_RS;
|
Clr_RS;
|
||||||
|
@ -145,15 +145,15 @@ __inline uint8_t GDISP_LLD(readreg)(uint8_t lcdReg) {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(writestreamstart)(void) {
|
inline void GDISP_LLD(writestreamstart)(void) {
|
||||||
GDISP_LLD(writeindex)(SSD1963_WRITE_MEMORY_START);
|
GDISP_LLD(writeindex)(SSD1963_WRITE_MEMORY_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(readstreamstart)(void) {
|
inline void GDISP_LLD(readstreamstart)(void) {
|
||||||
GDISP_LLD(writeindex)(SSD1963_READ_MEMORY_START);
|
GDISP_LLD(writeindex)(SSD1963_READ_MEMORY_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(writestream)(uint16_t *buffer, uint16_t size) {
|
inline void GDISP_LLD(writestream)(uint16_t *buffer, uint16_t size) {
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
Set_CS; Clr_RS; Set_WR; Clr_RD;
|
Set_CS; Clr_RS; Set_WR; Clr_RD;
|
||||||
for(i = 0; i < size; i++) {
|
for(i = 0; i < size; i++) {
|
||||||
|
@ -164,7 +164,7 @@ __inline void GDISP_LLD(writestream)(uint16_t *buffer, uint16_t size) {
|
||||||
Clr_CS;
|
Clr_CS;
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline void GDISP_LLD(readstream)(uint16_t *buffer, size_t size) {
|
inline void GDISP_LLD(readstream)(uint16_t *buffer, size_t size) {
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
Set_CS; Clr_RS; Clr_WR; Set_RD;
|
Set_CS; Clr_RS; Clr_WR; Set_RD;
|
||||||
for(i = 0; i < size; i++) {
|
for(i = 0; i < size; i++) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
#define delay(us) chThdSleepMicroseconds(us)
|
#define delay(us) chThdSleepMicroseconds(us)
|
||||||
#define delayms(ms) chThdSleepMilliseconds(ms)
|
#define delayms(ms) chThdSleepMilliseconds(ms)
|
||||||
|
|
||||||
static __inline void set_cursor(coord_t x, coord_t y) {
|
static inline void set_cursor(coord_t x, coord_t y) {
|
||||||
/* Reg SSD2119_REG_X_RAM_ADDR is 9 bit value
|
/* Reg SSD2119_REG_X_RAM_ADDR is 9 bit value
|
||||||
* Reg SSD2119_REG_Y_RAM_ADDR is an 8 bit
|
* Reg SSD2119_REG_Y_RAM_ADDR is an 8 bit
|
||||||
* Use a bit mask to make sure they are not set too high
|
* Use a bit mask to make sure they are not set too high
|
||||||
|
@ -136,7 +136,7 @@ static void set_viewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
set_cursor(x, y);
|
set_cursor(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void reset_viewport(void) {
|
static inline void reset_viewport(void) {
|
||||||
set_viewport(0, 0, GDISP.Width, GDISP.Height);
|
set_viewport(0, 0, GDISP.Width, GDISP.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -56,7 +56,7 @@ static const PWMConfig pwmcfg = {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
unsigned char FSMC_Bank;
|
unsigned char FSMC_Bank;
|
||||||
|
|
||||||
/* STM32F4 FSMC init */
|
/* STM32F4 FSMC init */
|
||||||
|
@ -98,7 +98,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void setpin_reset(bool_t state) {
|
static inline void setpin_reset(bool_t state) {
|
||||||
if (state) {
|
if (state) {
|
||||||
CLR_RST;
|
CLR_RST;
|
||||||
} else {
|
} else {
|
||||||
|
@ -113,7 +113,7 @@ static __inline void setpin_reset(bool_t state) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void set_backlight(uint8_t percent) {
|
static inline void set_backlight(uint8_t percent) {
|
||||||
pwmEnableChannel(&PWMD4, 1, percent);
|
pwmEnableChannel(&PWMD4, 1, percent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ static __inline void set_backlight(uint8_t percent) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void acquire_bus(void) {
|
static inline void acquire_bus(void) {
|
||||||
/* Nothing to do here since LCD is the only device on that bus */
|
/* Nothing to do here since LCD is the only device on that bus */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ static __inline void acquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
/* Nothing to do here since LCD is the only device on that bus */
|
/* Nothing to do here since LCD is the only device on that bus */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_index(uint16_t index) {
|
static inline void write_index(uint16_t index) {
|
||||||
GDISP_REG = index;
|
GDISP_REG = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ static __inline void write_index(uint16_t index) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void write_data(uint16_t data) {
|
static inline void write_data(uint16_t data) {
|
||||||
GDISP_RAM = data;
|
GDISP_RAM = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ static __inline void write_data(uint16_t data) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_data(void) {
|
static inline uint16_t read_data(void) {
|
||||||
return GDISP_RAM;
|
return GDISP_RAM;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputADS7843: You must supply a definition for init_board for your board"
|
#error "ginputADS7843: You must supply a definition for init_board for your board"
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline bool_t getpin_pressed(void) {
|
static inline bool_t getpin_pressed(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputADS7843: You must supply a definition for getpin_pressed for your board"
|
#error "ginputADS7843: You must supply a definition for getpin_pressed for your board"
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ static __inline bool_t getpin_pressed(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void aquire_bus(void) {
|
static inline void aquire_bus(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputADS7843: You must supply a definition for aquire_bus for your board"
|
#error "ginputADS7843: You must supply a definition for aquire_bus for your board"
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ static __inline void aquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputADS7843: You must supply a definition for release_bus for your board"
|
#error "ginputADS7843: You must supply a definition for release_bus for your board"
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_value(uint16_t port) {
|
static inline uint16_t read_value(uint16_t port) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputADS7843: You must supply a definition for read_value for your board"
|
#error "ginputADS7843: You must supply a definition for read_value for your board"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -42,7 +42,7 @@ static const SPIConfig spicfg = {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
spiStart(&SPID1, &spicfg);
|
spiStart(&SPID1, &spicfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline bool_t getpin_pressed(void) {
|
static inline bool_t getpin_pressed(void) {
|
||||||
return (!palReadPad(GPIOC, 4));
|
return (!palReadPad(GPIOC, 4));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,7 @@ static __inline bool_t getpin_pressed(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void aquire_bus(void) {
|
static inline void aquire_bus(void) {
|
||||||
spiAcquireBus(&SPID1);
|
spiAcquireBus(&SPID1);
|
||||||
//TOUCHSCREEN_SPI_PROLOGUE();
|
//TOUCHSCREEN_SPI_PROLOGUE();
|
||||||
palClearPad(GPIOC, 6);
|
palClearPad(GPIOC, 6);
|
||||||
|
@ -71,7 +71,7 @@ static __inline void aquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
palSetPad(GPIOC, 6);
|
palSetPad(GPIOC, 6);
|
||||||
spiReleaseBus(&SPID1);
|
spiReleaseBus(&SPID1);
|
||||||
//TOUCHSCREEN_SPI_EPILOGUE();
|
//TOUCHSCREEN_SPI_EPILOGUE();
|
||||||
|
@ -85,7 +85,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_value(uint16_t port) {
|
static inline uint16_t read_value(uint16_t port) {
|
||||||
static uint8_t txbuf[3] = {0};
|
static uint8_t txbuf[3] = {0};
|
||||||
static uint8_t rxbuf[3] = {0};
|
static uint8_t rxbuf[3] = {0};
|
||||||
uint16_t ret;
|
uint16_t ret;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -42,7 +42,7 @@ static const SPIConfig spicfg = {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
spiStart(&SPID2, &spicfg);
|
spiStart(&SPID2, &spicfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline bool_t getpin_pressed(void) {
|
static inline bool_t getpin_pressed(void) {
|
||||||
return (!palReadPad(GPIOG, 0));
|
return (!palReadPad(GPIOG, 0));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,7 @@ static __inline bool_t getpin_pressed(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void aquire_bus(void) {
|
static inline void aquire_bus(void) {
|
||||||
spiAcquireBus(&SPID2);
|
spiAcquireBus(&SPID2);
|
||||||
//TOUCHSCREEN_SPI_PROLOGUE();
|
//TOUCHSCREEN_SPI_PROLOGUE();
|
||||||
palClearPad(GPIOG, 10);
|
palClearPad(GPIOG, 10);
|
||||||
|
@ -71,7 +71,7 @@ static __inline void aquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
palSetPad(GPIOG, 10);
|
palSetPad(GPIOG, 10);
|
||||||
spiReleaseBus(&SPID2);
|
spiReleaseBus(&SPID2);
|
||||||
//TOUCHSCREEN_SPI_EPILOGUE();
|
//TOUCHSCREEN_SPI_EPILOGUE();
|
||||||
|
@ -85,7 +85,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_value(uint16_t port) {
|
static inline uint16_t read_value(uint16_t port) {
|
||||||
static uint8_t txbuf[3] = {0};
|
static uint8_t txbuf[3] = {0};
|
||||||
static uint8_t rxbuf[3] = {0};
|
static uint8_t rxbuf[3] = {0};
|
||||||
uint16_t ret;
|
uint16_t ret;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputMCU: You must supply a definition for init_board for your board"
|
#error "ginputMCU: You must supply a definition for init_board for your board"
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline bool_t getpin_pressed(void) {
|
static inline bool_t getpin_pressed(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputMCU: You must supply a definition for getpin_pressed for your board"
|
#error "ginputMCU: You must supply a definition for getpin_pressed for your board"
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ static __inline bool_t getpin_pressed(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void aquire_bus(void) {
|
static inline void aquire_bus(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputMCU: You must supply a definition for aquire_bus for your board"
|
#error "ginputMCU: You must supply a definition for aquire_bus for your board"
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ static __inline void aquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputMCU: You must supply a definition for release_bus for your board"
|
#error "ginputMCU: You must supply a definition for release_bus for your board"
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_x_value(void) {
|
static inline uint16_t read_x_value(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputMCU: You must supply a definition for read_x_value for your board"
|
#error "ginputMCU: You must supply a definition for read_x_value for your board"
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ static __inline uint16_t read_x_value(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_y_value(void) {
|
static inline uint16_t read_y_value(void) {
|
||||||
/* Code here */
|
/* Code here */
|
||||||
#error "ginputMCU: You must supply a definition for read_y_value for your board"
|
#error "ginputMCU: You must supply a definition for read_y_value for your board"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
@ -63,7 +63,7 @@ static const ADCConversionGroup adc_x_config = {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static inline void init_board(void) {
|
||||||
adcStart(&ADCD1, NULL);
|
adcStart(&ADCD1, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ static __inline void init_board(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline bool_t getpin_pressed(void) {
|
static inline bool_t getpin_pressed(void) {
|
||||||
palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_PULLDOWN);
|
palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_PULLDOWN);
|
||||||
palSetPadMode(GPIOC, 1, PAL_MODE_INPUT);
|
palSetPadMode(GPIOC, 1, PAL_MODE_INPUT);
|
||||||
palSetPadMode(GPIOC, 2, PAL_MODE_INPUT);
|
palSetPadMode(GPIOC, 2, PAL_MODE_INPUT);
|
||||||
|
@ -88,7 +88,7 @@ static __inline bool_t getpin_pressed(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void aquire_bus(void) {
|
static inline void aquire_bus(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ static __inline void aquire_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static inline void release_bus(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ static __inline void release_bus(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_x_value(void) {
|
static inline uint16_t read_x_value(void) {
|
||||||
uint16_t val1, val2;
|
uint16_t val1, val2;
|
||||||
adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
|
adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ static __inline uint16_t read_x_value(void) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_y_value(void) {
|
static inline uint16_t read_y_value(void) {
|
||||||
uint16_t val1, val2;
|
uint16_t val1, val2;
|
||||||
adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
|
adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012, 2013
|
ChibiOS/GFX - Copyright (C) 2012, 2013, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS/GFX - Copyright (C) 2012
|
ChibiOS/GFX - Copyright (C) 2012, 2013
|
||||||
Joel Bodenmann aka Tectu <joel@unormal.org>
|
Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||||
|
|
||||||
This file is part of ChibiOS/GFX.
|
This file is part of ChibiOS/GFX.
|
||||||
|
|