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.

defs.h

Committer:
yoshua0207
Date:
2015-12-01
Revision:
8:a1ba925cf903

File content as of revision 8:a1ba925cf903:

/*! \file avrlibdefs.h \brief AVRlib global defines and macros. */
//*****************************************************************************
//
// File Name    : 'avrlibdefs.h'
// Title        : AVRlib global defines and macros include file
// Author       : Pascal Stang
// Created      : 7/12/2001
// Revised      : 9/30/2002
// Version      : 1.1
// Target MCU   : Atmel AVR series
// Editor Tabs  : 4
//
//  Description : This include file is designed to contain items useful to all
//                  code files and projects, regardless of specific implementation.
//
// This code is distributed under the GNU Public License
//      which can be found at http://www.gnu.org/licenses/gpl.txt
//
//*****************************************************************************


#ifndef AVRLIBDEFS_H
#define AVRLIBDEFS_H

//#define F_CPU 4000000
#define MEM_TYPE 1

// Code compatibility to new AVR-libc
// outb(), inb(), inw(), outw(), BV(), sbi(), cbi(), sei(), cli()
#ifndef outb
    #define outb(addr, data)    addr = (data)
#endif
#ifndef inb
    #define inb(addr)           (addr)
#endif
#ifndef outw
    #define outw(addr, data)    addr = (data)
#endif
#ifndef inw
    #define inw(addr)           (addr)
#endif
#ifndef BV
    #define BV(bit)         (1<<(bit))
#endif
//#ifndef cbi
//  #define cbi(reg,bit)    reg &= ~(BV(bit))
//#endif
//#ifndef sbi
//  #define sbi(reg,bit)    reg |= (BV(bit))
//#endif
#ifndef cli
    #define cli()           __asm__ __volatile__ ("cli" ::)
#endif
#ifndef sei
    #define sei()           __asm__ __volatile__ ("sei" ::)
#endif

// support for individual port pin naming in the mega128
// see port128.h for details
#ifdef __AVR_ATmega128__
// not currently necessary due to inclusion
// of these defines in newest AVR-GCC
// do a quick test to see if include is needed
#ifndef PD0
    //#include "port128.h"
#endif
#endif

// use this for packed structures
// (this is seldom necessary on an 8-bit architecture like AVR,
//  but can assist in code portability to AVR)
#define GNUC_PACKED __attribute__((packed)) 

// port address helpers
#define DDR(x) ((x)-1)    // address of data direction register of port x
#define PIN(x) ((x)-2)    // address of input register of port x

// MIN/MAX/ABS macros
#define MIN(a,b)            ((a<b)?(a):(b))
#define MAX(a,b)            ((a>b)?(a):(b))
#define ABS(x)              ((x>0)?(x):(-x))

// constants
#define PI      3.14159265359

#endif