1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 Michael Sevakis
12 * LCD scrolling driver and scheduler
14 * Much collected and combined from the various Rockbox LCD drivers.
16 * All files in this archive are subject to the GNU General Public License.
17 * See the file COPYING in the source tree root for full license agreement.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
23 #ifndef __SCROLL_ENGINE_H__
24 #define __SCROLL_ENGINE_H__
26 void scroll_init(void);
27 void lcd_scroll_fn(void);
28 void lcd_remote_scroll_fn(void);
30 /* internal usage, but in multiple drivers */
31 #define SCROLL_SPACING 3
32 #ifdef HAVE_LCD_BITMAP
33 #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH/2 + 2)
35 #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH + 2)
40 char line
[SCROLL_LINE_SIZE
];
41 int len
; /* length of line in chars */
44 #ifdef HAVE_LCD_BITMAP
45 int width
; /* length of line in pixels */
46 bool invert
; /* invert the scrolled text */
48 bool backward
; /* scroll presently forward or backward? */
56 struct scroll_screen_info
58 struct scrollinfo
* const scroll
;
59 const int num_scroll
; /* number of scrollable lines (also number of scroll structs) */
60 int lines
; /* Bitpattern of which lines are scrolling */
61 long ticks
; /* # of ticks between updates*/
62 long delay
; /* ticks delay before start */
63 int bidir_limit
; /* percent */
64 #ifdef HAVE_LCD_CHARCELLS
65 long jump_scroll_delay
; /* delay between jump scroll jumps */
66 int jump_scroll
; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
68 #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)
69 int step
; /* pixels per scroll step */
71 #if defined(HAVE_REMOTE_LCD)
77 #ifdef HAVE_LCD_BITMAP
78 #define LCD_SCROLLABLE_LINES ((LCD_HEIGHT+4)/5 < 32 ? (LCD_HEIGHT+4)/5 : 32)
80 #define LCD_SCROLLABLE_LINES LCD_HEIGHT
83 extern struct scroll_screen_info lcd_scroll_info
;
86 #ifdef HAVE_REMOTE_LCD
87 #define LCD_REMOTE_SCROLLABLE_LINES \
88 (((LCD_REMOTE_HEIGHT+4)/5 < 32) ? (LCD_REMOTE_HEIGHT+4)/5 : 32)
89 extern struct scroll_screen_info lcd_remote_scroll_info
;
92 #endif /* __SCROLL_ENGINE_H__ */