#define LCD_DATA_PORT 2 // 8-Pin Data Port #define LCD_DATA_PIN1 1 #define LCD_DATA_PIN2 2 #define LCD_DATA_PIN3 3 #define LCD_DATA_PIN4 4 #define LCD_DATA_PIN5 5 #define LCD_DATA_PIN6 6 #define LCD_DATA_PIN7 7 #define LCD_DATA_PIN8 8 #define LCD_DATA_MASK 0x000001FE #define LCD_DATA_OFFSET 1 // Offset = PIN1 #define GPIO_GPIO2_BASE (0x50020000) #define LCD_GPIO2DATA_DATA (*(pREG32 (GPIO_GPIO2_BASE + (LCD_DATA_MASK << 2)))) /**************************************************************************/ //Writes the supplied 8-bit data using an 8-bit interface /**************************************************************************/ void LcdWriteData(uint8_t data) { //chip select CLR_CS; //send data SET_CD; CLR_WR; LCD_GPIO2DATA_DATA = data << LCD_DATA_OFFSET; SET_WR; SET_CS; } /**************************************************************************/ |