📄 rccommunication.h
字号:
/*
* Copyright (c), Philips Semiconductors Gratkorn / Austria
*
* (C)PHILIPS Electronics N.V.2000
* All rights are reserved. Reproduction in whole or in part is
* prohibited without the written consent of the copyright owner.
* Philips reserves the right to make changes without notice at any time.
* Philips makes no warranty, expressed, implied or statutory, including but
* not limited to any implied warranty of merchantability or fitness for any
*particular purpose, or that the use will not infringe any third party patent,
* copyright or trademark. Philips must not be liable for any loss or damage
* arising from its use.
*/
/*! \file RcCommunication.h
*
* Projekt: MF EV X00 Firmware
*
* $Workfile:: RcCommunication.h $
* $Modtime:: 30.03.01 6:15 $
* $Author:: Hb $
* $Revision:: 20 $
*
*/
#ifndef RCCOMMUNICATION_H
#define RCCOMMUNICATION_H
//! Register Page Calculation
/*!
* \param adr register address
*
* This function calculates the register page address out of the 4 bit address space
*/
#define GetRegPage(addr) (0x80 | (addr>>3))
//! Open Reader IC Connection
/*!
* \param none
* \return MI_OK
* other error opening reader ic channel
*
* Open and initialize communication channel to the reader module
*/
char OpenRC(void);
//! Write one byte to the reader IC address space
/*!
* \param address (<EM>IN</EM>) reader ic register address
* \param value (<EM>IN</EM>) 8 bit value
* \return none
*
* This function determines the necessary page address of the
* reader module and writes the page number to the page
* register and the value to the specified address.
*/
void WriteRC(unsigned char Address, unsigned char value);
//! Write one byte to the reader IC address space
/*
* \param address (<EM>IN</EM>) reader IC register address
* \return value 8 bit data, read from the reader ic address space
*
* This function determines the necessary page address of the
* reader module and writes the page number to the page
* register and reads the value from the specified address.
*/
unsigned char ReadRC(unsigned char Address);
//! Close reader IC communication channel
/*!
* \param none
* \return none
*
* Closing the communication channel to the reader module
*/
void CloseRC(void);
//! Write one byte to the reader IC address space
/*!
* \param address (<EM>IN</EM>) reader ic register address
* \param value (<EM>IN</EM>) 8 bit value
* \return none
*
* Function for writting one char to the reader module
*
* The reader module is connected to a 16 bit demultiplexed bus,
* therefore the address pin of the reader module is mapped as
* follows: \n
* uC Reader \n
* A1 A0 \n
* A2 A1 \n
* A3 A2 \n
*
* In order to get the correct address, the original address need to
* be multiplied by 2.
*/
#define WriteRawRC(addr,value) *(gpcRCBaseAddress + addr * READER_BUS_WIDTH) = value;
//! Read one byte from the reader IC address space
/*!
* \param address (<EM>IN</EM>) reader ic register address
* \param value (<EM>IN</EM>) 8 bit value
* \return none
*
* Function for reading one char from the reader module
*
* The reader module is connected to a 16 bit demultiplexed bus,
* therefore the address pin of the reader module is mapped as
* follows: \n
* uC Reader \n
* A1 A0 \n
* A2 A1 \n
* A3 A2 \n
*
* In order to get the correct address, the original address need to
* be multiplied by 2.
*/
#define ReadRawRC(addr) (*(gpcRCBaseAddress + addr * READER_BUS_WIDTH))
//! global memory base address pointer for calculation of the absolut
//! memory address of the reader IC register set
extern unsigned char * const gpcRCBaseAddress;
#endif // RCCOMMUNICATION_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -