• 大小: 2.17 MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-10-25
  • 语言: Java
  • 标签: 指纹  android  

资源简介

指纹传感器FPC1080,在android下的驱动,详细的源代码。

资源截图

代码片段和文件信息

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 



/*local includes*/
#include “fpc_sensors.h“


/* ioctl */
#define MAGIC_NUMBER 255

#define SENSOR_COMM_ADDRESS_DUMMY_LENGTH _IOWR(MAGIC_NUMBER 1 u8*)
#define SENSOR_COMM_ADDRESS_VALUE _IOWR(MAGIC_NUMBER 2 u8*)
#define SENSOR_WAIT_IRQ _IOWR(MAGIC_NUMBER 3 u8*)
#define SENSOR_SET_MODE _IOWR(MAGIC_NUMBER 4 u8*)
#define SENSOR_RESET _IO(MAGIC_NUMBER 5)
#define SENSOR_GET_MODE _IOWR(MAGIC_NUMBER6u8*)

/* navigation modes */
#define NAVIGATION_ENABLED (1 << 0)
#define NAVIGATION_DIGITAL (1 << 1)
#define NAVIGATION_ENHANCED (1 << 2)

/* error codes for ioctl */
#define E_FPC_IRQ 501
#define E_FPC_SPI 502
#define E_FPC_IRQ_TIMEOUT 503


#define WAIT_DONE  0
#define WAIT_TIMEOUT 1

#define SPI_CLOCK_SPEED 10 * 1000 * 1000

/**
 * pin configuration for reset irq and power.
 * in a generic implementation FPC1080_POWER_GPIO should be left
 * undefined.
 */

#define FPC1080_RESET_GPIO 134
#define FPC1080_POWER_GPIO 157
#define FPC1080_IRQ_GPIO 133

/**
 * default navigation mode
 */
#define DEFAULT_NAVIGATION_MODE (NAVIGATION_ENABLED | NAVIGATION_DIGITAL)


static DECLARE_WAIT_QUEUE_HEAD(waiting_interrupt_return);
static int interrupt_done;


struct sensor_settings {
u8 fngrDwnMin;
u8 fngrDwnMid;
u8 fngrDwnMax;
u8 fngrDetThreshold;
u8 fngrLostThreshold;
u8 dXThreshold;
u8 dYThreshold;
u8 adcGain;
u8 adcOffset;
u8 colRdSpeed;
u8 clickXThresh;
u8 clickYThresh;
};

struct fpc1080_sensor {
struct spi_device* spi;
struct list_head   list;
struct cdev fpc1080_cdev;
wait_queue_head_t wg;
u32 reset_gpio;
u32 power_gpio;
u32 irq_gpio;
u32 irq;
u8 sensemode;
struct sensor_settings settings;
u8 *data;
u32 data_offset;
u32 avail_data;
struct input_dev *nav_dev;
struct task_struct *nav_task;
int t_running;
atomic_t available;
};


struct fpc1080_analog_data {
int x_prev;
int y_prev;
int long_click;
};

static struct fpc1080_analog_data analog_data;


static struct fpc1080_sensor sensor;

static struct sensor_settings navigation_settings = {
.fngrDwnMin = 50
.fngrDwnMid = 120
.fngrDwnMax = 255
.fngrDetThreshold = 25
.fngrLostThreshold = 25
.dXThreshold = 16
.dYThreshold = 16
.colRdSpeed = 5
};

static signed char xacc = 0;
static signed char yacc = 0;


static inline void abs_dec(int* x) {
if(!*x)
return;
if(*x > 0)
*x -= 1;
else
*x += 1;

}

static int fpc1080_wait_for_irq(int timeout)
{
int result;

result = wait_event_interruptible_timeout(waiting_interrupt_returninterrupt_done timeout);
if(result != 0) {
interrupt_done 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    4545340  2011-09-30 09:30  fpc1080_android_source\710-FPC1080A_F_Product-specification.pdf

     文件    1175592  2011-09-30 09:30  fpc1080_android_source\711-FPC1080_IntegrationGuide_General_B.PDF

     文件     146348  2011-04-15 09:33  fpc1080_android_source\FPC1080 Android driver and software implementation.docx

     文件      22322  2011-04-06 21:07  fpc1080_android_source\fpc1080_android_source\driver\fpc1080.c

     文件       3167  2011-03-31 22:46  fpc1080_android_source\fpc1080_android_source\driver\fpc_sensors.h

     文件        296  2011-04-06 19:23  fpc1080_android_source\fpc1080_android_source\driver\Makefile

     目录          0  2011-10-25 10:18  fpc1080_android_source\fpc1080_android_source\driver

     文件        289  2011-04-04 16:40  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\.classpath

     文件        810  2011-03-31 23:05  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\.project

     文件        618  2011-04-11 22:08  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\.settings\org.eclipse.jdt.core.prefs

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\.settings

     文件       1935  2011-04-07 16:39  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\AndroidManifest.xml

     文件        364  2011-04-11 22:09  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\default.properties

     文件        520  2011-04-15 15:31  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\Android.mk

     文件      13631  2011-04-15 15:32  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\fpc1080_interface.cpp

     文件       2475  2011-04-05 16:40  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\FPC4030.h

     文件     341750  2011-04-14 22:48  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\prebuilt\armeabi\libFPC4030.a

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\prebuilt\armeabi

     文件     321058  2011-04-14 22:40  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\prebuilt\armeabi-v7a\libFPC4030.a

     文件     324226  2011-04-14 22:40  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\prebuilt\armeabi-v7a\neon\libFPC4030.a

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\prebuilt\armeabi-v7a\neon

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\prebuilt\armeabi-v7a

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni\prebuilt

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\jni

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\libs\armeabi-v7a

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\libs

     文件       4147  2011-03-31 23:05  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\res\drawable-hdpi\icon.png

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\res\drawable-hdpi

     文件       1723  2011-03-31 23:05  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\res\drawable-ldpi\icon.png

     目录          0  2011-10-25 09:44  fpc1080_android_source\fpc1080_android_source\workspace\ExampleProject\res\drawable-ldpi

............此处省略27个文件信息

评论

共有 条评论