SIMULINK_ADC  1.0
Приём данных от АЦП
Classes | Typedefs | Functions | Variables
adc_ctrl.cpp File Reference
#include "adc_ctrl.h"
#include "mu_ctrl.h"
#include <math.h>
#include <conio.h>
#include <process.h>

Go to the source code of this file.

Classes

struct  _THREAD_PARAM
 

Typedefs

typedef struct _THREAD_PARAM THREAD_PARAM
 
typedef struct _THREAD_PARAMPTHREAD_PARAM
 

Functions

void MappingIsviParams (BRD_Handle hADC, unsigned long long nNumberOfBytes)
 
void DisplayError (S32 status, const char *func_name, const BRDCHAR *cmd_str)
 
int CheckClock (BRD_Handle hADC, BRDCHAR *AdcSrvName)
 
S32 AdcSettings (BRD_Handle hADC, int idx, BRDCHAR *srvName, BRDCHAR *iniFileName)
 
S32 DaqIntoFifo (BRD_Handle hADC, PVOID pSig, ULONG bBufSize, int DspMode)
 
S32 DaqIntoFifoDMA (BRD_Handle hADC)
 
S32 AllocDaqBuf (BRD_Handle hADC, PVOID *&pSig, unsigned long long *pbytesBufSize, ULONG bufType, ULONG *pBlkNum)
 
S32 FreeDaqBuf (BRD_Handle hADC, ULONG blkNum)
 
void MapWrFlagSinc (int flg, int isNewParam)
 
int MapRdFlagSinc ()
 
unsigned __stdcall DirWriteIntoFile (void *pParams)
 
int SimpleProcWrDir (BRD_Handle hSrv, HANDLE hfile, int idx, BRDctrl_StreamCBufAlloc *buf_dscr)
 
int MultiBlkProcWrDir (BRD_Handle hSrv, HANDLE hfile, int idx, BRDctrl_StreamCBufAlloc *buf_dscr)
 
void DspFunc (void *buf, ULONG size)
 
void DirectFile (ULONG bufType, ULONG FileBufSize, ULONG FileBufNum, ULONG FileBlkNum)
 

Variables

HANDLE * g_hBufFileMap = NULL
 
HANDLE g_hFlgFileMap = NULL
 
HANDLE g_hPostfixFileMap = NULL
 
int g_fileMap
 
ULONG * g_pFlags
 
char * g_pPostfix
 
BRDctrl_StreamCBufAlloc g_buf_dscr
 
BRD_Handle g_hSRV
 
ULONG g_MemAsFifo
 
ULONG g_AdcDrqFlag
 
ULONG g_MemDrqFlag
 
double g_samplRate
 
int g_IoDelay
 
BRDCHAR g_AdcSrvName []
 
ULONG g_Cycle
 
unsigned long long g_samplesOfChannel
 
unsigned long long g_bBufSize
 
int g_DirWriteFile
 
ULONG g_FileBufSize
 
int g_transRate
 
int g_PretrigMode
 
long long g_nPostTrigSamples
 
int g_flbreak = 0
 
ULONG g_bufType
 
ULONG g_fileBufSize
 
ULONG g_fileBufNum
 
ULONG g_fileBlkNum
 
BRDCHAR g_dirFileName []
 

Typedef Documentation

◆ PTHREAD_PARAM

typedef struct _THREAD_PARAM * PTHREAD_PARAM

◆ THREAD_PARAM

typedef struct _THREAD_PARAM THREAD_PARAM

Function Documentation

◆ AdcSettings()

S32 AdcSettings ( BRD_Handle  hADC,
int  idx,
BRDCHAR *  srvName,
BRDCHAR *  iniFileName 
)

◆ AllocDaqBuf()

S32 AllocDaqBuf ( BRD_Handle  hADC,
PVOID *&  pSig,
unsigned long long *  pbytesBufSize,
ULONG  bufType,
ULONG *  pBlkNum 
)

Definition at line 806 of file adc_ctrl.cpp.

References DisplayError(), g_buf_dscr, g_fileMap, g_hBufFileMap, g_hFlgFileMap, and g_pFlags.

◆ CheckClock()

int CheckClock ( BRD_Handle  hADC,
BRDCHAR *  AdcSrvName 
)

