90 lines
2.0 KiB
C
90 lines
2.0 KiB
C
|
/*******************************************************************************
|
|||
|
*
|
|||
|
* Copyright(C) 2012 WANG XIBING All rights reserved.
|
|||
|
*
|
|||
|
* <EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>driver.h
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD>wxb
|
|||
|
* <EFBFBD>汾<EFBFBD><EFBFBD>V1.00
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>2012-1-1
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>RL78
|
|||
|
* <EFBFBD>ģ<EFBFBD>V1.00, 2012-1-1, wxb, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|||
|
*
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD>Ĺ<EFBFBD><EFBFBD>ܣ<EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĵ<EFBFBD>Ӧ<EFBFBD>þ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD>κ<EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>ⲻ<EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵĿ<EFBFBD>ġ<EFBFBD>
|
|||
|
*******************************************************************************/
|
|||
|
|
|||
|
#ifndef __CARD_5557_DRIVER_H
|
|||
|
#define __CARD_5557_DRIVER_H
|
|||
|
|
|||
|
|
|||
|
#include "ddl.h"
|
|||
|
#include "pca.h"
|
|||
|
#include "type.h"
|
|||
|
#include "vc.h"
|
|||
|
#include "wdt.h"
|
|||
|
#include "adt.h"
|
|||
|
#include "opa.h"
|
|||
|
#include "libbase.h"
|
|||
|
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
extern "C" {
|
|||
|
#endif
|
|||
|
|
|||
|
// CARD
|
|||
|
#define RF125K_DIR M0P_GPIO->PADIR_f.PA02
|
|||
|
#define RF125K_OUT M0P_GPIO->PAOUT_f.PA02
|
|||
|
#define CTL_SH_DIR M0P_GPIO->PCDIR_f.PC10
|
|||
|
#define CTL_SH_OUT M0P_GPIO->PCOUT_f.PC10
|
|||
|
|
|||
|
#define RF125K_PORT GpioPortA
|
|||
|
#define RF125K_PIN GpioPin2
|
|||
|
#define RF125K_PIN_AF GpioAf4
|
|||
|
#define RF125K_PIN_IO GpioAf0
|
|||
|
|
|||
|
#define CARD_DET_PORT GpioPortA
|
|||
|
#define CARD_DET_PIN GpioPin7
|
|||
|
#define CARD_DET_PIN_AF GpioAf7
|
|||
|
#define CARD_DET_PIN_IO GpioAf0
|
|||
|
|
|||
|
#define SIGNALP_PORT GpioPortA
|
|||
|
#define SIGNALP_PIN GpioPin5
|
|||
|
|
|||
|
#define SIGNALN_PORT GpioPortC
|
|||
|
#define SIGNALN_PIN GpioPin1
|
|||
|
|
|||
|
#define CARDIN_DELTA 20//40
|
|||
|
#define CARDOUT_DELTA 25//45
|
|||
|
#define THRESHHOLD_DIFF CARDOUT_DELTA
|
|||
|
#define PCA_INT_MAX 8000
|
|||
|
//typedef union
|
|||
|
//{
|
|||
|
// struct
|
|||
|
// {
|
|||
|
// u8 card_in : 1;
|
|||
|
|
|||
|
|
|||
|
// };
|
|||
|
// u8 byte[3];
|
|||
|
//} CARD_MESSAGE;
|
|||
|
////////////////////////////////////////////////////////////////////////////////
|
|||
|
u8 card_search(void);
|
|||
|
u8 card_read_all(u8 * buffer);
|
|||
|
u8 card_write_all(void* buffer);
|
|||
|
u8 card_write_block(u8 block, void* buffer);
|
|||
|
void card_init(void);
|
|||
|
void card_enable(void);
|
|||
|
void card_disable(void);
|
|||
|
void Card5557ClrIntCnt(void);
|
|||
|
void Card5557PreSleep(void);
|
|||
|
void Card5557WakeSleep(void);
|
|||
|
void ClearCardSta(void);
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
#endif /* __CARD_5557_DRIVER_H */
|