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

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

?? letext_324.c

?? Source Code Source Code Source Code Source Code Source Code Source Code Source Code Source Code Sour
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* +-------------------------------------------------------------------+ */
/* | 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 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美影视一区在线| 首页亚洲欧美制服丝腿| 成人教育av在线| 国产精品盗摄一区二区三区| voyeur盗摄精品| 亚洲h在线观看| 欧美丰满高潮xxxx喷水动漫| 日本一不卡视频| 国产三级欧美三级日产三级99| 不卡av电影在线播放| 亚洲夂夂婷婷色拍ww47 | 亚洲综合男人的天堂| 欧美手机在线视频| 另类专区欧美蜜桃臀第一页| 国产精品午夜久久| 欧美色倩网站大全免费| 国产精一品亚洲二区在线视频| 国产精品久久久久影院亚瑟| 欧美日韩一区二区三区视频| 韩国一区二区视频| 亚洲黄网站在线观看| 精品国产一区二区亚洲人成毛片| jlzzjlzz欧美大全| 日本中文字幕一区| 国产精品久久久久久久岛一牛影视 | 国产香蕉久久精品综合网| 成人av网在线| 三级精品在线观看| 1000部国产精品成人观看| 6080亚洲精品一区二区| 成人av电影在线| 蜜桃免费网站一区二区三区 | 亚洲观看高清完整版在线观看 | 久久久精品蜜桃| 日本道色综合久久| 国产一区91精品张津瑜| 亚洲尤物在线视频观看| 久久免费看少妇高潮| 欧美色图片你懂的| 不卡区在线中文字幕| 奇米影视7777精品一区二区| 欧美一区二区三区的| 国产精品538一区二区在线| 亚洲精品乱码久久久久久 | 亚洲夂夂婷婷色拍ww47| 久久麻豆一区二区| 欧美乱妇15p| 一本色道**综合亚洲精品蜜桃冫| 极品销魂美女一区二区三区| 亚洲美女一区二区三区| 久久久高清一区二区三区| 在线播放/欧美激情| 国内精品久久久久影院色| 色呦呦国产精品| 亚洲一本大道在线| 国产精品资源在线看| 午夜日韩在线观看| 一区二区三区在线视频观看| 国产欧美日韩另类视频免费观看| 日韩免费在线观看| 制服视频三区第一页精品| 欧美亚洲自拍偷拍| 欧美自拍偷拍一区| 色综合欧美在线视频区| 91亚洲精品乱码久久久久久蜜桃 | 色天天综合色天天久久| 成人免费观看av| 国产成人a级片| 国产中文字幕精品| 国产美女精品人人做人人爽| 精品一二线国产| 精品午夜久久福利影院| 精品一区二区在线视频| 久久99精品国产麻豆婷婷洗澡| 免费成人av资源网| 日本成人超碰在线观看| 奇米精品一区二区三区在线观看| 奇米色一区二区三区四区| 日本美女一区二区三区视频| 日本在线不卡视频一二三区| 天天综合色天天综合色h| 日本成人在线电影网| 另类的小说在线视频另类成人小视频在线 | 国内精品视频一区二区三区八戒| 麻豆极品一区二区三区| 精品亚洲成a人| 国产精品综合网| 波多野结衣亚洲一区| 91蜜桃网址入口| 欧美日本一区二区三区四区 | 色综合久久久久久久久| 欧洲国内综合视频| 6080国产精品一区二区| 久久久午夜精品| 国产精品久久久久影院亚瑟| 日韩理论电影院| 亚洲成人激情av| 久久国产精品免费| 99这里只有精品| 一本色道久久综合亚洲精品按摩| 欧美在线观看视频一区二区| 日韩精品中文字幕在线不卡尤物| 欧美三级三级三级| 色综合久久综合网欧美综合网| 欧美在线免费视屏| 欧美精品一区二区三区四区 | 亚洲色图另类专区| 亚洲成人高清在线| 国产激情一区二区三区桃花岛亚洲| 97se亚洲国产综合自在线| 欧美日韩精品一区视频| 久久久亚洲欧洲日产国码αv| 亚洲欧美日韩在线| 日韩精品欧美精品| 国产成人午夜电影网| 在线一区二区三区做爰视频网站| 日韩午夜精品电影| 成人欧美一区二区三区1314| 人人狠狠综合久久亚洲| 成人av手机在线观看| 日韩欧美国产综合一区| 亚洲免费色视频| 国产精品自在在线| 在线观看91av| ●精品国产综合乱码久久久久| 国产乱子轮精品视频| 色先锋aa成人| 久久综合资源网| 婷婷综合另类小说色区| 丝袜亚洲另类欧美| 精品一区二区三区欧美| 岛国一区二区三区| 欧美日韩一卡二卡三卡| 中文字幕欧美区| 久久av资源站| 欧美日韩成人综合在线一区二区| 国产精品久久久久久久久图文区| 久久电影网电视剧免费观看| 欧美综合视频在线观看| 中文字幕一区二区三区av| 韩国一区二区视频| 91精品国产综合久久精品app| 亚洲三级小视频| 成人一区二区视频| 久久美女艺术照精彩视频福利播放| 亚洲午夜三级在线| 一区二区三区欧美在线观看| 国产99久久精品| 99精品国产热久久91蜜凸| 精品久久久久久亚洲综合网| 国产精品影视网| 中文字幕一区二区不卡| 欧美性猛片aaaaaaa做受| 视频一区免费在线观看| 精品日韩在线一区| 东方欧美亚洲色图在线| 一区二区三区毛片| 日韩欧美另类在线| 成人黄色电影在线| 亚洲一区二区三区中文字幕在线 | 91视视频在线直接观看在线看网页在线看| 中文字幕亚洲欧美在线不卡| 欧美在线小视频| 理论电影国产精品| 国产精品理论在线观看| 欧美日韩国产小视频| 国产在线观看免费一区| 亚洲精品v日韩精品| 日韩免费福利电影在线观看| av一区二区三区| 蜜乳av一区二区| 亚洲欧洲精品成人久久奇米网| 欧美日本一道本在线视频| 国产宾馆实践打屁股91| 亚洲二区在线视频| 久久精品免视看| 欧美人与禽zozo性伦| 成人免费高清在线| 精品一区二区三区在线观看| 亚洲视频网在线直播| 日韩精品一区二区三区视频播放 | 国产成人精品1024| 亚洲午夜一区二区三区| 国产亚洲一区二区三区四区| 欧美中文字幕一区二区三区亚洲| 国产在线视频一区二区| 亚洲.国产.中文慕字在线| 国产日韩影视精品| 4438x亚洲最大成人网| 99精品视频在线免费观看| 美国一区二区三区在线播放| 一区二区三区四区在线免费观看 | 国产一区二区久久| 亚洲国产综合在线| 中文字幕电影一区| 欧美草草影院在线视频| 精品视频一区三区九区| fc2成人免费人成在线观看播放| 蜜臀久久99精品久久久画质超高清| 亚洲欧美日韩在线|