summaryrefslogtreecommitdiff
path: root/ports/c667x/ccs/example_build/include/TA66XX_DSP.h
blob: 46094815691e46fbe7917d65a97a993a6a05c5d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation                                */
/* Copyright (c) 2026 Eclipse ThreadX contributors                         */
/*                                                                         */
/* This program and the accompanying materials are made available under    */
/* the terms of the MIT License which is available at                      */
/* https://opensource.org/licenses/MIT.                                    */
/*                                                                         */
/* SPDX-License-Identifier: MIT                                            */
/***************************************************************************/

/******************************************************************************
	TORNADO AMC modules Software Development Kit (SDK). Rev 4A.
	General definitions and API functions.
	(C) MicroLAB Systems, 2015-2017


	http://www.mlabsys.com
	ftp://ftp.mlabsys.com
	email: [email protected]


	Description:
	------------
	This file contains general definitions and API functions for TORNADO AMC
	modules SDK and must be included in the user C-application for
	TORNADO AMC modules.


	Revision history:
	-----------------
	rev.2A		- 2015, initial release for TORNADO-A6678 board rev.1B;
	rev.3A		- 2016:
						- added support for TORNADO-A6678/FMC board rev.1A;
	rev.3B		- 2017:
						- added support for TORNADO-A6678/FMC board rev.1B;
	rev.4A		- 2017:
					- added support for TORNADO-AZ/FMC board rev.1A;


	Notes:
	------
	1.	This C-header file is an include file for TI C6xxx C/C++ Code
		Generation Tools, which must be invoked to compile for C66xx DSP
		platform.

	2.	This file is best viewed with the TAB setting set to '4'.


	Copyright:
	----------
	This utility is supplied free of charge as it is without any obligation
	from MicroLAB Systems. No responsibility is assumed for any use or misuse
	of these utilities.

******************************************************************************/


/**
 * @file  TA66XX_DSP.h
 *
 * @brief  Main include file
 *
 * This file contains general definitions and API functions for TORNADO
 * AMC modules SDK
 *
 */


#ifndef __TA66XX_DSP_H__									// check for this file has been already included
#define __TA66XX_DSP_H__									1


// General defs
#define TA66XX_ON											1
#define TA66XX_OFF											0


// Include C66xx DSP defs, macros and aux functions
#include "C66XX.h"
// Include TORNADO AMC SDK functions errors
#include "TASDK_ERR.h"



//=============================================================================
/** TORNADO AMC SDK revision ID */
#define TA66XX_SDK_REVISION_ID								"4A"
//=============================================================================



//=============================================================================
//============ TORNADO AMC SDK API functions ID defs ==========================
//=============================================================================
/** @addtogroup  TA66XX_FUNCTIONS_ID  SDK API functions ID defs
 *  @{
 */


/**< Function name max size */
#define TA66XX_FUNCTION_NAME_LEN_MAX						64


enum
{
	TA66XX_GET_ERROR_MESSAGE_FUNCTION_ID = 0,
	TA66XX_GET_FUNCTION_NAME_FUNCTION_ID,
	TA66XX_BC_SET_I2C_INTERRUPT_NUMBER_FUNCTION_ID,
	TA66XX_BC_SET_UART_INTERRUPT_NUMBER_FUNCTION_ID,
	TA66XX_BC_INIT_FUNCTION_ID,
	TA66XX_BC_MAP_DSP_GPIO_INTERRUPT_FUNCTION_ID,
	TA66XX_BC_UNMAP_DSP_GPIO_INTERRUPT_FUNCTION_ID,
	TA66XX_BC_INIT_UART_FUNCTION_ID,
	TA66XX_BC_WRITE_EEPROM_FUNCTION_ID,
	TA66XX_BC_READ_EEPROM_FUNCTION_ID,
	TA66XX_BC_ERASE_EEPROM_FUNCTION_ID,
	TA66XX_BC_GET_DEVICE_INFO_FUNCTION_ID,
	TA66XX_BC_GET_HW_CFG_INFO_FUNCTION_ID,
	TA66XX_BC_GET_FMC_INFO_FUNCTION_ID,
	TA66XX_BC_GET_TEMP_STATE_FUNCTION_ID,
	TA66XX_BC_GET_POWER_STATE_FUNCTION_ID,
	TA66XX_BC_GET_FMC_POWER_STATE_FUNCTION_ID,
	TA66XX_BC_GET_SFP_INFO_FUNCTION_ID,
	TA66XX_BC_SET_FPGA_HIF_CONFIG_FUNCTION_ID,
	TA66XX_BC_GET_FPGA_HIF_CONFIG_FUNCTION_ID,
	TA66XX_BC_CLEAR_FPGA_CNF_FUNCTION_ID,
	TA66XX_BC_LOAD_FPGA_CNF_FUNCTION_ID,
	TA66XX_BC_GET_GBE_PORT_INFO_FUNCTION_ID,
	TA66XX_BC_INIT_GBE_PORT_FUNCTION_ID,
	TA66XX_BC_ERASE_FLASH_FUNCTION_ID,
	TA66XX_BC_WRITE_FLASH_FUNCTION_ID,
	TA66XX_BC_READ_FLASH_FUNCTION_ID,
	TA66XX_SC_INIT_FLASH_RECORD_LIST_FUNCTION_ID,
	TA66XX_SC_GET_NUMBER_OF_FLASH_RECORDS_FUNCTION_ID,
	TA66XX_SC_GET_FLASH_RECORD_LIST_FUNCTION_ID,
	TA66XX_SC_GET_FLASH_RECORD_INFO_FUNCTION_ID,
	TA66XX_SC_READ_FLASH_RECORD_DATA_FUNCTION_ID,
	TA66XX_SC_CREATE_FLASH_RECORD_FUNCTION_ID,
	TA66XX_SC_WRITE_FLASH_RECORD_DATA_FUNCTION_ID,
	TA66XX_SC_XCLOSE_FLASH_RECORD_FUNCTION_ID,
	TA66XX_SC_UPDATE_FLASH_RECORD_FUNCTION_ID,
	TA66XX_SC_DELETE_FLASH_RECORD_FUNCTION_ID,
	TA66XX_SC_SQUEEZE_FLASH_RECORDS_FUNCTION_ID,
	TA66XX_SC_GET_FLASH_FREE_SPACE_FUNCTION_ID,
	TA66XX_SC_GET_BOOT_SEQ_FUNCTION_ID,
	TA66XX_SC_DELETE_BOOT_SEQ_FUNCTION_ID,
	TA66XX_SC_SET_BOOT_SEQ_FUNCTION_ID,
	TA66XX_SC_LOAD_DSP_APPL_FROM_MEMORY_FUNCTION_ID,
	TA66XX_SC_LOAD_DSP_APPL_FROM_FLASH_RECORD_FUNCTION_ID,
	TA66XX_SC_LOAD_FPGA_CNF_FROM_FLASH_RECORD_FUNCTION_ID,
	TA66XX_NUMBER_OF_FUNCTIONS
};
/** @}*/
//=============================================================================



