From b73892eb6012e8f343ddbe74525bb414808e94b5 Mon Sep 17 00:00:00 2001 From: aleph Date: Tue, 26 Oct 2010 14:29:15 +0000 Subject: [PATCH] ILI9225 lcd driver: use generic KFile object instead of SPI. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4468 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/lcd_ili9225.c | 13 ++++++------- bertos/drv/lcd_ili9225.h | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bertos/drv/lcd_ili9225.c b/bertos/drv/lcd_ili9225.c index 51428db6..bcfdf812 100644 --- a/bertos/drv/lcd_ili9225.c +++ b/bertos/drv/lcd_ili9225.c @@ -72,11 +72,10 @@ #include "hw/hw_ili9225.h" #include -#include #include -static struct Serial *spi; +static struct KFile *spi; struct lcd_ili9225_reg @@ -134,7 +133,7 @@ static void lcd_cmd(uint8_t cmd) { LCD_CS_LOW(); LCD_RS_LOW(); - kfile_write(&spi->fd, &cmd, sizeof(cmd)); + kfile_write(spi, &cmd, sizeof(cmd)); } static void lcd_data(uint16_t data) @@ -143,10 +142,10 @@ static void lcd_data(uint16_t data) bytes[0] = data >> 8; bytes[1] = data & 0xFF; - kfile_flush(&spi->fd); + kfile_flush(spi); LCD_RS_HIGH(); - kfile_write(&spi->fd, bytes, 2); - kfile_flush(&spi->fd); + kfile_write(spi, bytes, 2); + kfile_flush(spi); LCD_CS_HIGH(); } @@ -274,7 +273,7 @@ void lcd_ili9225_backlight(unsigned level) /** * Display initialization. */ -void lcd_ili9225_init(struct Serial *_spi) +void lcd_ili9225_init(struct KFile *_spi) { unsigned i; diff --git a/bertos/drv/lcd_ili9225.h b/bertos/drv/lcd_ili9225.h index 13e01301..8df00aa1 100644 --- a/bertos/drv/lcd_ili9225.h +++ b/bertos/drv/lcd_ili9225.h @@ -48,9 +48,9 @@ #define LCD_BACKLIGHT_MAX 15 // Fwd decl -struct Serial; +struct KFile; -void lcd_ili9225_init(struct Serial *spi); +void lcd_ili9225_init(struct KFile *spi); void lcd_ili9225_on(void); void lcd_ili9225_off(void); void lcd_ili9225_backlight(unsigned level); -- 2.25.1