Razvalyaev
7e0063eee0
Все основные файлы подтянуты без изменений Изменены (только папка main_matlab): - заглушки для ненужных функций (main_matlab.c) - iq библиотека (IQmathLib_matlab.c) - библиотеки DSP281x
415 lines
8.2 KiB
C
415 lines
8.2 KiB
C
#ifndef PROJECT_SETUP_H
|
|
#define PROJECT_SETUP_H
|
|
|
|
/*
|
|
|
|
Ãëîáàëüíàß íàñòðîéêà äëß ñáîðà ëèáû â myXilinx
|
|
 çàâèñèìîñòè îò C_PROJECT_TYPE ïðîèñõîäèò ñáîð
|
|
|
|
project_setup.h äîëæåí ëåæàòü â ïàïêå /main/
|
|
ò.å. âíå /myXilinx/
|
|
ò.ê. îí äëß êàæäîãî ïðîåêòà îí äîëæåí áûòü óíèêàëåí!
|
|
*/
|
|
|
|
/*------------------------------------------------------------------------------
|
|
Project type
|
|
------------------------------------------------------------------------------*/
|
|
// âñå âîçìîæíûå ïðîåêòû
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
#define PROJECT_22220 10
|
|
#define PROJECT_21300 11
|
|
#define PROJECT_21180 12
|
|
#define PROJECT_BALZAM 13
|
|
#define PROJECT_23470 14
|
|
#define PROJECT_23550 15
|
|
#define PROJECT_10510 16
|
|
|
|
|
|
#define PROJECT_STEND_D PROJECT_BALZAM
|
|
|
|
///////////////////////////////////////////////
|
|
// âûáèðàåì íóæíûé ïðîåêò
|
|
///////////////////////////////////////////////
|
|
|
|
//#define C_PROJECT_TYPE PROJECT_21180
|
|
//#define C_PROJECT_TYPE PROJECT_21300
|
|
//#define C_PROJECT_TYPE PROJECT_22220
|
|
//#define C_PROJECT_TYPE PROJECT_BALZAM
|
|
//#define C_PROJECT_TYPE PROJECT_23470
|
|
//#define C_PROJECT_TYPE PROJECT_STEND_D
|
|
|
|
#define C_PROJECT_TYPE PROJECT_23550
|
|
//#define C_PROJECT_TYPE PROJECT_10510
|
|
|
|
// Íàñòðîéêà ñêîðîñòåé RS232
|
|
#define RS232_SPEED_A 57600//115200//57600
|
|
#define RS232_SPEED_B 57600//115200//57600//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
// Íàñòðîéêà òèïà ØÈÌà
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#if (C_PROJECT_TYPE==PROJECT_23550 || C_PROJECT_TYPE==PROJECT_BALZAM)
|
|
#define XPWMGEN 1 // ØÈÌ îò xilinx 24
|
|
#define TMSPWMGEN 0 // ØÈÌ îò tms
|
|
#else
|
|
#define XPWMGEN 0 // ØÈÌ îò xilinx 24
|
|
#define TMSPWMGEN 1 // ØÈÌ îò tms
|
|
#endif
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#if (TMSPWMGEN==1) && (XPWMGEN==1)
|
|
#error "Îøèáêà íàñòðîéêè ïðîåêòà. Âûáðàíî îáà òèïà ØÈÌà!!!"
|
|
|
|
#endif
|
|
|
|
|
|
#if (TMSPWMGEN==1)
|
|
|
|
#else //TMSPWMGEN
|
|
|
|
#if (XPWMGEN==1)
|
|
#else
|
|
|
|
#error "Îøèáêà íàñòðîéêè ïðîåêòà. Íå âûáðàí òèï ØÈÌà!!!"
|
|
|
|
#endif //XPWMGEN
|
|
#endif //TMSPWMGEN
|
|
|
|
////////////////////////////////////////////////
|
|
////////////////////////////////////////////////
|
|
/////////////////////////////////////////////////
|
|
// Íàñòðîéêà êîëè÷åñòâà ïëàò äëß ïðîåêòà
|
|
////////////////////////////////////////////////
|
|
/////////////////////////////////////////////////
|
|
#if (_FLOOR6==0)
|
|
#define USE_ADC_0 1
|
|
#define USE_ADC_1 1
|
|
////#define USE_ADC_2 1
|
|
//
|
|
#define USE_IN_0 1
|
|
|
|
#define USE_IN_1 1
|
|
//////#define USE_IN_2 1
|
|
////
|
|
#define USE_OUT_0 1
|
|
//////#define USE_OUT_1 1
|
|
//////#define USE_OUT_2 1
|
|
////
|
|
////
|
|
#define USE_TK_0 1
|
|
#define USE_TK_1 1
|
|
////
|
|
#define USE_TK_2 1
|
|
#define USE_TK_3 1
|
|
////
|
|
//////#define USE_TK_4 1
|
|
//////#define USE_TK_5 1
|
|
//////#define USE_TK_6 1
|
|
//////#define USE_TK_7 1
|
|
////
|
|
#define USE_HWP_0 1
|
|
////#define USE_HWP_1 1
|
|
//////#define USE_HWP_2 1
|
|
////
|
|
//////#define USE_ROT_1 1
|
|
|
|
#else
|
|
|
|
#if (_FLOOR6_ADD==1)
|
|
|
|
#define USE_ADC_0 1
|
|
#define USE_ADC_1 1
|
|
//////
|
|
#define USE_IN_0 1
|
|
////
|
|
//#define USE_IN_1 1
|
|
////////
|
|
//#define USE_OUT_0 1
|
|
////////
|
|
////////
|
|
#define USE_TK_0 1
|
|
#define USE_TK_1 1
|
|
//////
|
|
#define USE_TK_2 1
|
|
#define USE_TK_3 1
|
|
|
|
//#define USE_HWP_0 1
|
|
|
|
|
|
#else
|
|
|
|
#define USE_ADC_0 1
|
|
#define USE_ADC_1 1
|
|
////
|
|
#define USE_IN_0 1
|
|
//
|
|
#define USE_IN_1 1
|
|
//////
|
|
#define USE_OUT_0 1
|
|
//////
|
|
//////
|
|
#define USE_TK_0 1
|
|
#define USE_TK_1 1
|
|
////
|
|
#define USE_TK_2 1
|
|
#define USE_TK_3 1
|
|
|
|
#define USE_HWP_0 1
|
|
#define USE_HWP_1 1
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
////////////////////////////////////////////////
|
|
// Íàñòðîéêà òèïà ïëàò SP2 èëè SP6
|
|
////////////////////////////////////////////////
|
|
////////////////////////////////////////////////
|
|
////////////////////////////////////////////////
|
|
|
|
#define TYPE_CDS_XILINX_IN_0 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_IN_1 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_IN_2 TYPE_CDS_XILINX_SP2
|
|
|
|
#define TYPE_CDS_XILINX_OUT_0 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_OUT_1 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_OUT_2 TYPE_CDS_XILINX_SP2
|
|
|
|
#define TYPE_CDS_XILINX_TK_0 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_TK_1 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_TK_2 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_TK_3 TYPE_CDS_XILINX_SP6
|
|
#define TYPE_CDS_XILINX_TK_4 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_TK_5 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_TK_6 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_TK_7 TYPE_CDS_XILINX_SP2
|
|
|
|
#define TYPE_CDS_XILINX_ADC_0 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_ADC_1 TYPE_CDS_XILINX_SP2
|
|
#define TYPE_CDS_XILINX_ADC_2 TYPE_CDS_XILINX_SP2
|
|
|
|
#define TYPE_CDS_XILINX_RS_0 TYPE_CDS_XILINX_SP2
|
|
|
|
////////////////////////////////////////////////
|
|
////////////////////////////////////////////////
|
|
////////////////////////////////////////////////
|
|
|
|
//#define TYPE_CDS_XILINX_HWP_0_1 MODE_HWP_SPEED_SLOW
|
|
|
|
#ifndef USE_ADC_0
|
|
#define USE_ADC_0 0
|
|
#endif
|
|
|
|
#ifndef USE_ADC_1
|
|
#define USE_ADC_1 0
|
|
#endif
|
|
|
|
#ifndef USE_ADC_2
|
|
#define USE_ADC_2 0
|
|
#endif
|
|
|
|
|
|
#ifndef USE_IN_0
|
|
#define USE_IN_0 0
|
|
#endif
|
|
|
|
#ifndef USE_IN_1
|
|
#define USE_IN_1 0
|
|
#endif
|
|
|
|
#ifndef USE_IN_2
|
|
#define USE_IN_2 0
|
|
#endif
|
|
|
|
|
|
#ifndef USE_OUT_0
|
|
#define USE_OUT_0 0
|
|
#endif
|
|
|
|
#ifndef USE_OUT_1
|
|
#define USE_OUT_1 0
|
|
#endif
|
|
|
|
#ifndef USE_OUT_2
|
|
#define USE_OUT_2 0
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef USE_TK_0
|
|
#define USE_TK_0 0
|
|
#endif
|
|
|
|
#ifndef USE_TK_1
|
|
#define USE_TK_1 0
|
|
#endif
|
|
|
|
|
|
//
|
|
#ifndef USE_TK_2
|
|
#define USE_TK_2 0
|
|
#endif
|
|
|
|
#ifndef USE_TK_3
|
|
#define USE_TK_3 0
|
|
#endif
|
|
|
|
|
|
#ifndef USE_TK_4
|
|
#define USE_TK_4 0
|
|
#endif
|
|
|
|
#ifndef USE_TK_5
|
|
#define USE_TK_5 0
|
|
#endif
|
|
|
|
#ifndef USE_TK_6
|
|
#define USE_TK_6 0
|
|
#endif
|
|
|
|
#ifndef USE_TK_7
|
|
#define USE_TK_7 0
|
|
#endif
|
|
|
|
|
|
#ifndef USE_HWP_0
|
|
#define USE_HWP_0 0
|
|
#endif
|
|
|
|
#ifndef USE_HWP_1
|
|
#define USE_HWP_1 0
|
|
#endif
|
|
|
|
#ifndef USE_HWP_2
|
|
#define USE_HWP_2 0
|
|
#endif
|
|
|
|
|
|
#ifndef USE_ROT_1
|
|
#define USE_ROT_1 0
|
|
#endif
|
|
|
|
|
|
|
|
////////////////////////////////////////////////
|
|
// àâòîìàòè÷åñêè èäåò ïîäñ÷åò ïëàò â ïðîåêòå
|
|
////////////////////////////////////////////////
|
|
#if (USE_HWP_2==1)
|
|
#define MAX_COUNT_PLATES_HWP 3
|
|
#else
|
|
#if (USE_HWP_1==1)
|
|
#define MAX_COUNT_PLATES_HWP 2
|
|
#else
|
|
#define MAX_COUNT_PLATES_HWP 1
|
|
#endif
|
|
#endif
|
|
////////////////////////////////////////////////
|
|
|
|
#if (USE_TK_7==1)
|
|
#define MAX_COUNT_PLATES_CDS_TK 8
|
|
#else
|
|
#if (USE_TK_6==1)
|
|
#define MAX_COUNT_PLATES_CDS_TK 7
|
|
#else
|
|
#if (USE_TK_5==1)
|
|
#define MAX_COUNT_PLATES_CDS_TK 6
|
|
#else
|
|
#if (USE_TK_4==1)
|
|
#define MAX_COUNT_PLATES_CDS_TK 5
|
|
#else
|
|
#if (USE_TK_3==1)
|
|
#define MAX_COUNT_PLATES_CDS_TK 4
|
|
#else
|
|
#if (USE_TK_2==1)
|
|
#define MAX_COUNT_PLATES_CDS_TK 3
|
|
#else
|
|
#if (USE_TK_1==1)
|
|
#define MAX_COUNT_PLATES_CDS_TK 2
|
|
#else
|
|
#if (USE_TK_0==1)
|
|
#define MAX_COUNT_PLATES_CDS_TK 1
|
|
#else
|
|
#define MAX_COUNT_PLATES_CDS_TK 1
|
|
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
////////////////////////////////////////////////
|
|
|
|
#if (USE_ADC_2==1)
|
|
#define MAX_COUNT_PLATES_ADC 3
|
|
#else
|
|
#if (USE_ADC_1==1)
|
|
#define MAX_COUNT_PLATES_ADC 2
|
|
#else
|
|
#if (USE_ADC_0==1)
|
|
#define MAX_COUNT_PLATES_ADC 1
|
|
#else
|
|
#define MAX_COUNT_PLATES_ADC 1
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
////////////////////////////////////////////////
|
|
#if (USE_OUT_2==1)
|
|
#define MAX_COUNT_PLATES_OUT 3
|
|
#else
|
|
#if (USE_OUT_1==1)
|
|
#define MAX_COUNT_PLATES_OUT 2
|
|
#else
|
|
#if (USE_OUT_0==1)
|
|
#define MAX_COUNT_PLATES_OUT 1
|
|
#else
|
|
#define MAX_COUNT_PLATES_OUT 1
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
////////////////////////////////////////////////
|
|
////////////////////////////////////////////////
|
|
#if (USE_IN_2==1)
|
|
#define MAX_COUNT_PLATES_IN 3
|
|
#else
|
|
#if (USE_IN_1==1)
|
|
#define MAX_COUNT_PLATES_IN 2
|
|
#else
|
|
#if (USE_IN_0==1)
|
|
#define MAX_COUNT_PLATES_IN 1
|
|
#else
|
|
#define MAX_COUNT_PLATES_IN 1
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
////////////////////////////////////////////////
|
|
|
|
|
|
#if (USE_ROT_1==1)
|
|
#define MAX_COUNT_PLATES_CDS_RS 1
|
|
#else
|
|
#define MAX_COUNT_PLATES_CDS_RS 0
|
|
#endif
|
|
|
|
////////////////////////////////////////////////
|
|
|
|
|
|
#include <params_bsu.h>
|
|
|
|
#endif // end PROJECT_SETUP_H
|
|
|