#ifdef __cplusplus
extern "C" {
#endif



//=============================================================================
//============ General SDK API functions declarations =========================
//=============================================================================

/** @addtogroup  TA66XX_GENERAL  TORNADO AMC SDK general API functions
 *  @{
 */

/*------------ TA66XX_set_error() function -------------------------------*//**
 * @brief  Function should be used on exit from SDK API functions in
 * order to set error code and function ID of SDK API functions
 *
 * @param[in]  err - error code;
 * @param[in]  function_id - function ID of SDK API functions;
 *
 * @return  Error code
 *
-----------------------------------------------------------------------------*/
int32_t TA66XX_set_error(int32_t err, int32_t function_id);


/*------------ TA66XX_get_last_error() function --------------------------*//**
 * @brief  Function returns error code of last executed API function
 *
 * @return  Error code of last executed API function
 *
-----------------------------------------------------------------------------*/
int32_t TA66XX_get_last_error(void);


/*------------ TA66XX_get_error_flag() function --------------------------*//**
 * @brief  Function returns status of ERROR_FLAG for API functions
 *
 * ERROR_FLAG is set by each API function in case error has been detected.
 * ERROR_FLAG can be reset by TA66XX_clear_error_flag() API function
 *
 * @param[out]  error_code - pointer to a variable to receive the error code in
 *					case error has been detected. In case pointer is NULL, then
 *					no error code is returned;
 * @param[out]  error_function_id - pointer to a variable to receive ID of the
 *					first API function, which has returned with error. In case
 *					pointer is NULL, then no function ID is returned;
 *
 * @return  Status of ERROR_FLAG: ON or OFF
 *
-----------------------------------------------------------------------------*/
int32_t TA66XX_get_error_flag(int32_t *error_code, int32_t *error_function_id);


/*------------ TA66XX_clear_error_flag() function ------------------------*//**
 * @brief  Function clear ERROR_FLAG for API functions
 *
 * @return  Always OK
 *
-----------------------------------------------------------------------------*/
int32_t TA66XX_clear_error_flag(void);


/*------------ TA66XX_get_error_message() function -----------------------*//**
 * @brief  Function returns the text interpretation of the error code.
 *
 * @param[in]  error - error code to be interpreted;
 * @param[out]  error_message - pointer to the returned string. In case pointer
 *				is NULL, then no text is filled in;
 *
 * @return  Error code
 *
-----------------------------------------------------------------------------*/
int32_t TA66XX_get_error_message(int32_t error, char *error_message);


/*------------ TA66XX_get_function_name() function -----------------------*//**
 * @brief  Function returns the text interpretation of API function.
 *
 * @param[in]  function_id - ID of the API function to be interpreted;
 * @param[out]  function_name - pointer to the returned string. In case pointer
 *				is NULL, then no text is filled in;
 *
 * @return  Error code
 *
-----------------------------------------------------------------------------*/
int32_t TA66XX_get_function_name(int32_t function_id, char *function_name);


/** @}*/
//=============================================================================



#ifdef __cplusplus
}
#endif



//=============================================================================
#endif /* __TA66XX_DSP_H__ */