Fingerprint Scanner API using GT511C3 fingerprint scanner.

Dependencies:   4DGL-uLCD-SE GT511C3 SDFileSystem mbed

Fork of GT511C3test by Toshihisa T

The fingerprint scanner is designed to take attendance over a group of students. It requires a the group owner to store a preloaded list of student id numbers in a .txt file to the memory (SD card) in return of a 5 digits keypass to gain access to the database when taking attendance.

While there may exist multiple group owner and a group owner with multiple databases, each group will be uniquely identified by the 5 digits keypass. The program limits each scanner to open ONE session at a time where only one group will be able to take attendance during its session. Once a session is closed, a report of the attendance taken during the open session is generated and sent via ethernet to owner and there is no way to reopen the session again.

For the initial setup, each fingerprint database needs to be populated by the students. This set up can be done continuously during a session while taking attendance that session.

Committer:
yoshua0207
Date:
Tue Dec 01 19:10:10 2015 +0000
Revision:
8:a1ba925cf903
Current fingerprint scanner code.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yoshua0207 8:a1ba925cf903 1 /*! \file avrlibdefs.h \brief AVRlib global defines and macros. */
yoshua0207 8:a1ba925cf903 2 //*****************************************************************************
yoshua0207 8:a1ba925cf903 3 //
yoshua0207 8:a1ba925cf903 4 // File Name : 'avrlibdefs.h'
yoshua0207 8:a1ba925cf903 5 // Title : AVRlib global defines and macros include file
yoshua0207 8:a1ba925cf903 6 // Author : Pascal Stang
yoshua0207 8:a1ba925cf903 7 // Created : 7/12/2001
yoshua0207 8:a1ba925cf903 8 // Revised : 9/30/2002
yoshua0207 8:a1ba925cf903 9 // Version : 1.1
yoshua0207 8:a1ba925cf903 10 // Target MCU : Atmel AVR series
yoshua0207 8:a1ba925cf903 11 // Editor Tabs : 4
yoshua0207 8:a1ba925cf903 12 //
yoshua0207 8:a1ba925cf903 13 // Description : This include file is designed to contain items useful to all
yoshua0207 8:a1ba925cf903 14 // code files and projects, regardless of specific implementation.
yoshua0207 8:a1ba925cf903 15 //
yoshua0207 8:a1ba925cf903 16 // This code is distributed under the GNU Public License
yoshua0207 8:a1ba925cf903 17 // which can be found at http://www.gnu.org/licenses/gpl.txt
yoshua0207 8:a1ba925cf903 18 //
yoshua0207 8:a1ba925cf903 19 //*****************************************************************************
yoshua0207 8:a1ba925cf903 20
yoshua0207 8:a1ba925cf903 21
yoshua0207 8:a1ba925cf903 22 #ifndef AVRLIBDEFS_H
yoshua0207 8:a1ba925cf903 23 #define AVRLIBDEFS_H
yoshua0207 8:a1ba925cf903 24
yoshua0207 8:a1ba925cf903 25 //#define F_CPU 4000000
yoshua0207 8:a1ba925cf903 26 #define MEM_TYPE 1
yoshua0207 8:a1ba925cf903 27
yoshua0207 8:a1ba925cf903 28 // Code compatibility to new AVR-libc
yoshua0207 8:a1ba925cf903 29 // outb(), inb(), inw(), outw(), BV(), sbi(), cbi(), sei(), cli()
yoshua0207 8:a1ba925cf903 30 #ifndef outb
yoshua0207 8:a1ba925cf903 31 #define outb(addr, data) addr = (data)
yoshua0207 8:a1ba925cf903 32 #endif
yoshua0207 8:a1ba925cf903 33 #ifndef inb
yoshua0207 8:a1ba925cf903 34 #define inb(addr) (addr)
yoshua0207 8:a1ba925cf903 35 #endif
yoshua0207 8:a1ba925cf903 36 #ifndef outw
yoshua0207 8:a1ba925cf903 37 #define outw(addr, data) addr = (data)
yoshua0207 8:a1ba925cf903 38 #endif
yoshua0207 8:a1ba925cf903 39 #ifndef inw
yoshua0207 8:a1ba925cf903 40 #define inw(addr) (addr)
yoshua0207 8:a1ba925cf903 41 #endif
yoshua0207 8:a1ba925cf903 42 #ifndef BV
yoshua0207 8:a1ba925cf903 43 #define BV(bit) (1<<(bit))
yoshua0207 8:a1ba925cf903 44 #endif
yoshua0207 8:a1ba925cf903 45 //#ifndef cbi
yoshua0207 8:a1ba925cf903 46 // #define cbi(reg,bit) reg &= ~(BV(bit))
yoshua0207 8:a1ba925cf903 47 //#endif
yoshua0207 8:a1ba925cf903 48 //#ifndef sbi
yoshua0207 8:a1ba925cf903 49 // #define sbi(reg,bit) reg |= (BV(bit))
yoshua0207 8:a1ba925cf903 50 //#endif
yoshua0207 8:a1ba925cf903 51 #ifndef cli
yoshua0207 8:a1ba925cf903 52 #define cli() __asm__ __volatile__ ("cli" ::)
yoshua0207 8:a1ba925cf903 53 #endif
yoshua0207 8:a1ba925cf903 54 #ifndef sei
yoshua0207 8:a1ba925cf903 55 #define sei() __asm__ __volatile__ ("sei" ::)
yoshua0207 8:a1ba925cf903 56 #endif
yoshua0207 8:a1ba925cf903 57
yoshua0207 8:a1ba925cf903 58 // support for individual port pin naming in the mega128
yoshua0207 8:a1ba925cf903 59 // see port128.h for details
yoshua0207 8:a1ba925cf903 60 #ifdef __AVR_ATmega128__
yoshua0207 8:a1ba925cf903 61 // not currently necessary due to inclusion
yoshua0207 8:a1ba925cf903 62 // of these defines in newest AVR-GCC
yoshua0207 8:a1ba925cf903 63 // do a quick test to see if include is needed
yoshua0207 8:a1ba925cf903 64 #ifndef PD0
yoshua0207 8:a1ba925cf903 65 //#include "port128.h"
yoshua0207 8:a1ba925cf903 66 #endif
yoshua0207 8:a1ba925cf903 67 #endif
yoshua0207 8:a1ba925cf903 68
yoshua0207 8:a1ba925cf903 69 // use this for packed structures
yoshua0207 8:a1ba925cf903 70 // (this is seldom necessary on an 8-bit architecture like AVR,
yoshua0207 8:a1ba925cf903 71 // but can assist in code portability to AVR)
yoshua0207 8:a1ba925cf903 72 #define GNUC_PACKED __attribute__((packed))
yoshua0207 8:a1ba925cf903 73
yoshua0207 8:a1ba925cf903 74 // port address helpers
yoshua0207 8:a1ba925cf903 75 #define DDR(x) ((x)-1) // address of data direction register of port x
yoshua0207 8:a1ba925cf903 76 #define PIN(x) ((x)-2) // address of input register of port x
yoshua0207 8:a1ba925cf903 77
yoshua0207 8:a1ba925cf903 78 // MIN/MAX/ABS macros
yoshua0207 8:a1ba925cf903 79 #define MIN(a,b) ((a<b)?(a):(b))
yoshua0207 8:a1ba925cf903 80 #define MAX(a,b) ((a>b)?(a):(b))
yoshua0207 8:a1ba925cf903 81 #define ABS(x) ((x>0)?(x):(-x))
yoshua0207 8:a1ba925cf903 82
yoshua0207 8:a1ba925cf903 83 // constants
yoshua0207 8:a1ba925cf903 84 #define PI 3.14159265359
yoshua0207 8:a1ba925cf903 85
yoshua0207 8:a1ba925cf903 86 #endif