ILI9225 lcd driver: use generic KFile object instead of SPI.
authoraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 26 Oct 2010 14:29:15 +0000 (14:29 +0000)
committeraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 26 Oct 2010 14:29:15 +0000 (14:29 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4468 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/lcd_ili9225.c
bertos/drv/lcd_ili9225.h

index 51428db6e595552a5411d2261e91762550a9eb74..bcfdf8126fb1a7bd732d53dea7027319008e41de 100644 (file)
 #include "hw/hw_ili9225.h"
 
 #include <drv/timer.h>
-#include <drv/ser.h>
 #include <io/kfile.h>
 
 
-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;
 
index 13e013017a3d8b96d2bef2fc750a632b5bb960a0..8df00aa18cf2bd5a679272fbcf7ef6810b4848e6 100644 (file)
@@ -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);