Latest changes

This commit is contained in:
mlt
2010-07-26 13:16:12 +00:00
committed by Godzil
parent e3c7c1b8b5
commit db805e563c
15 changed files with 1561 additions and 1648 deletions

View File

@@ -21,7 +21,7 @@
#ifndef AUOFB_IOCTL_H
#define AUOFB_IOCTL_H
#define AUO_FIRMWARE_VERSION 33
#define AUO_FIRMWARE_VERSION 39
#pragma pack(1)
typedef struct sAUOCommand_t
@@ -45,6 +45,8 @@ typedef struct sAUOCommand_t
#define IOCTL_AUO_POWERON (IOCTL_AUO_PREFIX | 0x05)
#define IOCTL_AUO_POWEROFF (IOCTL_AUO_PREFIX | 0x06)
#define IOCTL_AUO_UPDATEFW (IOCTL_AUO_PREFIX | 0x07)
#define IOCTL_AUO_PROGRESSBAR (IOCTL_AUO_PREFIX | 0x08)
#define IOCTL_AUO_WAITBUSY (IOCTL_AUO_PREFIX | 0x09)
/* Command definition *
* 3322 2222 2222 1111 1111 1100 0000 0000 *
@@ -68,7 +70,7 @@ typedef struct sAUOCommand_t
#define SET_AUO_COMMAND SET_AUO_WRITE_COMMAND
#define SET_AUO_READ_COMMAND(command, nb_param, have_data, need_wait) SET_AUO_COMMAND_EXT(command, nb_param, have_data, need_wait, 1)
#if (AUO_FIRMWARE_VERSION == 33) /* Command set for TCON firmware v33 */
#if (AUO_FIRMWARE_VERSION >= 33) /* Command set for TCON firmware v33 and more */
/* Initialisation commands */
#define AUOCMD_INIT_SET SET_AUO_COMMAND(0x0000, 1, 0, 1)
@@ -76,7 +78,7 @@ typedef struct sAUOCommand_t
#define AUOCMD_VCOM_FRAMERATE SET_AUO_COMMAND(0x0004, 1, 0, 0)
/* Power management */
#define AUOCMD_STANDBY SET_AUO_COMMAND(0x0001, 0, 0, 1)
#define AUOCMD_STANDBY SET_AUO_COMMAND(0x0001, 1, 0, 1)
#define AUOCMD_WAKEUP SET_AUO_COMMAND(0x0002, 0, 0, 0)
/* Display commands */
@@ -120,7 +122,6 @@ typedef struct sAUOCommand_t
#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 */
@@ -145,12 +146,12 @@ typedef struct sAUOCommand_t
#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)
#define GET_COMMAND_READ_WRITE(command) ((command >> 30) & 0x01)
#define AUOCMD_EQUAL(c,v) (((c) & 0xFFFF) == ((v) & 0xFFFF))
#endif /* AUOFB_IOCTL_H */

View File

