亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? letext_324.c

?? Source Code Source Code Source Code Source Code Source Code Source Code Source Code Source Code Sour
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* +-------------------------------------------------------------------+ */
/* | Project : 1910.001 441GA01-T (External Reader RFID 125KHz)        | */
/* | Module  : LetExt_324.c                                            | */
/* | Author  : Lucio Faustinelli                                       | */
/* | Company : AVE S.p.A.                                              | */
/* | Released: June, 27 2008                                           | */
/* | Revision: YZ060.01 (FW - Revised)                                 | */
/* | Revision: YZ062.00 (EEPROM - First Official Release)              | */
/* | Revised : September, 04 2008                                      | */
/* | Revisor : AVE S.p.A. (Lucio FAUSTINELLI)                          | */
/* | Notes   : --------------                                          | */
/* +-------------------------------------------------------------------+ */
/* | Purpose : This module contains all the functions needed to manage | */
/* |           the external card reader (included ISR routines)        | */
/* +-------------------------------------------------------------------+ */
/* | Resources: TIMER0: Generates system tick (baser timers)           | */
/* |            TIMER2: Manages timeouts for the room bus (RS-485)     | */
/* |            USART0: Allows data communication to/from other devices| */
/* +-------------------------------------------------------------------+ */
/* | Functions: ISR( USART0_RX_vect )                                  | */
/* |           ISR( TIMER0_COMPA_vect )                                | */
/* |           ISR( TIMER2_COMPA_vect )                                | */
/* |           ISR( TIMER2_COMPB_vect )                                | */
/* +-------------------------------------------------------------------+ */
/* |            void cardIsNotOK( void )                               | */
/* |            void cardIsOK( uint8_t setType )                       | */
/* |            uint8_t	tryAccessByZone( void )                        | */
/* |            uint8_t readInput( void )                              | */
/* |            int main( void )                                       | */
/* |            void rstNoMaster( uint8_t sendReset )                  | */
/* |            void cardIsMaster( void )                              | */
/* |            void next_led_st( uint8_t, uint8_t, uint8_t )          | */
/* |            void nextMasterState( uint8_t typ )                    | */
/* |            uint8_t ManageMaster( void )                           | */
/* |            void luci_OFF( void )                                  | */
/* |            void luci_ON( uint8_t timed )                          | */
/* |            void onSerratura( void )                               | */
/* |            void buzzer_on( void )                                 | */
/* |            void _LED_( uint8_t led_on, uint8_t led_off )          | */
/* |            void delay_us( uint16_t __count )                      | */
/* |            void delay_ms( uint8_t t )                             | */
/* |            void search4commands( void )                           | */
/* |            void put485( uint8_t * s )                             | */
/* |            void tx_485frame( void )                               | */
/* |            uint8_t* put_CM( uint8_t *p )                          | */
/* |            void compute_CRC( uint8_t *s )                         | */
/* |            uint8_t analyse_cmd485( uint8_t *s )                   | */
/* |            void send_PC_resp( uint8_t *s )                        | */
/* |            void analyze_res485( uint8_t *s )                      | */
/* |            void tx_485resp( uint8_t *s )                          | */
/* |            uint8_t check_485addr( uint8_t * s )                   | */
/* |            uint8_t check_CRC( uint8_t *s, uint8_t len )           | */
/* |            uint8_t get485( uint8_t * s )                          | */
/* |            void initTIMER0( void )                                | */
/* |            void initTIMER2( void )                                | */
/* |            void startT2( uint8_t AorB )                           | */
/* |            void initUART0( uint16_t baud )                        | */
/* |            void putc0( uint8_t c )                                | */
/* |            uint8_t getc0( void )                                  | */
/* +-------------------------------------------------------------------+ */

/* +-------------------------------------------------------------------+ */
/* |                      F W   R E V I S I O N S                      | */
/* +-------------------------------------------------------------------+ */

// R e v i s i o n   0 0
// =====================
// Prima release ufficiale

