diff options
Diffstat (limited to 'firmware/target/arm/s5l8700/meizu-m6sl')
4 files changed, 245 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/adc-target.h b/firmware/target/arm/s5l8700/meizu-m6sl/adc-target.h new file mode 100644 index 0000000000..c0a069ac0c --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sl/adc-target.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef _ADC_TARGET_H_ | ||
20 | #define _ADC_TARGET_H_ | ||
21 | |||
22 | /* only two channels used by the Gigabeat */ | ||
23 | #define NUM_ADC_CHANNELS 1 | ||
24 | |||
25 | #define ADC_UNKNOWN_1 0 | ||
26 | #define ADC_UNKNOWN_2 1 | ||
27 | #define ADC_BATTERY 2 | ||
28 | #define ADC_UNKNOWN_4 3 | ||
29 | |||
30 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ | ||
31 | #define ADC_READ_ERROR 0xFFFF | ||
32 | |||
33 | #endif | ||
diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/backlight-target.h b/firmware/target/arm/s5l8700/meizu-m6sl/backlight-target.h new file mode 100644 index 0000000000..1dc334cffa --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sl/backlight-target.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Marcoen Hirschberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef BACKLIGHT_TARGET_H | ||
20 | #define BACKLIGHT_TARGET_H | ||
21 | |||
22 | bool _backlight_init(void); | ||
23 | void _backlight_on(void); | ||
24 | void _backlight_off(void); | ||
25 | void _backlight_set_brightness(int brightness); | ||
26 | |||
27 | #endif | ||
diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/button-target.h b/firmware/target/arm/s5l8700/meizu-m6sl/button-target.h new file mode 100644 index 0000000000..7d0d7a1c4d --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sl/button-target.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef _BUTTON_TARGET_H_ | ||
20 | #define _BUTTON_TARGET_H_ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | #include "config.h" | ||
24 | |||
25 | #define HAS_BUTTON_HOLD | ||
26 | |||
27 | bool button_hold(void); | ||
28 | void button_init_device(void); | ||
29 | int button_read_device(void); | ||
30 | |||
31 | /* Toshiba Gigabeat specific button codes */ | ||
32 | |||
33 | #define BUTTON_LEFT 0x00000001 | ||
34 | #define BUTTON_RIGHT 0x00000002 | ||
35 | #define BUTTON_UP 0x00000004 | ||
36 | #define BUTTON_DOWN 0x00000008 | ||
37 | |||
38 | #define BUTTON_SELECT 0x00000010 | ||
39 | |||
40 | #define BUTTON_MENU 0x00000020 | ||
41 | #define BUTTON_PLAY 0x00000040 | ||
42 | |||
43 | |||
44 | #define BUTTON_MAIN (BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT\ | ||
45 | |BUTTON_UP|BUTTON_DOWN|BUTTON_SELECT|BUTTON_PLAY) | ||
46 | |||
47 | #define BUTTON_REMOTE 0 | ||
48 | |||
49 | #define POWEROFF_BUTTON BUTTON_PLAY | ||
50 | #define POWEROFF_COUNT 10 | ||
51 | |||
52 | #endif /* _BUTTON_TARGET_H_ */ | ||
diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c b/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c new file mode 100644 index 0000000000..8e5a4f472a --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c | |||
@@ -0,0 +1,133 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Alan Korr | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "config.h" | ||
20 | |||
21 | #include "hwcompat.h" | ||
22 | #include "kernel.h" | ||
23 | #include "lcd.h" | ||
24 | #include "system.h" | ||
25 | #include "cpu.h" | ||
26 | |||
27 | /*** definitions ***/ | ||
28 | |||
29 | |||
30 | /** globals **/ | ||
31 | |||
32 | static int xoffset; /* needed for flip */ | ||
33 | |||
34 | /*** hardware configuration ***/ | ||
35 | |||
36 | int lcd_default_contrast(void) | ||
37 | { | ||
38 | return 0x1f; | ||
39 | } | ||
40 | |||
41 | void lcd_set_contrast(int val) | ||
42 | { | ||
43 | } | ||
44 | |||
45 | void lcd_set_invert_display(bool yesno) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | /* turn the display upside down (call lcd_update() afterwards) */ | ||
50 | void lcd_set_flip(bool yesno) | ||
51 | { | ||
52 | /* TODO: flip mode isn't working. The commands in the else part of | ||
53 | this function are how the original firmware inits the LCD */ | ||
54 | |||
55 | if (yesno) | ||
56 | { | ||
57 | xoffset = 132 - LCD_WIDTH; /* 132 colums minus the 128 we have */ | ||
58 | } | ||
59 | else | ||
60 | { | ||
61 | xoffset = 0; | ||
62 | } | ||
63 | } | ||
64 | |||
65 | |||
66 | /* LCD init */ | ||
67 | void lcd_init_device(void) | ||
68 | { | ||
69 | } | ||
70 | |||
71 | /*** Update functions ***/ | ||
72 | |||
73 | /* Performance function that works with an external buffer | ||
74 | note that by and bheight are in 8-pixel units! */ | ||
75 | void lcd_blit_mono(const unsigned char *data, int x, int by, int width, | ||
76 | int bheight, int stride) | ||
77 | { | ||
78 | /* Copy display bitmap to hardware */ | ||
79 | while (bheight--) | ||
80 | { | ||
81 | } | ||
82 | } | ||
83 | |||
84 | |||
85 | /* Performance function that works with an external buffer | ||
86 | note that by and bheight are in 8-pixel units! */ | ||
87 | void lcd_blit_grey_phase_blit(unsigned char *values, unsigned char *phases, | ||
88 | int x, int by, int width, int bheight, int stride) | ||
89 | { | ||
90 | (void)values; | ||
91 | (void)phases; | ||
92 | (void)x; | ||
93 | (void)by; | ||
94 | (void)width; | ||
95 | (void)bheight; | ||
96 | (void)stride; | ||
97 | } | ||
98 | |||
99 | /* Update the display. | ||
100 | This must be called after all other LCD functions that change the display. */ | ||
101 | void lcd_update(void) ICODE_ATTR; | ||
102 | void lcd_update(void) | ||
103 | { | ||
104 | int y; | ||
105 | |||
106 | /* Copy display bitmap to hardware */ | ||
107 | for (y = 0; y < LCD_FBHEIGHT; y++) | ||
108 | { | ||
109 | } | ||
110 | } | ||
111 | |||
112 | /* Update a fraction of the display. */ | ||
113 | void lcd_update_rect(int, int, int, int) ICODE_ATTR; | ||
114 | void lcd_update_rect(int x, int y, int width, int height) | ||
115 | { | ||
116 | int ymax; | ||
117 | |||
118 | /* The Y coordinates have to work on even 8 pixel rows */ | ||
119 | ymax = (y + height-1) >> 3; | ||
120 | y >>= 3; | ||
121 | |||
122 | if(x + width > LCD_WIDTH) | ||
123 | width = LCD_WIDTH - x; | ||
124 | if (width <= 0) | ||
125 | return; /* nothing left to do, 0 is harmful to lcd_write_data() */ | ||
126 | if(ymax >= LCD_FBHEIGHT) | ||
127 | ymax = LCD_FBHEIGHT-1; | ||
128 | |||
129 | /* Copy specified rectange bitmap to hardware */ | ||
130 | for (; y <= ymax; y++) | ||
131 | { | ||
132 | } | ||
133 | } | ||