@@ -1,10 +1,11 @@
// ===========================================================================
// cyio.h
// Cybook Event Manager - cyevent.h
// Copyright (C) 2008-2010 Bookeen - All rights reserved
// ===========================================================================
#define CYIO_EVENT_VERSION 1
#define CYEV_CURRENT_VERSION 0x10 /* 1.0 */
#pragma pack(1)
typedef struct sCyEvent_t
{
unsigned char type;
@@ -19,19 +20,26 @@ typedef struct sCyEvent_t
unsigned short y1;
unsigned short x2;
unsigned short y2;
} touch;
struct
{
unsigned char key_ascii;
} key;
unsigned char fingers;
} touch;
unsigned char key;
unsigned char orientation;
unsigned char timer_type;
} data;
} CyEvent_t;
#pragma pack()
#define NEW_CYEVENT(evType) { \
.type = evType, \
.flags = 0, \
.version = CYEV_CURRENT_VERSION, \
.data.raw = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }
enum
{
CYEVENT_TYPE_KEY = 'k',
CYEVENT_TYPE_TOUCH = 't',
CYEVENT_TYPE_ACCEL = 'a',
CYEVENT_TYPE_ORIENTATION = 'o',
CYEVENT_TYPE_TIMER = 'z',
CYEVENT_TYPE_SYSTEM = 's',
//CYIO_EVENT_ = '',
@@ -53,42 +61,69 @@ enum
#define CYEVENT_KEY_VOLN '-'
#define CYEVENT_KEY_TOGGLE_ACCEL 'a'
#define CYEVENT_KEY_FACTORY_RESET 'f'
#define CYEVENT_KEY_USB_IN 'p'
#define CYEVENT_KEY_USB_OUT 'P'
/* Timer event */
#define CYEVENT_TIMER_SCREEN 's'
#define CYEVENT_TIMER_DEVICE 'd'
/* Flags definitions */
/* Bit 7 to Bit 4 are event type dependent. If the event need more than 4 flags,
* it can use it's own "private" values
*/
/* Key event flags */
#define CYEVENT_FLAG_KEY_CONTROL_CHARS (1 << 7) /*** Signal that the current key is not a real key (ie not an ascii value) */
#define CYEVENT_FLAG_KEY_CONTROL_CHARS (1 << 7) /***< Signal that the current key is not a real key (ie not an ascii value) */
/* Touch event flags */
#define CYEVENT_FLAG_TOUCH_UP (0x1 << 6)
#define CYEVENT_FLAG_TOUCH_MOVE (0x2 << 6)
#define CYEVENT_FLAG_TOUCH_DOWN (0x3 << 6)
#define CYEVENT_FLASH_TOUCH_MASK (0x3 << 6)
#define CYEVENT_FLAG_TWO_FINGER_DOWN (1 << 5)
/* System Event */
#define CYEVENT_FLAG_USB_STATE (1 << 7) /*** If not set, the USB is unplugged */
#define CYEVENT_FLAG_AC_STATE (1 << 6) /*** If not set, the AC is unplugged */
#define CYEVENT_FLAG_AC_STATE (1 << 5) /*** If not set, the SD is unplugged */
/* Timer event */
#define CYEVENT_FLAG_TIMER_SCREEN (1 << 7)
#define CYEVENT_FLAG_TIMER_DEVICE (1 << 6)
#define CYEVENT_FLAG_USB_MESSAGE (0x0 << 6) /***< this is an USB event */
//#define CYEVENT_FLAG_AC_MESSAGE (0x1 << 6) /***< this is an AC event */
#define CYEVENT_FLAG_SD_MESSAGE (0x2 << 6) /***< this is a SD event */
#define CYEVENT_FLAG_SYS_STATUS (1 << 5) /***< this event is a plug (1) or unplug (0) event */
/* These bits are set by the implementation and should not be touched by the driver / receiver */
/* Bit 3 to Bit 2 are reserved (v1) */
#define CYEVENT_FLAG_ENDOFREPEAT (1 << 1)
#define CYEVENT_FLAG_REPEATEVENT (1 << 0)
// ===========================================================================
#ifdef __KERNEL__
// ===========================================================================
/* Exported function of CyEvent */
int CyEvent_PushNewEvent(CyEvent_t *CyEvent, char wantRepeat);
int CyEvent_PushNewUniqueEvent(CyEvent_t *CyEvent);
int CyEvent_PushOrUpdateUniqueEvent(CyEvent_t *CyEvent, char wantRepeat);
int CyEvent_PushOrUpdateUniqueEventFlaged(CyEvent_t *CyEvent, char wantRepeat, unsigned char flagMask);
int CyEvent_InvalidateUniqueEvent(CyEvent_t *CyEvent);
int CyEvent_InvalidateRepeatableEvent(CyEvent_t *CyEvent);
// ===========================================================================
typedef void (*callback_func)(void);
typedef void (*callback2_func)(unsigned char data);
typedef int (*ioctl_func)(unsigned int cmd, unsigned long arg);
typedef struct cyevent_device
{
callback_func resume, suspend, deepsleep;
callback2_func event_read;
callback_func event_listempty;
ioctl_func ioctl;
unsigned int ioctl_prefix;
unsigned char event_read_listen; /* 0 here mean all events */
} cyevent_device;
#define NEW_CYDEV() { .resume = NULL, .suspend = NULL, .deepsleep = NULL .ioctl = NULL,\
.event_listempty = NULL, .event_read = NULL, .event_read_listen = 0, }
#define IOCTL_PFX(c) ((c & 0xFF) << 8)
int CyEvent_RegisterDevice(cyevent_device *dev);
int CyEvent_DeregisterDevice(cyevent_device *dev);
// ===========================================================================
#endif
// ===========================================================================
/* TODO: This part should be moved elsewhere... */
// ===========================================================================
/* Non directly CyIO related values, but used for the Accelerometer */
@@ -106,3 +141,23 @@ enum
CYGSENSOR_STATUS_CRITICALERROR = 6, /** If we are in this status, the G-Sensor is non working: possible cause, defective chip */
CYGSENSOR_STATUS_SUSPENDED = 7, /** The GSENSOR was on, the device go to deepsleep, so we go in this state. */
};
#define SET_IOCTL(c, v) (((c & 0xFF) << 8) | (v & 0xFF))
#define GET_IOCTL_PREFIX(c) (c & 0xFF00)
#define CYIO_CTL_LED_CMD SET_IOCTL('C', 'l')
#define CYIO_CTL_USB_STATUS SET_IOCTL('C', 'u')
#define CYIO_CTL_SD_STATUS SET_IOCTL('C', 's')
#define CYIO_CTL_PWRLED_CHANGE 0x002
#define CYIO_CTL_WFILED_CHANGE 0x020
#define CYIO_CTL_BTHLED_CHANGE 0x200
#define CYIO_CTL_PWRLED_SETON (CYIO_CTL_PWRLED_CHANGE | 0x001)
#define CYIO_CTL_WFILED_SETON (CYIO_CTL_WFILED_CHANGE | 0x010)
#define CYIO_CTL_BTHLED_SETON (CYIO_CTL_BTHLED_CHANGE | 0x100)
#define CYIO_CTL_PWRLED_SETOFF (CYIO_CTL_PWRLED_CHANGE | 0x000)
#define CYIO_CTL_WFILED_SETOFF (CYIO_CTL_WFILED_CHANGE | 0x000)
#define CYIO_CTL_BTHLED_SETOFF (CYIO_CTL_BTHLED_CHANGE | 0x000)