Definition at line 82 of file adc_ctrl.cpp.

Referenced by AdcSettings().

◆ DaqIntoFifo()

S32 DaqIntoFifo ( BRD_Handle  hADC,
PVOID  pSig,
ULONG  bBufSize,
int  DspMode 
)

Definition at line 648 of file adc_ctrl.cpp.

References g_MemAsFifo.

◆ DaqIntoFifoDMA()

S32 DaqIntoFifoDMA ( BRD_Handle  hADC)

Definition at line 697 of file adc_ctrl.cpp.

References DisplayError(), g_AdcDrqFlag, g_bBufSize, g_MemAsFifo, g_MemDrqFlag, and g_transRate.

◆ DirectFile()

void DirectFile ( ULONG  bufType,
ULONG  FileBufSize,
ULONG  FileBufNum,
ULONG  FileBlkNum 
)

◆ DirWriteIntoFile()

unsigned __stdcall DirWriteIntoFile ( void *  pParams)

◆ DisplayError()

void DisplayError ( S32  status,
const char *  func_name,
const BRDCHAR *  cmd_str 
)

◆ DspFunc()

void DspFunc ( void *  buf,
ULONG  size 
)

◆ FreeDaqBuf()

S32 FreeDaqBuf ( BRD_Handle  hADC,
ULONG  blkNum 
)

Definition at line 913 of file adc_ctrl.cpp.

References DisplayError(), g_buf_dscr, g_fileMap, g_hBufFileMap, g_hFlgFileMap, and g_pFlags.

◆ MappingIsviParams()

void MappingIsviParams ( BRD_Handle  hADC,
unsigned long long  nNumberOfBytes 
)

Definition at line 517 of file adc_ctrl.cpp.

References g_AdcSrvName, g_Cycle, g_pPostfix, g_samplRate, and MAX_CHAN.

Referenced by AdcSettings().

◆ MapRdFlagSinc()

int MapRdFlagSinc ( )

Definition at line 1012 of file adc_ctrl.cpp.

References g_pFlags.

◆ MapWrFlagSinc()

void MapWrFlagSinc ( int  flg,
int  isNewParam 
)

Definition at line 1005 of file adc_ctrl.cpp.

References g_buf_dscr, and g_pFlags.

◆ MultiBlkProcWrDir()

int MultiBlkProcWrDir ( BRD_Handle  hSrv,
HANDLE  hfile,
int  idx,
BRDctrl_StreamCBufAlloc *  buf_dscr 
)

Definition at line 1282 of file adc_ctrl.cpp.

References DisplayError(), g_fileBufNum, and g_flbreak.

Referenced by DirWriteIntoFile().

◆ SimpleProcWrDir()

int SimpleProcWrDir ( BRD_Handle  hSrv,
HANDLE  hfile,
int  idx,
BRDctrl_StreamCBufAlloc *  buf_dscr 
)

Definition at line 1218 of file adc_ctrl.cpp.

References DisplayError(), g_fileBufNum, and g_flbreak.

Referenced by DirWriteIntoFile().

Variable Documentation

◆ g_AdcDrqFlag

ULONG g_AdcDrqFlag

Definition at line 15 of file adc_ctrl_data.cpp.

Referenced by AdcSettings(), DaqIntoFifoDMA(), and DirWriteIntoFile().

◆ g_AdcSrvName

BRDCHAR g_AdcSrvName[]

Definition at line 20 of file adc_ctrl_data.cpp.

Referenced by MappingIsviParams().

◆ g_bBufSize

unsigned long long g_bBufSize

Definition at line 23 of file adc_ctrl_data.cpp.

Referenced by AdcSettings(), and DaqIntoFifoDMA().

◆ g_buf_dscr

BRDctrl_StreamCBufAlloc g_buf_dscr

Definition at line 25 of file adc_ctrl.cpp.

Referenced by AllocDaqBuf(), FreeDaqBuf(), and MapWrFlagSinc().

◆ g_bufType

ULONG g_bufType

Definition at line 1037 of file adc_ctrl.cpp.

Referenced by DirectFile(), and DirWriteIntoFile().

◆ g_Cycle

ULONG g_Cycle

