From c6b114126289bff945245bece13aebf3336e3e93 Mon Sep 17 00:00:00 2001 From: Tectu Date: Mon, 28 May 2012 23:21:27 +0200 Subject: [PATCH] cleanups --- glcd.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/glcd.h b/glcd.h index dfe9b9a2..a344a1cf 100755 --- a/glcd.h +++ b/glcd.h @@ -1,20 +1,29 @@ #ifndef GLCD_H #define GLCD_H -#include "ch.h" -#include "hal.h" +#include // types +#include #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 -#define Set_CS LCD_CMD_PORT->ODR |= (1 << GPIOD_LCD_CS); -#define Clr_CS LCD_CMD_PORT->ODR &= ~(1 << GPIOD_LCD_CS); -#define Set_RS LCD_CMD_PORT->ODR |= (1 << GPIOD_LCD_RS); -#define Clr_RS LCD_CMD_PORT->ODR &= ~(1 << GPIOD_LCD_RS); -#define Set_WR LCD_CMD_PORT->ODR |= (1 << GPIOD_LCD_WR); -#define Clr_WR LCD_CMD_PORT->ODR &= ~(1 << GPIOD_LCD_WR); -#define Set_RD LCD_CMD_PORT->ODR |= (1 << GPIOD_LCD_RD); -#define Clr_RD LCD_CMD_PORT->ODR &= ~(1 << GPIOD_LCD_RD); +/* uncomment if no board.h file used +#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 Set_CS LCD_CMD_PORT->ODR |= (1 << LCD_CS); +#define Clr_CS LCD_CMD_PORT->ODR &= ~(1 << LCD_CS); +#define Set_RS LCD_CMD_PORT->ODR |= (1 << LCD_RS); +#define Clr_RS LCD_CMD_PORT->ODR &= ~(1 << LCD_RS); +#define Set_WR LCD_CMD_PORT->ODR |= (1 << LCD_WR); +#define Clr_WR LCD_CMD_PORT->ODR &= ~(1 << LCD_WR); +#define Set_RD LCD_CMD_PORT->ODR |= (1 << LCD_RD); +#define Clr_RD LCD_CMD_PORT->ODR &= ~(1 << LCD_RD); /* LCD color */ #define White 0xFFFF