/*  *********************************************************************
    *  ASTRIS - Remote JTAG probe
    *
    *  Chip Server protocol             File: csprotocol_shared.h
    *
    *  The shared parts of the protocol, that can be exported out in private.
    *
    *
    *********************************************************************
    *
    *  Copyright (C) 2009-2021  Apple, Inc. All rights reserved.
    *
    *  This document is the property of Apple Inc.
    *  It is considered confidential and proprietary.
    *
    *  This document may not be reproduced or transmitted in any form,
    *  in whole or in part, without the express written permission of
    *  Apple Inc.
    ********************************************************************* */

#ifndef csprotocol_shared_h
#define csprotocol_shared_h

typedef struct cscommand_s {
    uint16_t cs_type;
    uint16_t cs_length;
    uint16_t cs_chip;
    uint8_t  cs_id;
    uint8_t  cs_flags;
    /* data goes here */
} cscommand_t;

typedef struct csversion_s {
    uint16_t csv_board_type;
    uint16_t csv_board_serial;
    uint16_t csv_firmware_version;
    uint8_t  csv_board_revision;
    uint8_t  csv_protocol_version;
    uint8_t  csv_protocol_revision;
    uint8_t  csv_protocol_flags1;
    uint8_t  csv_protocol_flags2;
    uint8_t  csv_macaddr[6];
    uint8_t  csv_fwvers_extra[3];
    uint16_t csv_maxscan;
    uint16_t csv_maxbuf;
} csversion_t;


typedef struct jtagchip_s {
    uint32_t idcode;            /* Chip's IDCODE */
    uint8_t  irlen;             /* Instruction register length */
    uint8_t  type;              /* Type of chip behind this IDCODE */
    uint8_t  irbefore, irafter; /* total instruction bits before and after this one */
    uint8_t  drbefore, drafter; /* total data bits before and after this one */
    uint16_t chiphandle;        /* Chip handle */
    uint16_t reserved;          /* Reserved / Round to 4 32-bit words */
} jtagchip_t;



#endif /* csprotocol_shared_h */
