LLC2_API
Classes | Defines | Functions
ll2-api.cpp File Reference

C wrapper for LOWLATENCY2 API. More...

#include <stdio.h>
#include <assert.h>
#include "ll2.h"
#include "ll2-api.h"

Go to the source code of this file.

Classes

class  DynamicSystem
 singleton More...

Defines

#define RETOK(fun)   do { return (fun) == 0? OK: ERR; } while (0)

Functions

STATUS_OK RtSetup (const char *config_file, int argc, const char *argv[])
 instantiate system
STATUS_OK RtArm (const short *ao_values, const unsigned *do_values)
 arm the capture
STATUS_OK RtIO (const short *ao_values, const unsigned *do_values, short *ai_values, unsigned *di_values, unsigned *status_values)
 set next outputs, wait for and return next sample
STATUS_OK RtDone (void)
 stop and cleanup.

Detailed Description

C wrapper for LOWLATENCY2 API.

Definition in file ll2-api.cpp.


Define Documentation

#define RETOK (   fun)    do { return (fun) == 0? OK: ERR; } while (0)

Definition at line 34 of file ll2-api.cpp.

Referenced by RtArm(), and RtIO().


Function Documentation

STATUS_OK RtArm ( const short *  ao_values,
const unsigned *  do_values 
)

arm the capture

Parameters:
ao_valuesinitial ao values
do_valuesinitial do_values

Definition at line 77 of file ll2-api.cpp.

References DynamicSystem::instance(), and RETOK.

Referenced by main().

STATUS_OK RtDone ( void  )

stop and cleanup.

Definition at line 103 of file ll2-api.cpp.

References LL_ControlSystem::closedown(), DynamicSystem::instance(), OK, and LL_ControlSystem::Stop().

Referenced by main().

STATUS_OK RtIO ( const short *  ao_values,
const unsigned *  do_values,
short *  ai_values,
unsigned *  di_values,
unsigned *  status_values 
)

set next outputs, wait for and return next sample

Parameters:
ao_valuesnext ao_values
do_valuesnext do_values
ai_valueslatest ai sample
di_valueslatest di sample
status_valueslatest status values

Definition at line 91 of file ll2-api.cpp.

References DynamicSystem::instance(), and RETOK.

Referenced by main().

STATUS_OK RtSetup ( const char *  config_file,
int  argc,
const char *  argv[] 
)

instantiate system

Parameters:
config_file.xml file with system definition
argcpass in argc argv for optional command line initialization set zero if not required
argvoptional command line argv array

Definition at line 67 of file ll2-api.cpp.

References LL_ControlSystem::init(), DynamicSystem::instance(), and OK.

Referenced by main().