/* +-------------------------------------------------------------------+ */
/* |                         I N C L U D E S                           | */
/* +-------------------------------------------------------------------+ */
// G L O B A L
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <util/crc16.h>
#include <avr/boot.h>
#include <avr/sleep.h>
// L O C A L S
#include "LetExtDef.h"
#include "CardMifare.h"

/* +-------------------------------------------------------------------+ */
/* |                          D E F I N E S                            | */
/* +-------------------------------------------------------------------+ */
// C P U   C l o c k
#ifndef F_CPU
#define F_CPU 				11059200L
#endif
// C o m p u t e   O C R   v a l u e
#define NCHAR_10			39L				// uguale a 11 *3.5
#define	T2_PRESCALER		32L
#define BUZ_FREQ			9000L
#define _STOPTIMER2			( TCCR2B &= ~( _BV( CS22 ) | _BV( CS21 ) | _BV( CS20 ) ) )
// C o m p u t e   T I M E   ( T I M E R 0 )
#define TIMER0_FREQUENCY 	50			// 10ms
#define TIMER0_PRESCALER    1024UL		// 1, 8, 64, 256, 1024
#define TIMER0_OCR_VALUE    ( ( F_CPU / ( 2 * TIMER0_PRESCALER * TIMER0_FREQUENCY ) ) - 1 )
#define	T_SECONDO			100			/**< Tempo per determinare 1 secondo a 10ms/step */
#define	T_DUEC				20			/**< Tempo per determinare 200ms a 10ms/step */
#define	T_Off_LBG			195			/**< Tempo led BG off quando in idle */
#define	T_On_L_BG			5			/**< Tempo led BG on qunado in idle */
// U A R T   D E F I N E S
#define BAUDRATE0 			57600L				/**< baud rate to 485 */
#define	ONE_TIMESTOP		( BAUDRATE0 / NCHAR_10 )
#define MAXB485 			64						/**< maximum input/output buffer of 485 bus */
#define MASKBUF 			0x3f					/**< mask for pointer increment */

/* +-------------------------------------------------------------------+ */
/* |                      S T R U C T U R E S                          | */
/* +-------------------------------------------------------------------+ */
// Structure for system LED management (except backlight LED)
typedef struct {
	uint8_t	LM_on;				/**< defined led on */
	uint8_t LM_off;				/**< defined led off */
	uint8_t LM_tim;				/**< define time to next state */
	led_num LM_nex;				/**< define next state */
} LED_MACHINE;


/* +-------------------------------------------------------------------+ */
/* |                   E X T   V A R I A B L E S                       | */
/* +-------------------------------------------------------------------+ */
// R O M   I t e m s
extern prog_uint8_t FWrev;	// Software revision
extern prog_uint8_t FWvers;	// Hardware revision
// R A M   I t e m s
extern volatile uint8_t LI_STATUS;
extern volatile uint8_t	card_type;

