summaryrefslogtreecommitdiffstats
blob: afccb1d2fa0c192b2b325fe9c4572f9f7ddeb5e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 *	2013 @ Texas Intruments, Inc.
 *
*/

#define	HAPTICS_VERSION		"Version : 2.02 (30th, May, 2014)"

enum Haptic_Target{
	HAPTIC_DRVXXXX,
	HAPTIC_DRV2604,
	HAPTIC_DRV2604L,
	HAPTIC_DRV2605,
	HAPTIC_DRV2605L,
	HAPTIC_DRV2667,
	HAPTIC_DRV2669
};

#define	FIFO_PBK_BYTES_LEN			100
#define	DRV2604_RAM_SIZE			(2*1024)
#define	MAX_READ_BYTES				0xff

/* Commands */
#define HAPTIC_CMDID_PLAY_SINGLE_EFFECT     0x01
#define HAPTIC_CMDID_PLAY_EFFECT_SEQUENCE   0x02
#define HAPTIC_CMDID_PLAY_TIMED_EFFECT      0x03
#define HAPTIC_CMDID_GET_DEV_ID             0x04
#define HAPTIC_CMDID_RUN_DIAG               0x05
#define HAPTIC_CMDID_AUDIOHAPTIC_ENABLE     0x06
#define HAPTIC_CMDID_AUDIOHAPTIC_DISABLE    0x07
#define HAPTIC_CMDID_AUDIOHAPTIC_GETSTATUS  0x08

#define HAPTIC_CMDID_REG_WRITE  	0x09
#define HAPTIC_CMDID_REG_READ   	0x0a
#define HAPTIC_CMDID_REG_SETBIT  	0x0b
#define HAPTIC_CMDID_PATTERN_RTP      0x0c
#define HAPTIC_CMDID_RTP_SEQUENCE	  0x0d
#define HAPTIC_CMDID_PLAY_FIFO				0x0e
#define HAPTIC_CMDID_ANALOG_INPUT			0x0f
#define HAPTIC_CMDID_GET_EFFECT_COUNT		0x10
#define HAPTIC_CMDID_UPDATE_FIRMWARE		0x11
#define HAPTIC_CMDID_READ_FIRMWARE			0x12
#define HAPTIC_CMDID_STOP                   0xFF

/* Command size */
#define HAPTIC_CMDSZ_SINGLE_EFFECT     2
#define HAPTIC_CMDSZ_EFFECT_SEQUENCE   9
#define HAPTIC_CMDSZ_TIMED_EFFECT      3
#define HAPTIC_CMDSZ_STOP              1

#define MAX_TIMEOUT 10000 /* 10s */
#define REGS_TOTAL 0x23

#define	RTP_DURATION_MAX			10000 //ms

#define ARRAY_LEN(x) ((int)(sizeof(x)/sizeof((x)[0])))