ssd1289 GPIO split into two 8-bit groups
This commit is contained in:
parent
609af8f9a8
commit
89a597bfc4
2 changed files with 20 additions and 12 deletions
|
@ -11,7 +11,8 @@ static __inline void lld_lcdWriteIndex(uint16_t index) {
|
|||
Clr_RS;
|
||||
Set_RD;
|
||||
|
||||
palWritePort(LCD_DATA_PORT, index);
|
||||
LCD_DATA_PORT_1->BSRR = (((~index >> 8) << 16) | (index >> 8) << LCD_DATA_PORT_1_BASE);
|
||||
LCD_DATA_PORT_2->BSRR = (((~index & 0xFF) << 16) | (index & 0xFF) << LCD_DATA_PORT_2_BASE);
|
||||
|
||||
Clr_WR;
|
||||
Set_WR;
|
||||
|
@ -20,7 +21,8 @@ static __inline void lld_lcdWriteIndex(uint16_t index) {
|
|||
static __inline void lld_lcdWriteData(uint16_t data) {
|
||||
Set_RS;
|
||||
|
||||
palWritePort(LCD_DATA_PORT, data);
|
||||
LCD_DATA_PORT_1->BSRR = (((~data >> 8) << 16) | (data >> 8) << LCD_DATA_PORT_1_BASE);
|
||||
LCD_DATA_PORT_2->BSRR = (((~data & 0xFF) << 16) | (data & 0xFF) << LCD_DATA_PORT_2_BASE);
|
||||
|
||||
Clr_WR;
|
||||
Set_WR;
|
||||
|
@ -83,7 +85,8 @@ __inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
|
|||
Set_RS;
|
||||
|
||||
for(i = 0; i < size; i++) {
|
||||
palWritePort(LCD_DATA_PORT, buffer[i]);
|
||||
LCD_DATA_PORT_1->BSRR = (((~buffer[i] >> 8) << 16) | (buffer[i] >> 8) << LCD_DATA_PORT_1_BASE);
|
||||
LCD_DATA_PORT_2->BSRR = (((~buffer[i] & 0xFF) << 16) | (buffer[i] & 0xFF) << LCD_DATA_PORT_2_BASE);
|
||||
Clr_WR;
|
||||
Set_WR;
|
||||
}
|
||||
|
|
23
readme
23
readme
|
@ -6,16 +6,21 @@ git clone https://github.com/tectu/Chibios-LCD-Driver lcd
|
|||
|
||||
### Edit boardfiles:
|
||||
add the following to your board.h file, matching to your pinconfig:
|
||||
#define TP_PORT GPIOC
|
||||
#define TP_IRQ 4
|
||||
#define TP_CS 6
|
||||
#define TP_PORT GPIOC
|
||||
#define TP_IRQ 4
|
||||
#define TP_CS 6
|
||||
|
||||
#define LCD_DATA_PORT GPIOE
|
||||
#define LCD_CMD_PORT GPIOD
|
||||
#define LCD_CS 12
|
||||
#define LCD_RS 13
|
||||
#define LCD_WR 14
|
||||
#define LCD_RD 15
|
||||
#define LCD_DATA_PORT_1 GPIOB
|
||||
#define LCD_DATA_PORT_2 GPIOC
|
||||
#define LCD_DATA_PORT_1_BASE 8
|
||||
#define LCD_DATA_PORT_2_BASE 0
|
||||
#define LCD_CMD_PORT GPIOD
|
||||
#define LCD_CS 12
|
||||
#define LCD_RS 13
|
||||
#define LCD_WR 14
|
||||
#define LCD_RD 15
|
||||
|
||||
in this example, we use GPIOC[0:7] for DB[0:7] and GPIOB[8:15] for DB[8:15]
|
||||
|
||||
### Edit Makefile:
|
||||
include lcd.mk:
|
||||
|
|
Loading…
Add table
Reference in a new issue