/* +-------------------------------------------------------------------+ */
/* |                M O D U L E   V A R I A B L E S                    | */
/* +-------------------------------------------------------------------+ */
// R O M   I t e m s
const char ID[] PROGMEM = "RFID 125kHz Reader AVE S.p.A (C) 2007"; /* copyright */
// R A M   I t e m s
uint8_t configChanged = 0;
uint8_t msgRetry = 0;
uint8_t statusIn;
volatile uint8_t lm_st;	   				/* location when store led status machine */
volatile uint8_t lm_ti = 0;				/* counter to execute led status, when 0 use lm_ol */
volatile uint8_t lm_ol = 0;				/* new status when lm_ti == 0 */
volatile uint8_t card_is = RF_IDLE;		/* riporta lo stato della card */
volatile uint8_t mast_is = MS_ONE;
volatile uint8_t mode_is = MO_CAMERA;	/* define the mode, STANZA, AREA COMUNE, ACCESSO A SCALARE */
volatile uint16_t clima_on = 0x00;
volatile uint16_t luci_on = 0x00;		/* tempo di disattivazione luce cortesia, secondi */
volatile uint8_t NoMaster = 0x00;		/* in master mode la carta si e' allontanata =1 */
volatile uint8_t masterT;
volatile uint8_t masT_tmp;
volatile uint8_t B_RingOn = 0;			/* one when ringing is on */
volatile uint8_t B_TimeOK = 0;			/* one when time is sincronized by centrale */
volatile uint8_t B_CentOK = 0;			/* one when centrale is present */
volatile uint8_t B_LetinOK = 0;			/* one when lettore interno is present */
volatile uint8_t B_TermoOK = 0;			/* one when termostato rilevato sul bus */
volatile uint8_t buz_cnt = 0;			/* how many buzzer on? 1=normal, 3=error */
volatile uint8_t devicesOnARMBus = 0;
volatile uint8_t localOpenLck = 0;
// C A R D   D A T A   V A R S
uint8_t cardMode, cardGenerated;
volatile uint32_t RF_code[6] = { 0L, 0L, 0L, 0L, 0L, 0L };
volatile uint16_t card_imp = 0;	 		/* CI = codice impianto letto dalla carta */
volatile uint16_t card_room = 0; 		/* CC = codice camera letto dalla carta */
volatile uint8_t card_cc_cam = 0;		/* CC_CAM = parte di card_room (0x007F) */
volatile uint8_t card_cc_zona = 0;		/* CC_ZONA = parte di card_room (0x0F00)>>8 */
volatile uint8_t card_cc_sub = 0; 		/* CC_SUB = parte di card_room (0x7000)>>12 */
volatile uint16_t card_incclie = 0;		/* CL = codice incrementale cliente letto dalla carta */
volatile uint8_t card_subci = 0;   		/* SUB_CI = codice sub impianto */
volatile uint8_t card_type = 0;			/* TY = codice type letto dalla carta */
volatile uint8_t card_HF = 0;			/* HF = codice ora fine carta letto dalla carta */
volatile uint8_t card_GF = 0;			/* GF = codice giorno fine carta letto dalla carta */
volatile uint8_t card_MF = 0;			/* MF = codice mese fine carta letto dalla carta */
volatile uint8_t card_AF = 0;			/* AF = codice anno fine carta letto dalla carta */
volatile uint8_t card_GAB = 0;			/* GAB = giorni abilitati (bit) */
volatile uint8_t card_GI = 0;			/* GI  = codice giorno inizio */
volatile uint8_t card_MI = 0;			/* MI  = codice mese inizio */
volatile uint8_t card_AI = 0;			/* AI  = codice anno inizio */
volatile uint8_t card_FLAG = 0;			/* FLAG = Usato dalla Master x gestione Tempi */
volatile uint8_t card_GEN = 0;			/* GEN = modalita` genere M o F */
volatile uint8_t card_MAC = 0;			/* MAC = modalita` accesso a fascie orarie */
volatile uint8_t card_HH_I = 0;			/* HH_I = modalita` ora inizio fascia oraria */
volatile uint8_t card_MM_I = 0;			/* MM_I = modalita` minuti inizio fascia oraria */
volatile uint8_t card_HH_F = 0;			/* HH_F = modalita` ora fine fascia oraria */
volatile uint8_t card_MM_F = 0;			/* MM_F = modalita` minuti fine fascia oraria */
// E E P R O M   D A T A   V A R S
volatile uint16_t lo_imp = 0;			/* codice impianto memorizzato in eeprom */
volatile uint8_t lo_subci = 0;			/* codice sub impianto memorizzato in eeprom */
volatile uint16_t lo_room = 0;			/* codice camera memorizzato in eeprom */
volatile uint8_t lo_cc_cam = 0;			/* codice camera recuperato da eeprom */
volatile uint8_t lo_cc_zona = 0;		/* codice camera zona recuperato da eeprom */
volatile uint8_t lo_cc_sub = 0;			/* codice camera sub recuperato da eeprom */
volatile uint16_t lo_inccl = 0;			/* codice incrementale memorizzato in eeprom */
volatile uint8_t pin_change = 0;  		/* counter for pin change (SC_OUT) */
// buffer rx from 485 - USART0
volatile char pcRxBuf[MAXB485];			/* received buffer from 485 bus - used in interupt */
volatile uint8_t pc0Wr = 0;				/* write pointer to pcRxBuf */
volatile uint8_t pc0Rd = 0;				/* read pointer to pcRxBuf */
volatile uint8_t T2OVFV;				/* flagw to define 485 intercaracter timeout */
// buffer tx to 485 - USART0
char pcTxBuf[MAXB485 / 2];				/* buffer to memorize the TX frame */
// system timer location
volatile uint32_t time = 0L;			/* time location - 1s tic */
volatile uint8_t tled = 0;				/* timer of binking led BG, 10ms unit, 2,54 sec max */
volatile uint8_t tout = 0;				/* used in the card process to compute timeout */
volatile uint8_t tdel = 0;		 		/* used in delay subrouties to compute time 1=10ms */
volatile uint8_t tmain;					/* used in main to compute 1 second timeout */
volatile uint8_t t200;					/* used in main to compute 1 second timeout */
volatile uint8_t tbuz = 0;	  			/* used to compute buzzer timeout */
volatile uint16_t tminuto = 0;			/* used in main to compute time */
volatile uint8_t LI_STATUS;				/* define the module status (master or slave) */
uint8_t doIncrement;
uint16_t t_doorbell;
uint8_t t_doorbell_F;
uint8_t validCardLI = 0;
uint8_t fOpened = 0, oCard = 0;
volatile uint8_t tmrRXinProgress = 0;
volatile uint8_t tmrLetInt, tmrTermo;
volatile uint8_t setNewVars = 0;
// Init of the internal EEPROM with the default data values
uint16_t EECodiceHotel	EEMEM = 0x0000;		/* codice hotel di default .. non ancora inizializzato */
uint16_t EECodiceCamera	EEMEM = 0x0000;		/* camera di default .. non ancora inizializzata */
uint16_t EECodiceClient	EEMEM = 0x0000;		/* codice incrementale cliente */
uint8_t EECodiceSubci EEMEM = 0x00;			/* codice subci di default .. non ancora inizializzato */
uint8_t EECodiceLivell EEMEM = 0x00;		/* livelli di accesso */
uint8_t EEEletOffOn	EEMEM = EVEletOffOn;	/* tempo timeout spegnimento elettroserratura (254 sec max) */
uint8_t EERFCardTOut EEMEM = EVRFCardTOut;	/* tempo timeout gestione carta master (254 sec max) */
uint8_t EEDlyRunTime EEMEM = EVDlyRunTime;	/* tempo timeout dalla partenza del modulo 10ms*tick(254 tick max) */
uint8_t EELuciOffOut EEMEM = EVLuciOffOut;	/* tempo timeout spegnimento luci uscita stanza (254 sec max) */
uint8_t EE_MM_AC EEMEM = 0x00;				/* indice accesso aree comuni */
uint8_t EE_MM_ACS EEMEM = 0x00;				/* indice accesso aree a scalare */
uint8_t EEMODE_IS EEMEM = MO_CAMERA;		/* Modo operativo */
uint8_t EEST_CA_LO EEMEM = 0x00;			/* memorizza stato camera. se 1 gia visto una volta a zero */
// D o o r b e l l   I t e m s
uint8_t EEToutDoorB EEMEM = 10;
uint8_t EEAlwaysDoorB EEMEM = 0x01;
uint8_t EEMyAddress EEMEM = 0x00;
// F I R M W A R E   V E R S I O N
prog_uint8_t FWvers = 0x80;
// F I R M W A R E   R E V I S I O N
prog_uint8_t FWrev = 0x00;

