X1UWaterWmbusISK/hardinterface/inc/UWater_card_5557_driver.h

90 lines
2.0 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*******************************************************************************
*
* Copyright(C) 2012 WANG XIBING All rights reserved.
*
* 文件driver.h
* 作者wxb
* 版本V1.00
* 日期2012-1-1
* 描述:驱动
* 属性RL78
* 修改V1.00, 2012-1-1, wxb, 创建本文件
*
* 声明:本程序所有权归作者所有。
* 本程序仅用于实现特定产品的功能,任何修改或其它目的的应用均不作保证,
* 任何人未经作者同意不得将本程序的全部或部分用于商业目的。
*******************************************************************************/
#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 */