4 * @brief DataBase access to get hw module description is here.
6 * @author Copyright (c) 2003 - 2010 CERN. Georgievskiy Yury
8 * @date Created on 14/12/2009
11 #include "driverGen.h"
12 #include "utilities.h"
15 extern int DBGetRegisterConfig(char*, RegisterDef_t
*, BlockDef_t
*, int, char*);
16 extern int DBGetBlockConfig(char*, BlockDef_t
*, char*);
17 extern rstat
DBGetPciInfo(char*, PciInfo_t
*);
18 extern rstat
DBGetVmeInfo(char*, VmeInfo_t
*);
21 extern int XMLGetRegisterConfig(char*, RegisterDef_t
*, BlockDef_t
*, int, char*);
22 extern int XMLGetBlockConfig(char*, BlockDef_t
*, char*);
23 extern rstat
XMLGetPciInfo(char*, PciInfo_t
*);
24 extern rstat
XMLGetVmeInfo(char*, VmeInfo_t
*);
27 * @brief Get register description from the DataBase.
29 * @param moduleName -- DataBase Module Name
30 * @param defs -- register description to put
31 * @param blks -- block description
32 * @param numBlks -- number of blocks
33 * @param prog -- program name
35 * Registers are prepared for the further use. If MAX allowed register amount
36 * reached - printout error message and exits.
38 * @return number of registers, defined in the DB.
40 int GetRegisterConfig(char *moduleName
, RegisterDef_t
*defs
,
41 BlockDef_t
*blks
, int numBlks
, char *prog
)
44 return DBGetRegisterConfig(moduleName
, defs
, blks
, numBlks
, prog
);
46 return XMLGetRegisterConfig(moduleName
, defs
, blks
, numBlks
, prog
);
51 * @brief Get block configuration from the DataBase.
53 * @param moduleName -- DataBase Module Name
54 * @param defs -- results will go here
55 * @param prog -- program name
57 * prepare results for the further use. If MAX allowed block amount
58 * reached - printout error message and exits.
60 * @return number of defined blocks
62 int GetBlockConfig(char *moduleName
, BlockDef_t
* defs
, char *prog
)
65 return DBGetBlockConfig(moduleName
, defs
, prog
);
67 return XMLGetBlockConfig(moduleName
, defs
, prog
);
72 * @brief Get PCI board information from the database.
74 * @param moduleName -- DataBase Module Name
75 * @param pciInfo -- results will go here
77 * @return DRIVER_GEN_OK - if PCI board info is obtained.
78 * @return DRIVER_GEN_BAD - othervise.
80 rstat
GetPciInfo(char *moduleName
, PciInfo_t
* pciInfo
)
83 return DBGetPciInfo(moduleName
, pciInfo
);
85 return XMLGetPciInfo(moduleName
, pciInfo
);
90 * @brief Get VME board information from the database.
92 * @param moduleName -- DataBase Module Name
93 * @param vmeInfo -- results will go here
95 * @return DRIVER_GEN_OK - if VME board info is obtained.
96 * @return DRIVER_GEN_BAD - othervise.
98 rstat
GetVmeInfo(char *moduleName
, VmeInfo_t
*vmeInfo
)
101 return DBGetVmeInfo(moduleName
, vmeInfo
);
103 return XMLGetVmeInfo(moduleName
, vmeInfo
);