Definition at line 21 of file adc_ctrl_data.cpp.

Referenced by MappingIsviParams().

◆ g_dirFileName

BRDCHAR g_dirFileName[]

Definition at line 26 of file adc_ctrl_data.cpp.

Referenced by DirWriteIntoFile().

◆ g_DirWriteFile

int g_DirWriteFile

Definition at line 24 of file adc_ctrl_data.cpp.

Referenced by AdcSettings().

◆ g_fileBlkNum

ULONG g_fileBlkNum

Definition at line 1040 of file adc_ctrl.cpp.

Referenced by DirectFile(), and DirWriteIntoFile().

◆ g_fileBufNum

ULONG g_fileBufNum

Definition at line 1039 of file adc_ctrl.cpp.

Referenced by DirectFile(), DirWriteIntoFile(), MultiBlkProcWrDir(), and SimpleProcWrDir().

◆ g_FileBufSize

ULONG g_FileBufSize

Definition at line 25 of file adc_ctrl_data.cpp.

Referenced by AdcSettings().

◆ g_fileBufSize

ULONG g_fileBufSize

Definition at line 1038 of file adc_ctrl.cpp.

Referenced by DirectFile(), and DirWriteIntoFile().

◆ g_fileMap

int g_fileMap

Definition at line 12 of file adc_ctrl_data.cpp.

Referenced by AdcSettings(), AllocDaqBuf(), and FreeDaqBuf().

◆ g_flbreak

int g_flbreak = 0

Definition at line 1035 of file adc_ctrl.cpp.

Referenced by DirectFile(), MultiBlkProcWrDir(), and SimpleProcWrDir().

◆ g_hBufFileMap

HANDLE* g_hBufFileMap = NULL

Definition at line 16 of file adc_ctrl.cpp.

Referenced by AllocDaqBuf(), and FreeDaqBuf().

◆ g_hFlgFileMap

HANDLE g_hFlgFileMap = NULL

Definition at line 17 of file adc_ctrl.cpp.

Referenced by AllocDaqBuf(), and FreeDaqBuf().

◆ g_hPostfixFileMap

HANDLE g_hPostfixFileMap = NULL

Definition at line 18 of file adc_ctrl.cpp.

Referenced by AdcSettings().

◆ g_hSRV

BRD_Handle g_hSRV

Definition at line 13 of file adc_ctrl_data.cpp.

Referenced by DirectFile().

◆ g_IoDelay

int g_IoDelay

Definition at line 18 of file adc_ctrl_data.cpp.

Referenced by AdcSettings().

◆ g_MemAsFifo

ULONG g_MemAsFifo

Definition at line 14 of file adc_ctrl_data.cpp.

Referenced by DaqIntoFifo(), DaqIntoFifoDMA(), and DirWriteIntoFile().

◆ g_MemDrqFlag

ULONG g_MemDrqFlag

Definition at line 16 of file adc_ctrl_data.cpp.

Referenced by AdcSettings(), DaqIntoFifoDMA(), and DirWriteIntoFile().

◆ g_nPostTrigSamples

long long g_nPostTrigSamples

Definition at line 30 of file adc_ctrl_data.cpp.

Referenced by AdcSettings().

◆ g_pFlags

ULONG* g_pFlags

Definition at line 22 of file adc_ctrl.cpp.

Referenced by AllocDaqBuf(), FreeDaqBuf(), MapRdFlagSinc(), and MapWrFlagSinc().

◆ g_pPostfix

char* g_pPostfix

Definition at line 23 of file adc_ctrl.cpp.

Referenced by AdcSettings(), and MappingIsviParams().

◆ g_PretrigMode

int g_PretrigMode

Definition at line 29 of file adc_ctrl_data.cpp.

Referenced by AdcSettings().

◆ g_samplesOfChannel

unsigned long long g_samplesOfChannel

Definition at line 22 of file adc_ctrl_data.cpp.

Referenced by AdcSettings().

◆ g_samplRate

double g_samplRate

Definition at line 17 of file adc_ctrl_data.cpp.

Referenced by AdcSettings(), and MappingIsviParams().

◆ g_transRate

int g_transRate

Definition at line 28 of file adc_ctrl_data.cpp.

Referenced by DaqIntoFifoDMA().