/* * auofb_ioctl.h * * Copyright 2009 Bookeen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef AUOFB_IOCTL_H #define AUOFB_IOCTL_H #pragma pack(1) typedef struct sAUOCommand_t { unsigned long cmd; unsigned short params[5]; unsigned long datalen; unsigned short *data; } sAUOCommand; #pragma pack() /* [MTR]: Epson_S1D13521 Like command interface for AUO TCON K1900 */ #define IOCTL_AUO_PREFIX ('A' << 8) #define IOCTL_AUO_SENDCOMMAND (IOCTL_AUO_PREFIX | 0x01) /* Command definition * * 3322 2222 2222 1111 1111 1100 0000 0000 * * 1098 7654 3210 9876 5432 1098 7654 3210 * * --------------------------------------- * * WD pppp CCCC CCCC CCCC CCCC * * * W = 'need_wait' * D = 'have_data' * p = 'nb_param' * C = "command" */ #define SET_AUO_COMMAND(command, nb_param, have_data, need_wait) \ ( ((need_wait & 0x01) << 29) |\ ((have_data & 0x01) << 28) |\ ((nb_param & 0x0F) << 20) |\ (command & 0xFFFF) ) #define AUOCMD_INIT_SET SET_AUO_COMMAND(0x0000, 1, 0, 1) #define AUOCMD_STANDBY SET_AUO_COMMAND(0x0001, 0, 0, 1) #define AUOCMD_WAKEUP SET_AUO_COMMAND(0x0002, 0, 0, 0) #define AUOCMD_DISPLAY_START SET_AUO_COMMAND(0x1001, 4, 1, 1) #define AUOCMD_DISPLAY_STOP SET_AUO_COMMAND(0x1002, 0, 0, 1) #define AUOCMD_DISPLAY_REFRESH SET_AUO_COMMAND(0x1004, 0, 0, 1) #define AUOCMD_DISPLAY_RESET SET_AUO_COMMAND(0x1005, 0, 0, 1) //#define AUOCMD_LUMINANCE_BALANCE SET_AUO_COMMAND(0x5001, 1, 0, 1) //#define AUOCMD_AGING_MODE SET_AUO_COMMAND(0x6000, 0, 0, 1) //#define AUOCMD_AGING_MODE_EXIT SET_AUO_COMMAND(0x6001, 0, 0, 1) //#define AUOCMD_POWER_CONTROL SET_AUO_COMMAND(0x7000, 2, 0, 1) #define AUO_DSPPARAM_FLASH (1 << 15) #define AUO_DSPPARAM_MODE_GRAYwFLASH (0x00 << 12) /* Mode 0: Gray 4bit With Flash */ #define AUO_DSPPARAM_MODE_GRAYnFLASH (0x01 << 12) /* Mode 1: Gray 4bit Without flash */ #define AUO_DSPPARAM_MODE_TEXT (0x02 << 12) /* Mode 2: Text mode 2bit */ #define AUO_DSPPARAM_MODE_HIGHSPEED (0x03 << 12) /* Mode 3: Highspeed mode 1bit */ #define AUO_DSPPARAM_MODE_HANDWRITE (0x04 << 12) /* Mode 4: Handwriting mode 1bit */ #define AUO_DSPPARAM_MODE_AUTOSELECT (0x05 << 12) /* Mode 5: Autoselect mode */ /* INIT_SET command parameters */ #define AUO_INITPARAM_OUT_DATA_ARR (0x01 << 5) /* Set to 0 (default) for normal, 1 for inverse byte order */ #define AUO_INITPARAM_RESOL_800x600 (0x00 << 2) /* Set to 800x600 (default) */ #define AUO_INITPARAM_RESOL_1024x768 (0x01 << 2) /* Set to 1024x768 */ #define AUO_INITPARAM_RESOL_600x800 (0x04 << 2) /* Set to 600x800 */ #define AUO_INITPARAM_RESOL_768x1024 (0x05 << 2) /* Set to 768x1024 */ #define AUO_INITPARAM_UD_FUNC (0x01 << 1) /* Set to 0 (default) to scan down, 1 to scan up */ #define AUO_INITPARAM_SHL_FUNC (0x01 << 0) /* Set to 0 to shift left, 1 (default) to scan right */ #define AUO_INITPARAM_IN_DATA_ARR (0x01 << 6) /* Set to 0 (default) for normal, 1 for inverse byte order */ #define AUO_INITPARAM_INV_DISPLAY (0x01 << 9) /* Set to 0 (default) for normal colors, 1 for inversed colors */ #define AUO_INITPARAM_ROTATION_000 (0x00 << 10) /* Set the rotation to 0° (0) */ #define AUO_INITPARAM_ROTATION_090 (0x01 << 10) /* Set the rotation to 90° (PI/2) */ #define AUO_INITPARAM_ROTATION_180 (0x02 << 10) /* Set the rotation to 180° (PI) */ #define AUO_INITPARAM_ROTATION_270 (0x03 << 10) /* Set the rotation to 270° (1.5*PI) */ #define AUO_INITPARAM_DATA_FILTER (0x01 << 12) /* Data filter (1: active, 0: inactive) */ #define AUO_INITPARAM_TEMP_AVERAGE (0x01 << 13) /* Temperature average (1: active, 0: inactive) */ int Epaper_sendCommand(sAUOCommand *cmd); /* Please, do not use these #define s */ #define GET_COMMAND_PARAM_NUM(command) ((command >> 20) & 0x0F) #define GET_COMMAND_HAVE_DATA(command) ((command >> 28) & 0x01) #define GET_COMMAND_NEED_WAIT(command) ((command >> 29) & 0x01) #endif /* AUOFB_IOCTL_H */