SSD1289 - firebull update
This commit is contained in:
parent
971c9fd0d9
commit
437134eb38
1 changed files with 19 additions and 19 deletions
|
@ -29,14 +29,14 @@
|
||||||
#ifndef _GDISP_LLD_BOARD_H
|
#ifndef _GDISP_LLD_BOARD_H
|
||||||
#define _GDISP_LLD_BOARD_H
|
#define _GDISP_LLD_BOARD_H
|
||||||
|
|
||||||
#define SET_CS palSetPad(GDISP_CMD_PORT, GDISP_CS);
|
#define SET_CS palSetPad(GPIOD, 12);
|
||||||
#define CLR_CS palClearPad(GDISP_CMD_PORT, GDISP_CS);
|
#define CLR_CS palClearPad(GPIOD, 12);
|
||||||
#define SET_RS palSetPad(GDISP_CMD_PORT, GDISP_RS);
|
#define SET_RS palSetPad(GPIOD, 13);
|
||||||
#define CLR_RS palClearPad(GDISP_CMD_PORT, GDISP_RS);
|
#define CLR_RS palClearPad(GPIOD, 13);
|
||||||
#define SET_WR palSetPad(GDISP_CMD_PORT, GDISP_WR);
|
#define SET_WR palSetPad(GPIOD, 14);
|
||||||
#define CLR_WR palClearPad(GDISP_CMD_PORT, GDISP_WR);
|
#define CLR_WR palClearPad(GPIOD, 14);
|
||||||
#define SET_RD palSetPad(GDISP_CMD_PORT, GDISP_RD);
|
#define SET_RD palSetPad(GPIOD, 15);
|
||||||
#define CLR_RD palClearPad(GDISP_CMD_PORT, GDISP_RD);
|
#define CLR_RD palClearPad(GPIOD, 15);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialise the board for the display.
|
* @brief Initialise the board for the display.
|
||||||
|
@ -45,11 +45,11 @@
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void init_board(void) {
|
static __inline void init_board(void) {
|
||||||
palSetGroupMode(GDISP_DATA_PORT, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
palSetPadMode(GDISP_CMD_PORT, GDISP_CS, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetPadMode(GPIOD, 12, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
palSetPadMode(GDISP_CMD_PORT, GDISP_RS, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetPadMode(GPIOD, 13, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
palSetPadMode(GDISP_CMD_PORT, GDISP_WR, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetPadMode(GPIOD, 14, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
palSetPadMode(GDISP_CMD_PORT, GDISP_RD, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetPadMode(GPIOD, 15, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
|
|
||||||
// Configure the pins to a well know state
|
// Configure the pins to a well know state
|
||||||
SET_RS;
|
SET_RS;
|
||||||
|
@ -109,7 +109,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(GDISP_DATA_PORT, index);
|
palWritePort(GPIOE, index);
|
||||||
CLR_RS; CLR_WR; SET_WR; SET_RS;
|
CLR_RS; CLR_WR; SET_WR; SET_RS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,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(GDISP_DATA_PORT, data);
|
palWritePort(GPIOE, data);
|
||||||
CLR_WR; SET_WR;
|
CLR_WR; SET_WR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,15 +139,15 @@ 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
|
||||||
palSetGroupMode(GDISP_DATA_PORT, PAL_WHOLE_PORT, 0, PAL_MODE_INPUT);
|
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_INPUT);
|
||||||
|
|
||||||
CLR_RD;
|
CLR_RD;
|
||||||
value = palReadPort(GDISP_DATA_PORT);
|
value = palReadPort(GPIOE);
|
||||||
value = palReadPort(GDISP_DATA_PORT);
|
value = palReadPort(GPIOE);
|
||||||
SET_RD;
|
SET_RD;
|
||||||
|
|
||||||
// change pin mode back to digital output
|
// change pin mode back to digital output
|
||||||
palSetGroupMode(GDISP_DATA_PORT, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue