001 /*
002 * ===========================================================================================
003 * = COPYRIGHT
004 *          PAX Computer Technology (Shenzhen) Co., Ltd. PROPRIETARY INFORMATION
005 *   This software is supplied under the terms of a license agreement or nondisclosure
006 *   agreement with PAX Computer Technology (Shenzhen) Co., Ltd. and may not be copied or
007 *   disclosed except in accordance with the terms in that agreement.
008 *     Copyright (C) 2017-2023 PAX Computer Technology (Shenzhen) Co., Ltd. All rights reserved.
009 * Description: // Detail description about the function of this module,
010 *             // interfaces with the other modules, and dependencies.
011 * Revision History:
012 * Date                         Author                        Action
013 * 2017/04/01                   PAX                     Create/Add/Modify/Delete
014 * ===========================================================================================
015 */
016 
017package com.pax.dal.memorycard;
018
019import com.pax.dal.exceptions.AT24CxxDevException;
020
021public interface ICardAT24Cxx extends IMemoryCard {
022
023    /**
024     * <div class="zh"> 注册操作的信息 </div> <div class="en"> The deck information for the registration operation. </div>
025     * 
026     * @param cardType
027     *            <div class="zh"> 卡类型。类型值包括:1,2,4,8,16,32,64. </div> <div class="en"> the type of card.Type value
028     *            inclues 1,2,4,8,16,32,64. </div>
029     * @param devAddr
030     *            <div class="zh"> 设备地址。 格式是(XXXXXA2A1A0)b。考虑参数填充:
031     *            <ul>
032     *            <li>卡类型1,A2A1A0由硬件脚A2/A1/A0连接决定</li>
033     *            <li>卡类型2,A2A1A0由硬件脚A2/A1/A0连接决定</li>
034     *            <li>卡类型4,A2A1由硬件脚A2/A1,A0=(0)b连接决定</li>
035     *            <li>卡类型8,A2由硬件脚A2,A1A0=(00)b连接决定</li>
036     *            <li>卡类型16,A2A1A0=(000)b</li>
037     *            <li>卡类型32,A2A1A0=(000)b</li>
038     *            <li>卡类型64,A2A1A0=(000)b</li>
039     *            </div> <div class="en"> the address of the device. The format is (XXXXXA2A1A0)b.Parameter Filling
040     *            Considerations: cardType=1,A2A1A0 is determined by the connection of hardware leg A2/A1/A0.
041     *            cardType=2,A2A1A0 is determined by the connection of hardware leg A2/A1/A0. cardType=4,A2A1 is
042     *            determined by the connection of hardware leg A2/A1,A0=(0)b. cardType=8,A2 is determined by the
043     *            connection of hardware leg A2,A1A0=(00)b. cardType=16,A2A1A0=(000)b. cardType=32,A2A1A0=(000)b.
044     *            cardType=64,A2A1A0=(000)b. </div>
045     * @throws AT24CxxDevException
046     */
047    public void open(int cardType, byte devAddr) throws AT24CxxDevException;
048
049    /**
050     * <div class="zh"> 下电 </div> <div class="en"> Power down </div>
051     * 
052     * @throws AT24CxxDevException
053     */
054    public void close() throws AT24CxxDevException;
055
056    /**
057     * <div class="zh"> 按顺序读取指定的地址和数据长度 </div> <div class="en"> Read specified address and length of data in order
058     * </div>
059     * 
060     * @param addr
061     *            <div class="zh"> 读取数据的地址 </div> <div class="en"> the address of the read data. </div>
062     * @param exLen
063     *            <div class="zh"> 读取数据期望长度 </div> <div class="en"> the expected length of the read data. </div>
064     * @return <div class="zh"> 读取到的数据 </div> <div class="en"> the read data. </div>
065     * @throws AT24CxxDevException
066     */
067    public byte[] read(int addr, int exLen) throws AT24CxxDevException;
068
069    /**
070     * <div class="zh"> 使用字节写模式,在卡片的指定地址写数据 </div> <div class="en"> Use byte writting mode.Write data at the specified
071     * address of the card </div>
072     * 
073     * @param addr
074     *            <div class="zh"> 写数据的指定地址 </div> <div class="en"> the specified address to write data. </div>
075     * @param data
076     *            <div class="zh"> 要写的数据 </div> <div class="en"> the written data. </div>
077     * @throws AT24CxxDevException
078     */
079    public void write(int addr, byte[] data) throws AT24CxxDevException;
080
081}