/** ********************************************************************************************************* * Copyright(c) 2015, Realtek Semiconductor Corporation. All rights reserved. ********************************************************************************************************** * @file cp.h * @brief apple's authentication coprocessor driver header file. * @details none. * @author tifnan * @date 2015-09-09 * @version v1.0 ********************************************************************************************************* */ #ifndef _CP_H_ #define _CP_H_ /*============================================================================* * Header Files *============================================================================*/ #include #include //cp device address, if reset pin pull low, 0x10; if reset pin pull high, 0x11 #define CP_DEVICE_ADDRESS_RESET_POLL_LOW 0x10 #define CP_DEVICE_ADDRESS_RESET_POLL_HIGH 0x11 //cp register address (block 1) #define CP_REG_DEV_VER 0x00 //RO, device verision #define CP_REG_FW_VER 0x01 //RO, firmware verision #define CP_REG_MAJ_VER 0x02 //RO, authentication protocol major verision #define CP_REG_MIN_VER 0x03 //RO, authentication protocol minor verision #define CP_dev_id 0x04 //RO, device id, 4bytes(0x00000200) #define CP_ERR_CODE 0x05 //RO, error code -- read clear //cp register address (block 2) #define CP_REG_CS 0x10 //RW, authentication control & status #define CP_SIG_LEN 0x11 //RW, signature data length, 2bytes(128) #define CP_SIG_DATA 0x12 //RW, signature data, 128 bytes #define CP_REG_CHA_LEN 0x20 //RW, challenge data length, 2bytes(20) #define CP_REG_CHA_DATA 0x21 //RW, challenge data, 128bytes //cp register address (block 3) #define CP_REG_ACD_LEN 0x30 //RO, accessory certificate data length, 2bytes(<=1280) #define CP_REG_ACD1 0x31 //RO, accessory certificate data page1, 128bytes #define CP_REG_ACD2 0x32 //RO, accessory certificate data page2, 128bytes #define CP_REG_ACD3 0x33 //RO, accessory certificate data page3, 128bytes #define CP_REG_ACD4 0x34 //RO, accessory certificate data page4, 128bytes #define CP_REG_ACD5 0x35 //RO, accessory certificate data page5, 128bytes #define CP_REG_ACD6 0x36 //RO, accessory certificate data page6, 128bytes #define CP_REG_ACD7 0x37 //RO, accessory certificate data page7, 128bytes #define CP_REG_ACD8 0x38 //RO, accessory certificate data page8, 128bytes #define CP_REG_ACD9 0x39 //RO, accessory certificate data page9, 128bytes #define CP_REG_ACD10 0x3A //RO, accessory certificate data page10, 128bytes //cp register address (block 4) #define CP_REG_ST_CS 0x40 //RW, self-test control & status #define CP_REG_SEC 0x4D //RO, system event counter //cp register address (block 5) #define CP_REG_ADCD_LEN 0x50 //RW, apple device certificate data length, 2bytes(0x0000) #define CP_REG_ADCD1 0x51 //RW, apple device certificate data page1, 128bytes #define CP_REG_ADCD2 0x52 //RW, apple device certificate data page2, 128bytes #define CP_REG_ADCD3 0x53 //RW, apple device certificate data page3, 128bytes #define CP_REG_ADCD4 0x54 //RW, apple device certificate data page4, 128bytes #define CP_REG_ADCD5 0x55 //RW, apple device certificate data page5, 128bytes #define CP_REG_ADCD6 0x56 //RW, apple device certificate data page6, 128bytes #define CP_REG_ADCD7 0x57 //RW, apple device certificate data page7, 128bytes #define CP_REG_ADCD8 0x58 //RW, apple device certificate data page8, 128bytes /** @defgroup ACP Authentication Coprocessor * @brief apple's authentication coprocessor module driver * @{ */ /*============================================================================* * Types *============================================================================*/ /** @defgroup ACP_Exported_Types Authentication Coprocessor Exported Types * @{ */ //cp process result /** @brief ACP process repsonse value */ typedef enum { CP_PRO_RES_NO_VALID = 0x80, //!