User manual
117
5.CHAPI support libraries
Note: While using any of mentioned below libraries be sure that correspondent DLL files
are in the same location as CHAPI device DLL file and emulator executable or the path to
these DLL files are added to the system PATH environment variable.
5.1 General CHAPI support library
5.1.1 Library files
General CHAPI support library consists of:
1) Header file which contains all definitions – chapi_lib.h;
2) Library files to link with in order to use the library – release chapi.lib, debug chapid.lib;
3) Dynamically linked library, containing all implementation – release chapi.dll, debug
chapid.dll
Library source codes aren’t provided.
5.1.2 Library description
The main goal is to simplify usage of some CHAPI protocol parts by means of C++
wrappers. Current version of library contains some useful type definitions, registers access
functions, wrappers to handle bus requests and configuration options, macros to log
messages and debug trace messages conveniently and other useful things.
Type definitions
// typical lengths of io transactions on the emulated bus
enum io_size_t {
io_byte_t = 0, // LOG2(sizeof(byte_t))
io_word_t = 1, // LOG2(sizeof(word_t))
io_dword_t = 2, // LOG2(sizeof(dword_t))
io_qword_t = 3, // LOG2(sizeof(qword_t))
};
typedef char byte_t;
typedef unsigned char ubyte_t;
typedef short word_t;
typedef unsigned short uword_t;
typedef int dword_t;
typedef unsigned int udword_t;
// Some pointers to this types
typedef udword_t * udword_lp_t;
typedef const udword_t * const_udword_lp_t;










