amlib.ccid

## Class ReaderAT24C

- java.lang.Object
- - amlib.ccid.Reader
  - - amlib.ccid.ReaderAT24C

-     public class ReaderAT24C
      extends Reader

- - ### Field Summary

    Fields
    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`

    - ### Fields inherited from class amlib.ccid.Reader

      `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 Summary

    Constructors
    Constructor and Description
    `ReaderAT24C(HardwareInterface Dev)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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

    - ### Methods inherited from class amlib.ccid.Reader

      `close, escape, getAtr, getAtrString, getCardStatus, getCmdFailCode, getCurrentDev, getProtocol, getSN, setPower, setSlot, switchMode, transmit`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### AT24C_ONE_BYTE_ADDRESSING

          public static final byte AT24C_ONE_BYTE_ADDRESSING

      See Also:
        Constant Field Values

    - #### AT24C_TWO_BYTE_ADDRESSING

          public static final byte AT24C_TWO_BYTE_ADDRESSING

      See Also:
        Constant Field Values

    - #### AT24C_CARD_TYPE_DEFINE_MAX

          public static final byte AT24C_CARD_TYPE_DEFINE_MAX

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ReaderAT24C

          public ReaderAT24C(HardwareInterface Dev)
                      throws ReaderException

      Constructor
      Parameters:
        `Dev` - HardwareInterface object which has been initialed
      Throws:
        `ReaderException`
      See Also:
        `ReaderException`

  - ### Method Detail

    - #### open

          public int open(int slot)

      Description copied from class: `Reader`
      To open reader with given slot
      Overrides:
        `open` in class `Reader`
      Parameters:
        `slot` - slot number to open
      Returns:
        READER_SUCCESSFUL or other error code

    - #### open

          public int open()

      Description copied from class: `Reader`
      To open the reader.
      Overrides:
        `open` in class `Reader`
      Returns:
        READER_SUCCESSFUL or other error code

    - #### AT24CSeriesCmd_Write

          public int AT24CSeriesCmd_Write(int intStartAddr,
                                          byte bCardType,
                                          int intWordPageSize,
                                          int intWriteLen,
                                          byte[] pWriteData)

      AT24CSeriesCmd_Write writes data to the memory card.
      Parameters:
        `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.
      Returns:
        0 for success.

    - #### AT24CSeriesCmd_Read

          public int AT24CSeriesCmd_Read(int intStartAddr,
                                         byte bCardType,
                                         int intReadLen,
                                         byte[] pReadData,
                                         int[] pIntReturnLen)

      AT24CSeriesCmd_Read read data from the memory card.
      Parameters:
        `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.
      Returns:
        0 for success.

    - #### AT24CxxCmd_Write

          public int AT24CxxCmd_Write(int intStartAddr,
                                      int intWordPageSize,
                                      int intWriteLen,
                                      byte[] pWriteData)

      AT24CxxCmd_Write writes data to the memory card.
      Parameters:
        `intStartAddr` - The memory address to write to. Note:The single byte Card,lngStartAddr = 0x7FFF.The double byte Card,lngStartAddr |= 0x8000
        `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.
      Returns:
        0 for success.

    - #### AT24CxxCmd_Read

          public int AT24CxxCmd_Read(byte bDeviceAddress,
                                     int intStartAddr,
                                     int intReadLen,
                                     byte[] pReadData,
                                     int[] pIntReturnLen)

      AT24CxxCmd_Read read data from the memory card.
      Parameters:
        `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 |= 0x8000
        `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.
      Returns:
        0 for success.