diff options
Diffstat (limited to 'firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c')
-rw-r--r-- | firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c new file mode 100644 index 0000000000..daf8869c9c --- /dev/null +++ b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c | |||
@@ -0,0 +1,142 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by ???? | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | |||
23 | #include "hwcompat.h" | ||
24 | #include "kernel.h" | ||
25 | #include "lcd.h" | ||
26 | #include "system.h" | ||
27 | #include "cpu.h" | ||
28 | |||
29 | /** globals **/ | ||
30 | |||
31 | static int xoffset; /* needed for flip */ | ||
32 | |||
33 | /*** hardware configuration ***/ | ||
34 | |||
35 | int lcd_default_contrast(void) | ||
36 | { | ||
37 | return 0x1f; | ||
38 | } | ||
39 | |||
40 | void lcd_set_contrast(int val) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | void lcd_set_invert_display(bool yesno) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | /* turn the display upside down (call lcd_update() afterwards) */ | ||
49 | void lcd_set_flip(bool yesno) | ||
50 | { | ||
51 | /* TODO: flip mode isn't working. The commands in the else part of | ||
52 | this function are how the original firmware inits the LCD */ | ||
53 | |||
54 | if (yesno) | ||
55 | { | ||
56 | xoffset = 132 - LCD_WIDTH; /* 132 colums minus the 128 we have */ | ||
57 | } | ||
58 | else | ||
59 | { | ||
60 | xoffset = 0; | ||
61 | } | ||
62 | } | ||
63 | |||
64 | |||
65 | |||
66 | void lcd_off(void) | ||
67 | { | ||
68 | } | ||
69 | |||
70 | void lcd_on(void) | ||
71 | { | ||
72 | } | ||
73 | |||
74 | /* LCD init */ | ||
75 | void lcd_init_device(void) | ||
76 | { | ||
77 | } | ||
78 | |||
79 | |||
80 | /*** Update functions ***/ | ||
81 | |||
82 | /* Performance function that works with an external buffer | ||
83 | note that by and bheight are in 8-pixel units! */ | ||
84 | void lcd_blit_mono(const unsigned char *data, int x, int by, int width, | ||
85 | int bheight, int stride) | ||
86 | { | ||
87 | /* Copy display bitmap to hardware */ | ||
88 | while (bheight--) | ||
89 | { | ||
90 | } | ||
91 | } | ||
92 | |||
93 | |||
94 | /* Performance function that works with an external buffer | ||
95 | note that by and bheight are in 8-pixel units! */ | ||
96 | void lcd_blit_grey_phase_blit(unsigned char *values, unsigned char *phases, | ||
97 | int x, int by, int width, int bheight, int stride) | ||
98 | { | ||
99 | (void)values; | ||
100 | (void)phases; | ||
101 | (void)x; | ||
102 | (void)by; | ||
103 | (void)width; | ||
104 | (void)bheight; | ||
105 | (void)stride; | ||
106 | } | ||
107 | |||
108 | /* Update the display. | ||
109 | This must be called after all other LCD functions that change the display. */ | ||
110 | void lcd_update(void) ICODE_ATTR; | ||
111 | void lcd_update(void) | ||
112 | { | ||
113 | int y; | ||
114 | |||
115 | /* Copy display bitmap to hardware */ | ||
116 | for (y = 0; y < LCD_FBHEIGHT; y++) | ||
117 | { | ||
118 | } | ||
119 | } | ||
120 | |||
121 | /* Update a fraction of the display. */ | ||
122 | void lcd_update_rect(int, int, int, int) ICODE_ATTR; | ||
123 | void lcd_update_rect(int x, int y, int width, int height) | ||
124 | { | ||
125 | int ymax; | ||
126 | |||
127 | /* The Y coordinates have to work on even 8 pixel rows */ | ||
128 | ymax = (y + height-1) >> 3; | ||
129 | y >>= 3; | ||
130 | |||
131 | if(x + width > LCD_WIDTH) | ||
132 | width = LCD_WIDTH - x; | ||
133 | if (width <= 0) | ||
134 | return; /* nothing left to do, 0 is harmful to lcd_write_data() */ | ||
135 | if(ymax >= LCD_FBHEIGHT) | ||
136 | ymax = LCD_FBHEIGHT-1; | ||
137 | |||
138 | /* Copy specified rectange bitmap to hardware */ | ||
139 | for (; y <= ymax; y++) | ||
140 | { | ||
141 | } | ||
142 | } | ||