📄 main_demo.c
字号:
/****************************************************************************
*
*
* TEXAS INSTRUMENTS PROPRIETARY INFORMATION
*
* (c) Copyright, Texas Instruments Incorporated, 2003.
* All Rights Reserved.
*
* Property of Texas Instruments Incorporated. Restricted Rights -
* Use, duplication, or disclosure is subject to restrictions set
* forth in TI's program license agreement and associated documentation.
*
*****************************************************************************
*****************************************************************************
*
* NAME: main.c
*
*
* DESCRIPTION: main file to test the image readout from Fingerprint Card FPC1010 sensor
*
*
* CREATED: 05/20/2002
* MODIFIED: 06/13/2003
*
*
* COMPILATION: CCS 2.12.07
*
*
****************************************************************************/
/* Include files */
#include <csl.h>
#include <stdio.h>
#include "dsk5510.h"
#include "dsk5510_led.h"
#include "fpc1010.h"
#include "spi.h"
//The fingerprint is 152*200 bytes, but an area of
//208*160 bytes needs to be allocated for the fingerprint
#pragma DATA_SECTION(image,"imagebuf")
unsigned char image[208][160];
/* Global Variables used for gel file */
unsigned captureFP=0,exitDemo=0;
/*Function needed for GEL control*/
void dummyFunc(void)
{
}
void main(void)
{
unsigned pcrValue = 0x0A0C;// FSXM=1,CLKXM=1, FSXP and FSRP=1
unsigned freq = 0x0045; //CLKGDV = 69, 200Mhz/(1+CLKGDV)=2.8571Mhz
unsigned xcr2Value = 0x0005;
unsigned char *imageptr;
/* Call BSL init */
/*Sets all CPLD registers to their power-on states
and initializes internal BSL data structures. Must be called
before any other BSL functions.*/
DSK5510_init();
/*Initialize the LED module. Must be called before any LED functions.*/
DSK5510_LED_init();
/*Initialize CSL*/
CSL_init();
/*To connect DSP's TIN0 and TIN1 (timer)signals as
outputs to the peripheral expansion connectors */
DSK5510_rset(DSK5510_MISC , 0xC);
/*Timer 1 and Timer 0 are used to Enable/Disable and Set/Reset Sensor*/
/* Configure timer pin function to be General Purpose output, by setting
the FUNC bits (bit(s) 12-11) of Timer Control Registers (TCR1 and TCR0) as 10b */
*(volatile unsigned ioport *)0x1002 = 0x1000;
*(volatile unsigned ioport *)0x2402 = 0x1000;
/*Initialize McBSP0 for SPI communication, McBSP as Master*/
//2.8571 Mhz
SPI_init(pcrValue,freq,xcr2Value);
imageptr = &image[0][0];
//Most printf statements are commented out, as they occupy extra memory
/*printf (" To capture fingerprint: \n");
printf (" Place your finger on the sensor \n");
printf (" Under Menu GEL , choose>> DemoMenu->CaptureFingerPrint \n");
printf (" ====================================================== \n");*/
waitForFP:
while(!captureFP){
if(exitDemo) { /* user want to exit the demo ? */
printf (" Exiting the Demo for FPC1010 on 5510DSK... \n");
exit(); }
}
captureFP=0;
printf (" Capturing Image...\n");
/* The sensor has to be initialized before every call to the read image function */
sensorInit();
/*Read complete image from the sensor*/
readImage(imageptr);
printf (" Reading Done. You may remove your finger.\n");
/*printf (" ****************************************************** \n");
printf (" To recapture fingerprint: \n");
printf (" Place your finger on the sensor \n");
printf (" GEL>> DemoMenu->CaptureFingerPrint \n");
printf (" ====================================================== \n");
printf (" To Exit Demo: \n");
printf (" Under Menu GEL , choose>> DemoMenu->ExitDemo \n");
printf (" ====================================================== \n");*/
dummyFunc(); /* dummy function for refeshing the image */
goto waitForFP; //infinite loop
} /* End of main() */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -