public class ReaderAT24C extends Reader
| Modifier and Type | Field and Description |
|---|---|
static byte |
AT24C_CARD_TYPE_DEFINE_MAX |
static byte |
AT24C_ONE_BYTE_ADDRESSING |
static byte |
AT24C_TWO_BYTE_ADDRESSING |
CardModeASYNC, CardModeAT45D041, CardModeAT88SC102, CardModeAT88SC153, CardModeAT88SC1608, CardModeI2C, CardModeINPHONE, CardModeSLE4428, CardModeSLE4442, CardModeSLE6636, CCID_POWEROFF, CCID_POWERON, CCID_PROTOCOL_NA, CCID_PROTOCOL_T0, CCID_PROTOCOL_T1, SLOT_STATUS_CARD_ABSENT, SLOT_STATUS_CARD_ACTIVE, SLOT_STATUS_CARD_INACTIVE| Constructor and Description |
|---|
ReaderAT24C(HardwareInterface Dev)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
AT24CSeriesCmd_Read(int intStartAddr,
byte bCardType,
int intReadLen,
byte[] pReadData,
int[] pIntReturnLen)
AT24CSeriesCmd_Read read data from the memory card.
|
int |
AT24CSeriesCmd_Write(int intStartAddr,
byte bCardType,
int intWordPageSize,
int intWriteLen,
byte[] pWriteData)
AT24CSeriesCmd_Write writes data to the memory card.
|
int |
AT24CxxCmd_Read(byte bDeviceAddress,
int intStartAddr,
int intReadLen,
byte[] pReadData,
int[] pIntReturnLen)
AT24CxxCmd_Read read data from the memory card.
|
int |
AT24CxxCmd_Write(int intStartAddr,
int intWordPageSize,
int intWriteLen,
byte[] pWriteData)
AT24CxxCmd_Write writes data to the memory card.
|
int |
open()
To open the reader.
|
int |
open(int slot)
To open reader with given slot
|
close, escape, getAtr, getAtrString, getCardStatus, getCmdFailCode, getCurrentDev, getProtocol, getSN, setPower, setSlot, switchMode, transmitpublic static final byte AT24C_ONE_BYTE_ADDRESSING
public static final byte AT24C_TWO_BYTE_ADDRESSING
public static final byte AT24C_CARD_TYPE_DEFINE_MAX
public ReaderAT24C(HardwareInterface Dev) throws ReaderException
Dev - HardwareInterface object which has been initialedReaderExceptionReaderExceptionpublic int open(int slot)
Readerpublic int open()
Readerpublic int AT24CSeriesCmd_Write(int intStartAddr,
byte bCardType,
int intWordPageSize,
int intWriteLen,
byte[] pWriteData)
intStartAddr - The memory address to write to.bCardType - The card type.intWordPageSize - The page size for write operation.
This value is depended on the property of the memory card.
If the programmer doesn't know it, set it to 0x08.intWriteLen - Number of bytes to be written to the card.pWriteData - Pointer to the buffer containing the data to be written to the card.public int AT24CSeriesCmd_Read(int intStartAddr,
byte bCardType,
int intReadLen,
byte[] pReadData,
int[] pIntReturnLen)
intStartAddr - The memory address to read from.bCardType - The card type.intReadLen - Number of bytes to be read from the card.pReadData - Pointer to a buffer that receives the data read from the card.pIntReturnLen - Pointer to the length, in bytes, of the pReadData parameter and receives the actual number of bytes received from the card.public int AT24CxxCmd_Write(int intStartAddr,
int intWordPageSize,
int intWriteLen,
byte[] pWriteData)
intStartAddr - The memory address to write to. Note:The single byte Card,lngStartAddr = 0x7FFF.The double byte Card,lngStartAddr |= 0x8000intWordPageSize - The page size for write operation. This value is depended on the property of the memory card. If the programmer doesn't know it, set it to 0x08.intWriteLen - Number of bytes to be written to the card.pWriteData - Pointer to the buffer containing the data to be written to the card.public int AT24CxxCmd_Read(byte bDeviceAddress,
int intStartAddr,
int intReadLen,
byte[] pReadData,
int[] pIntReturnLen)
bDeviceAddress - The I2C Device Address. Should set to 0x50.intStartAddr - The memory address to read from. Note:The single byte Card,lngStartAddr = 0x7FFF.The double byte Card,lngStartAddr |= 0x8000intReadLen - Number of bytes to be read from the card.pReadData - Pointer to a buffer that receives the data read from the card.pIntReturnLen - Pointer to the length, in bytes, of the pReadData parameter and receives the actual number of bytes received from the card.