1 /*
2  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3  *
4  *
5  *  Redistribution and use in source and binary forms, with or without
6  *  modification, are permitted provided that the following conditions
7  *  are met:
8  *
9  *    Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  *    Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the
15  *    distribution.
16  *
17  *    Neither the name of Texas Instruments Incorporated nor the names of
18  *    its contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #include "msp430.h"
35 
36 #ifndef _HIL_STRUCTS_H__
37 #define _HIL_STRUCTS_H__
38 
39 /**
40  @brief Structure of pointers to all exported EDT functions.
41 */
42 struct edt_common_methods
43 {
44     short (*Init)(void);
45     short (*SetVcc)(unsigned short);
46     void  (*SwitchVccFET)(unsigned short);
47     short (*GetVcc)(double*, double*);
48     short (*SetProtocol)(unsigned short);
49     void  (*SetPsaTCLK)(unsigned short);
50     short (*Open)(unsigned char state);
51     short (*Close)(void);
52     void  (*Delay_1us)(unsigned short);
53     void  (*Delay_1ms)(unsigned short);
54     short (*Loop)(unsigned short);
55     void  (*EntrySequences)(unsigned char);
56     void (*SetReset)(unsigned char);      // Set the Reset pin to the specified value
57     void (*SetTest)(unsigned char);       // Set the Test pin to the specified value
58     void (*SetJtagSpeed)(unsigned short, unsigned short);
59     void (*ConfigureSetPc)(unsigned short);
60     void (*initDelayTimer)(void);
61     void (*BSL_EntrySequence)(unsigned short switchBypassOff);
62     void (*SetTMS)(unsigned char);      // Set the TMS pin to the specified value
63     void (*SetTCK)(unsigned char);      // Set the TCK pin to the specified value
64     void (*SetTDI)(unsigned char);      // Set the TDI pin to the specified value
65     short (*regulateVcc)(void);
66     void (*setFpgaTimeOut)(unsigned short state);
67     unsigned short (*getFpgaVersion)(void);
68     void (*ReadADC12)(void);
69     void (*ConfigFpgaIoMode)(unsigned short mode);
70     void (*BSL_EntrySequence1xx_4xx)(void);
71     void (*SetToolID)(unsigned short id);
72 };
73 typedef struct edt_common_methods edt_common_methods_t;
74 
75 struct edt_distinct_methods
76 {
77     short (*TapReset)(void);
78     short (*CheckJtagFuse)(void);
79     unsigned char (*Instr)(unsigned char);
80     unsigned char (*Instr04)(unsigned char);
81     unsigned char (*SetReg_XBits08)(unsigned char);
82     unsigned short (*SetReg_XBits16)(unsigned short);
83     unsigned long (*SetReg_XBits20)(unsigned long);
84     unsigned long (*SetReg_XBits32)(unsigned long);
85     unsigned long long (*SetReg_XBits35)(unsigned long long *Data);
86     unsigned long long (*SetReg_XBits64)(unsigned long long);
87     unsigned long long (*SetReg_XBits8_64)(unsigned long long, unsigned short, unsigned short);
88     unsigned long long (*SetReg_XBits)(unsigned long long *Data, unsigned short count);
89     void (*Tclk)(unsigned char);
90     void (*StepPsa)(unsigned long);
91     short (*BlowFuse)(unsigned char); // Blow the JTAG acces fuse
92     unsigned char (*GetPrevInstruction)(void);
93     short (*write_read_Dp)(unsigned char address, unsigned long *data, unsigned short rnw);
94     short (*write_read_Ap)(unsigned long address, unsigned long *data, unsigned short rnw);
95     short (*write_read_mem_Ap)(unsigned short ap_sel, unsigned long address, unsigned long *data, unsigned short rnw);
96     unsigned long (*GetJtagIdCode)();
97     unsigned char (*SwdTransferData)(unsigned char regiser, unsigned long* data, unsigned char rnw);
98 };
99 typedef struct edt_distinct_methods edt_distinct_methods_t;
100 
101 #endif
102