volatile uint32_t uniquecode;
/* +-------------------------------------------------------------------+ */
/* |                 S T A T U S   H A N D L E R S                     | */
/* +-------------------------------------------------------------------+ */
volatile LED_MACHINE lm_stat[] = {
	{ LED_BG|LED_BR|LED_R|LED_Y,	0,						100, LD01 },	/**< 00 = poweron, all led on, next normal */
	{ 0,						LED_BG|LED_BR|LED_R|LED_Y,	190, LD02 },	/**< 01 = off normal state */
	{ LED_BG,					LED_BR|LED_R|LED_Y,			 10, LD01 },	/**< 02 = on  normal state */
	{ 0,						LED_BG|LED_BR|LED_R|LED_Y,	190, LD04 },	/**< 03 = off virgin state */
	{ LED_BR,					LED_BG|LED_R|LED_Y,			 10, LD03 },	/**< 04 = on  virgin state */
	{ LED_BG,					LED_BR|LED_R|LED_Y,			100, LD02 },	/**< 05 = led green on */
	{ LED_BR,					LED_BG|LED_R|LED_Y,			100, LD02 },	/**< 06 = led red on */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美视频一区二区| 国产精品久久国产精麻豆99网站 | 国产精品一区二区无线| 最新久久zyz资源站| 91麻豆精品国产91久久久使用方法| 国产一区二区不卡| 日韩综合小视频| 亚洲精品乱码久久久久久久久| 久久久国产精华| 欧美精品1区2区| 色又黄又爽网站www久久| 国产精品亚洲视频| 久久99精品一区二区三区三区| 亚洲一区二区三区四区在线观看| 国产日韩欧美制服另类| 日韩天堂在线观看| 欧美视频在线播放| 99r精品视频| 高清国产一区二区三区| 久久精品99国产精品| 五月天激情综合| 亚洲情趣在线观看| 中文字幕日韩一区二区| 国产精品美女一区二区三区 | 在线观看一区不卡| 不卡大黄网站免费看| 国产精品一卡二卡| 国产精品综合一区二区| 久久精品国产99国产精品| 日本一不卡视频| 日韩黄色免费电影| 三级不卡在线观看| 丝袜亚洲另类丝袜在线| 亚洲国产精品久久一线不卡| 一区二区免费在线| 亚洲高清免费观看| 亚洲成人久久影院| 五月天国产精品| 免费人成黄页网站在线一区二区| 日本在线不卡视频一二三区| 日韩精品亚洲专区| 男女性色大片免费观看一区二区| 婷婷国产在线综合| 日韩二区三区四区| 免费成人美女在线观看.| 美美哒免费高清在线观看视频一区二区 | 成人av在线影院| 成人av午夜影院| 成人综合在线观看| 99久久久免费精品国产一区二区 | 日韩一区二区视频在线观看| 日韩一区二区视频| 精品福利一区二区三区| 久久久一区二区三区捆绑**| 国产精品丝袜黑色高跟| 国产精品免费视频观看| 亚洲精品国产品国语在线app| 一区二区三区不卡视频| 午夜精品福利久久久| 久久99精品网久久| 成人一区二区视频| 91在线一区二区三区| 欧美亚洲一区二区在线| 日韩一区二区在线观看视频 | 国产91综合网| 色8久久精品久久久久久蜜| 欧美日韩dvd在线观看| 欧美刺激午夜性久久久久久久| 久久久av毛片精品| 亚洲精品大片www| 奇米影视一区二区三区小说| 国产激情视频一区二区三区欧美 | 欧美日本精品一区二区三区| 精品精品国产高清a毛片牛牛| 国产精品私人自拍| 亚洲1区2区3区4区| 国产精一品亚洲二区在线视频| 一本久久精品一区二区| 日韩欧美在线观看一区二区三区| 欧美激情在线免费观看| 无码av中文一区二区三区桃花岛| 国产精品1区2区3区| 日本精品免费观看高清观看| 日韩欧美在线观看一区二区三区| 国产精品久久二区二区| 秋霞午夜鲁丝一区二区老狼| 成人午夜在线播放| 91精品视频网| 亚洲桃色在线一区| 久久精品99国产精品日本| 色天天综合久久久久综合片| 久久综合久久综合九色| 亚洲一区二区三区国产| 粉嫩av一区二区三区| 欧美精品久久久久久久久老牛影院| 国产亚洲综合在线| 三级成人在线视频| 91免费精品国自产拍在线不卡| 精品久久久三级丝袜| 亚洲最新在线观看| 成人午夜又粗又硬又大| 欧美videos中文字幕| 亚洲永久精品国产| 不卡的av中国片| 久久品道一品道久久精品| 亚洲bt欧美bt精品| 色激情天天射综合网| 日本一区二区三区在线不卡| 免费观看一级特黄欧美大片| 在线视频你懂得一区二区三区| 国产日韩欧美高清在线| 久久国产精品99精品国产| 欧洲国产伦久久久久久久| 国产精品麻豆久久久| 激情欧美一区二区| 日韩丝袜美女视频| 亚洲成人免费在线| 色av综合在线| 一区二区三区四区不卡视频| 成人开心网精品视频| 国产三级精品视频| 久久99精品一区二区三区三区| 6080日韩午夜伦伦午夜伦| 亚洲高清免费观看高清完整版在线观看| 99精品国产91久久久久久| 日本一区二区视频在线| 国产一区二区伦理| 久久综合九色综合久久久精品综合| 日韩精品一二三区| 欧美高清激情brazzers| 午夜精品久久久久久久久| 欧美亚洲国产bt| 一二三四区精品视频| 欧美无砖专区一中文字| 亚洲在线免费播放| 欧美日韩成人一区| 天堂一区二区在线免费观看| 911国产精品| 日韩成人一级片| 精品日产卡一卡二卡麻豆| 久久91精品国产91久久小草 | 亚洲精品高清视频在线观看| 91一区二区三区在线观看| 亚洲女人的天堂| 欧美三级一区二区| 亚洲成人777| 日韩精品一区二区三区四区| 另类综合日韩欧美亚洲| 久久久久综合网| www.欧美色图| 一区二区三区久久| 777久久久精品| 久久精品国产秦先生| 国产清纯美女被跳蛋高潮一区二区久久w| 国产一区二区三区| 国产精品久久久久aaaa| 色婷婷综合久久久久中文一区二区 | 美女网站视频久久| 久久免费偷拍视频| 99综合电影在线视频| 亚洲综合一区二区精品导航| 51精品秘密在线观看| 黄色日韩网站视频| 国产精品灌醉下药二区| 欧美日韩精品欧美日韩精品一 | 色噜噜夜夜夜综合网| 亚洲一区二区精品3399| 日韩视频一区二区在线观看| 国产不卡在线一区| 亚洲综合色噜噜狠狠| 日韩午夜中文字幕| av一二三不卡影片| 日韩国产在线一| 欧美国产激情一区二区三区蜜月| 91偷拍与自偷拍精品| 日本午夜一本久久久综合| 亚洲国产精品t66y| 欧美日韩另类一区| 国产麻豆视频精品| 亚洲国产日产av| 国产喂奶挤奶一区二区三区| 欧美专区日韩专区| 国产一区二区在线视频| 亚洲黄色av一区| 久久这里都是精品| 欧美性生交片4| 国产成人免费视| 亚洲成人综合在线| 国产精品美女久久久久av爽李琼| 欧美日韩精品一区二区| 成人免费视频国产在线观看| 日韩激情一区二区| 亚洲人成亚洲人成在线观看图片| 精品av久久707| 欧美日韩中文国产| www.亚洲在线| 国产美女在线观看一区| 午夜精品久久久久久久99水蜜桃| 国产精品久久久久aaaa| 久久久久久久免费视频了|