From 50f96943bef6996f354aa01a0f5265cbe14764b6 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Sat, 7 Jan 2012 19:07:36 +0000 Subject: remote_detect(): move to lcd-remote.h Reorganize lcd-remote.h so it works for iaudio-m3 too git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31605 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/lcd-remote.h | 110 +++++++++++---------- .../arm/olympus/mrobe-100/lcd-remote-target.h | 2 - .../arm/tms320dm320/mrobe-500/lcd-remote-target.h | 2 - .../target/coldfire/iaudio/lcd-remote-target.h | 1 - firmware/target/coldfire/iaudio/m3/button-m3.c | 2 +- firmware/target/coldfire/iaudio/m5/button-m5.c | 2 +- firmware/target/coldfire/iaudio/x5/button-x5.c | 2 +- .../target/coldfire/iriver/lcd-remote-target.h | 2 - 8 files changed, 61 insertions(+), 62 deletions(-) diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index f2fbbc62f3..41042e04d0 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h @@ -27,7 +27,7 @@ #include "config.h" #include "lcd.h" -#ifdef HAVE_REMOTE_LCD +#ifdef HAVE_REMOTE_LCD /* Not for the players with *only* a remote LCD (m3) */ #ifndef __PCTOOL__ #include "lcd-remote-target.h" @@ -61,17 +61,6 @@ typedef unsigned long fb_remote_data; #define FB_RDATA_SZ 4 #endif -/* common functions */ -void lcd_remote_init(void); -void lcd_remote_write_command(int cmd); -void lcd_remote_write_command_ex(int cmd, int data); -void lcd_remote_write_data(const fb_remote_data *data, int count); - -/* Low-level drawing function types */ -typedef void lcd_remote_pixelfunc_type(int x, int y); -typedef void lcd_remote_blockfunc_type(fb_remote_data *address, unsigned mask, - unsigned bits); - #if LCD_REMOTE_DEPTH > 1 /* greyscale - 8 bit max */ #ifdef HAVE_LCD_COLOR extern unsigned lcd_remote_color_to_native(unsigned color); @@ -109,14 +98,70 @@ extern unsigned lcd_remote_color_to_native(unsigned color); #ifndef LCD_REMOTE_FBHEIGHT #define LCD_REMOTE_FBHEIGHT LCD_REMOTE_HEIGHT #endif + /* The actual framebuffer */ extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_FBHEIGHT][LCD_REMOTE_FBWIDTH]; +#if LCD_REMOTE_DEPTH > 1 +extern void lcd_remote_set_foreground(unsigned foreground); +extern unsigned lcd_remote_get_foreground(void); +extern void lcd_remote_set_background(unsigned background); +extern unsigned lcd_remote_get_background(void); +extern void lcd_remote_set_drawinfo(int mode, unsigned foreground, + unsigned background); +void lcd_remote_set_backdrop(fb_remote_data* backdrop); +fb_remote_data* lcd_remote_get_backdrop(void); + +extern void lcd_remote_mono_bitmap_part(const unsigned char *src, int src_x, + int src_y, int stride, int x, int y, + int width, int height); +extern void lcd_remote_mono_bitmap(const unsigned char *src, int x, int y, + int width, int height); +extern void lcd_remote_bitmap_transparent_part(const fb_remote_data *src, + int src_x, int src_y, + int stride, int x, int y, + int width, int height); +extern void lcd_bitmap_remote_transparent(const fb_remote_data *src, int x, + int y, int width, int height); +#else /* LCD_REMOTE_DEPTH == 1 */ +#define lcd_remote_mono_bitmap lcd_remote_bitmap +#define lcd_remote_mono_bitmap_part lcd_remote_bitmap_part +#endif /* LCD_REMOTE_DEPTH */ + +/* common functions */ +void lcd_remote_init(void); +void lcd_remote_write_command(int cmd); +void lcd_remote_write_command_ex(int cmd, int data); +void lcd_remote_write_data(const fb_remote_data *data, int count); + +extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x, + int src_y, int stride, int x, int y, + int width, int height); +extern void lcd_remote_bitmap(const fb_remote_data *src, int x, int y, + int width, int height); + +/* Low-level drawing function types */ +typedef void lcd_remote_pixelfunc_type(int x, int y); +typedef void lcd_remote_blockfunc_type(fb_remote_data *address, unsigned mask, + unsigned bits); + +/* low level drawing function pointer arrays */ +#if LCD_REMOTE_DEPTH > 1 +extern lcd_remote_pixelfunc_type* const *lcd_remote_pixelfuncs; +extern lcd_remote_blockfunc_type* const *lcd_remote_blockfuncs; +#else +extern lcd_remote_pixelfunc_type* const lcd_remote_pixelfuncs[8]; +extern lcd_remote_blockfunc_type* const lcd_remote_blockfuncs[8]; +#endif + +#endif /* HAVE_LCD_REMOTE */ + void lcd_remote_init_device(void); void lcd_remote_on(void); void lcd_remote_off(void); extern bool remote_initialized; +bool remote_detect(void); extern void lcd_remote_init(void); extern int lcd_remote_default_contrast(void); @@ -168,15 +213,6 @@ extern void lcd_remote_setfont(int font); extern int lcd_remote_getfont(void); extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); -/* low level drawing function pointer arrays */ -#if LCD_REMOTE_DEPTH > 1 -extern lcd_remote_pixelfunc_type* const *lcd_remote_pixelfuncs; -extern lcd_remote_blockfunc_type* const *lcd_remote_blockfuncs; -#else -extern lcd_remote_pixelfunc_type* const lcd_remote_pixelfuncs[8]; -extern lcd_remote_blockfunc_type* const lcd_remote_blockfuncs[8]; -#endif - extern void lcd_remote_drawpixel(int x, int y); extern void lcd_remote_drawline(int x1, int y1, int x2, int y2); extern void lcd_remote_hline(int x1, int x2, int y); @@ -185,44 +221,14 @@ extern void lcd_remote_drawrect(int x, int y, int width, int height); extern void lcd_remote_fillrect(int x, int y, int width, int height); extern void lcd_remote_draw_border_viewport(void); extern void lcd_remote_fill_viewport(void); -extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x, - int src_y, int stride, int x, int y, - int width, int height); -extern void lcd_remote_bitmap(const fb_remote_data *src, int x, int y, - int width, int height); extern void lcd_remote_putsxy(int x, int y, const unsigned char *str); extern void lcd_remote_putsxyf(int x, int y, const unsigned char *fmt, ...); extern void lcd_remote_bidir_scroll(int threshold); extern void lcd_remote_scroll_step(int pixels); -#if LCD_REMOTE_DEPTH > 1 -extern void lcd_remote_set_foreground(unsigned foreground); -extern unsigned lcd_remote_get_foreground(void); -extern void lcd_remote_set_background(unsigned background); -extern unsigned lcd_remote_get_background(void); -extern void lcd_remote_set_drawinfo(int mode, unsigned foreground, - unsigned background); -void lcd_remote_set_backdrop(fb_remote_data* backdrop); -fb_remote_data* lcd_remote_get_backdrop(void); - -extern void lcd_remote_mono_bitmap_part(const unsigned char *src, int src_x, - int src_y, int stride, int x, int y, - int width, int height); -extern void lcd_remote_mono_bitmap(const unsigned char *src, int x, int y, - int width, int height); -extern void lcd_remote_bitmap_transparent_part(const fb_remote_data *src, - int src_x, int src_y, - int stride, int x, int y, - int width, int height); -extern void lcd_bitmap_remote_transparent(const fb_remote_data *src, int x, - int y, int width, int height); -#else /* LCD_REMOTE_DEPTH == 1 */ -#define lcd_remote_mono_bitmap lcd_remote_bitmap -#define lcd_remote_mono_bitmap_part lcd_remote_bitmap_part -#endif /* LCD_REMOTE_DEPTH */ extern void lcd_remote_bmp_part(const struct bitmap* bm, int src_x, int src_y, int x, int y, int width, int height); extern void lcd_remote_bmp(const struct bitmap* bm, int x, int y); -#endif + #endif /* __LCD_REMOTE_H__ */ diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h b/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h index 6226f4462e..a214690aec 100644 --- a/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h +++ b/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h @@ -21,8 +21,6 @@ #ifndef LCD_REMOTE_TARGET_H #define LCD_REMOTE_TARGET_H -bool remote_detect(void); /* returns detection status */ - void lcd_remote_backlight(bool on); bool lcd_remote_read_device(unsigned char *data); diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h index ee3443b666..a3657490eb 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h +++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h @@ -26,8 +26,6 @@ void lcd_remote_powersave(bool on); -bool remote_detect(void); - #ifndef SIMULATOR void _remote_backlight_on(void); void _remote_backlight_off(void); diff --git a/firmware/target/coldfire/iaudio/lcd-remote-target.h b/firmware/target/coldfire/iaudio/lcd-remote-target.h index 435eee08c8..fe55212b81 100644 --- a/firmware/target/coldfire/iaudio/lcd-remote-target.h +++ b/firmware/target/coldfire/iaudio/lcd-remote-target.h @@ -24,7 +24,6 @@ #define REMOTE_INIT_LCD 1 #define REMOTE_DEINIT_LCD 2 -bool remote_detect(void); void lcd_remote_powersave(bool on); void lcd_remote_poweroff(void); /* for when remote is plugged during shutdown*/ diff --git a/firmware/target/coldfire/iaudio/m3/button-m3.c b/firmware/target/coldfire/iaudio/m3/button-m3.c index 308f656ad2..3c31c962c8 100644 --- a/firmware/target/coldfire/iaudio/m3/button-m3.c +++ b/firmware/target/coldfire/iaudio/m3/button-m3.c @@ -24,7 +24,7 @@ #include "button.h" #include "backlight.h" #include "adc.h" -#include "lcd-remote-target.h" +#include "lcd-remote.h" static bool hold_button = false; static bool remote_hold_button = false; diff --git a/firmware/target/coldfire/iaudio/m5/button-m5.c b/firmware/target/coldfire/iaudio/m5/button-m5.c index cccda5e598..6dbd2023f2 100644 --- a/firmware/target/coldfire/iaudio/m5/button-m5.c +++ b/firmware/target/coldfire/iaudio/m5/button-m5.c @@ -23,7 +23,7 @@ #include "button.h" #include "backlight.h" #include "adc.h" -#include "lcd-remote-target.h" +#include "lcd-remote.h" /* have buttons scan by default */ static bool button_scan_on = true; diff --git a/firmware/target/coldfire/iaudio/x5/button-x5.c b/firmware/target/coldfire/iaudio/x5/button-x5.c index c901105100..e1f68de36b 100644 --- a/firmware/target/coldfire/iaudio/x5/button-x5.c +++ b/firmware/target/coldfire/iaudio/x5/button-x5.c @@ -23,7 +23,7 @@ #include "button.h" #include "backlight.h" #include "adc.h" -#include "lcd-remote-target.h" +#include "lcd-remote.h" /* have buttons scan by default */ static bool button_scan_on = true; diff --git a/firmware/target/coldfire/iriver/lcd-remote-target.h b/firmware/target/coldfire/iriver/lcd-remote-target.h index 7e2b6f5940..85bc754143 100644 --- a/firmware/target/coldfire/iriver/lcd-remote-target.h +++ b/firmware/target/coldfire/iriver/lcd-remote-target.h @@ -29,6 +29,4 @@ void lcd_remote_emireduce(bool state); #endif void lcd_remote_powersave(bool on); -bool remote_detect(void); - #endif -- cgit v1.2.3