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
This commit is contained in:
Rafaël Carré 2012-01-07 19:07:36 +00:00
parent 666f2e61f0
commit 50f96943be
8 changed files with 61 additions and 62 deletions

View file

@ -27,7 +27,7 @@
#include "config.h" #include "config.h"
#include "lcd.h" #include "lcd.h"
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD /* Not for the players with *only* a remote LCD (m3) */
#ifndef __PCTOOL__ #ifndef __PCTOOL__
#include "lcd-remote-target.h" #include "lcd-remote-target.h"
@ -61,17 +61,6 @@ typedef unsigned long fb_remote_data;
#define FB_RDATA_SZ 4 #define FB_RDATA_SZ 4
#endif #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 */ #if LCD_REMOTE_DEPTH > 1 /* greyscale - 8 bit max */
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
extern unsigned lcd_remote_color_to_native(unsigned 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 #ifndef LCD_REMOTE_FBHEIGHT
#define LCD_REMOTE_FBHEIGHT LCD_REMOTE_HEIGHT #define LCD_REMOTE_FBHEIGHT LCD_REMOTE_HEIGHT
#endif #endif
/* The actual framebuffer */ /* The actual framebuffer */
extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_FBHEIGHT][LCD_REMOTE_FBWIDTH]; 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_init_device(void);
void lcd_remote_on(void); void lcd_remote_on(void);
void lcd_remote_off(void); void lcd_remote_off(void);
extern bool remote_initialized; extern bool remote_initialized;
bool remote_detect(void);
extern void lcd_remote_init(void); extern void lcd_remote_init(void);
extern int lcd_remote_default_contrast(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_getfont(void);
extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); 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_drawpixel(int x, int y);
extern void lcd_remote_drawline(int x1, int y1, int x2, int y2); extern void lcd_remote_drawline(int x1, int y1, int x2, int y2);
extern void lcd_remote_hline(int x1, int x2, int y); 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_fillrect(int x, int y, int width, int height);
extern void lcd_remote_draw_border_viewport(void); extern void lcd_remote_draw_border_viewport(void);
extern void lcd_remote_fill_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_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_putsxyf(int x, int y, const unsigned char *fmt, ...);
extern void lcd_remote_bidir_scroll(int threshold); extern void lcd_remote_bidir_scroll(int threshold);
extern void lcd_remote_scroll_step(int pixels); 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, extern void lcd_remote_bmp_part(const struct bitmap* bm, int src_x, int src_y,
int x, int y, int width, int height); int x, int y, int width, int height);
extern void lcd_remote_bmp(const struct bitmap* bm, int x, int y); extern void lcd_remote_bmp(const struct bitmap* bm, int x, int y);
#endif
#endif /* __LCD_REMOTE_H__ */ #endif /* __LCD_REMOTE_H__ */

View file

@ -21,8 +21,6 @@
#ifndef LCD_REMOTE_TARGET_H #ifndef LCD_REMOTE_TARGET_H
#define LCD_REMOTE_TARGET_H #define LCD_REMOTE_TARGET_H
bool remote_detect(void); /* returns detection status */
void lcd_remote_backlight(bool on); void lcd_remote_backlight(bool on);
bool lcd_remote_read_device(unsigned char *data); bool lcd_remote_read_device(unsigned char *data);

View file

@ -26,8 +26,6 @@
void lcd_remote_powersave(bool on); void lcd_remote_powersave(bool on);
bool remote_detect(void);
#ifndef SIMULATOR #ifndef SIMULATOR
void _remote_backlight_on(void); void _remote_backlight_on(void);
void _remote_backlight_off(void); void _remote_backlight_off(void);

View file

@ -24,7 +24,6 @@
#define REMOTE_INIT_LCD 1 #define REMOTE_INIT_LCD 1
#define REMOTE_DEINIT_LCD 2 #define REMOTE_DEINIT_LCD 2
bool remote_detect(void);
void lcd_remote_powersave(bool on); void lcd_remote_powersave(bool on);
void lcd_remote_poweroff(void); /* for when remote is plugged during shutdown*/ void lcd_remote_poweroff(void); /* for when remote is plugged during shutdown*/

View file

@ -24,7 +24,7 @@
#include "button.h" #include "button.h"
#include "backlight.h" #include "backlight.h"
#include "adc.h" #include "adc.h"
#include "lcd-remote-target.h" #include "lcd-remote.h"
static bool hold_button = false; static bool hold_button = false;
static bool remote_hold_button = false; static bool remote_hold_button = false;

View file

@ -23,7 +23,7 @@
#include "button.h" #include "button.h"
#include "backlight.h" #include "backlight.h"
#include "adc.h" #include "adc.h"
#include "lcd-remote-target.h" #include "lcd-remote.h"
/* have buttons scan by default */ /* have buttons scan by default */
static bool button_scan_on = true; static bool button_scan_on = true;

View file

@ -23,7 +23,7 @@
#include "button.h" #include "button.h"
#include "backlight.h" #include "backlight.h"
#include "adc.h" #include "adc.h"
#include "lcd-remote-target.h" #include "lcd-remote.h"
/* have buttons scan by default */ /* have buttons scan by default */
static bool button_scan_on = true; static bool button_scan_on = true;

View file

@ -29,6 +29,4 @@ void lcd_remote_emireduce(bool state);
#endif #endif
void lcd_remote_powersave(bool on); void lcd_remote_powersave(bool on);
bool remote_detect(void);
#endif #endif