]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - tas2557sw-android/tas2557-android-driver.git/blob - tiload.h
first release
[tas2557sw-android/tas2557-android-driver.git] / tiload.h
1 /*
2 ** =============================================================================
3 ** Copyright (c) 2016  Texas Instruments Inc.
4 **
5 ** This program is free software; you can redistribute it and/or modify it under
6 ** the terms of the GNU General Public License as published by the Free Software 
7 ** Foundation; version 2.
8 **
9 ** This program is distributed in the hope that it will be useful, but WITHOUT
10 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 ** FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 **
13 ** You should have received a copy of the GNU General Public License along with
14 ** this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 ** Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 **
17 ** File:
18 **     tiload.h
19 **
20 ** Description:
21 **     header file for tiload.c
22 **
23 ** =============================================================================
24 */
26 #ifndef _TILOAD_H
27 #define _TILOAD_H
29 #include "tas2557.h"
31 #define BPR_REG(book, page, reg)                (((book * 256 * 128) + \
32                                                  (page * 128)) + reg)
34 /* typedefs required for the included header files */
35 typedef char *string;
37 typedef struct {
38         unsigned char nBook;
39         unsigned char nPage;
40         unsigned char nRegister;
41 } BPR;
43 /* defines */
44 #define DEVICE_NAME     "tiload_node"
45 #define TILOAD_IOC_MAGIC   0xE0
46 #define TILOAD_IOMAGICNUM_GET                   _IOR(TILOAD_IOC_MAGIC, 1, int)
47 #define TILOAD_IOMAGICNUM_SET                   _IOW(TILOAD_IOC_MAGIC, 2, int)
48 #define TILOAD_BPR_READ                                 _IOR(TILOAD_IOC_MAGIC, 3, BPR)
49 #define TILOAD_BPR_WRITE                                _IOW(TILOAD_IOC_MAGIC, 4, BPR)
50 #define TILOAD_IOCTL_SET_CONFIG                 _IOW(TILOAD_IOC_MAGIC, 5, int)
51 #define TILOAD_IOCTL_SET_CALIBRATION    _IOW(TILOAD_IOC_MAGIC, 6, int)
53 int tiload_driver_init(struct tas2557_priv *pTAS2557);
55 #endif