> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Amdb API

> API header for AMDB.

**Header:** `spf/api/modules/amdb_api.h`

## Structures

### `amdb_module_reg_info_t`

Payload for AMDB\_CMD\_REGISTER\_MODULES.

**Members**

<ParamField path="interface_type" type="uint16_t">
  Type of the module interface.
</ParamField>

<ParamField path="interface_version" type="uint16_t">
  Version of the module interface.
</ParamField>

### `amdb_capi_module_reg_info_t`

Payload for AMDB\_CMD\_REGISTER\_MODULES.

**Members**

<ParamField path="module_type" type="uint32_t">
  Type of module.
</ParamField>

<ParamField path="module_id" type="uint32_t">
  ID for the module.
</ParamField>

<ParamField path="file_name_len" type="uint16_t">
  Length of the SO filename (in bytes).
</ParamField>

<ParamField path="tag_len" type="uint16_t">
  Length of tag in bytes.
</ParamField>

<ParamField path="error_code" type="uint32_t">
  Result of the module registration.
</ParamField>

### `amdb_module_registration_t`

Payload for AMDB\_CMD\_REGISTER\_MODULES.

**Members**

<ParamField path="proc_domain" type="uint32_t">
  ID for the processor domain in which the AMDB is running.
</ParamField>

<ParamField path="num_modules" type="uint32_t">
  Number of modules being registered.
</ParamField>

<ParamField path="struct_version" type="uint32_t">
  Version of the amdb\_module\_reg\_info\_t structure.
</ParamField>

<ParamField path="reg_info" type="amdb_module_reg_info_t">
  Array of registration information for num\_modules (of type reg\_info\[num\_modules]).
</ParamField>

### `amdb_module_deregistration_t`

Payload for AMDB\_CMD\_DEREGISTER\_MODULES.

**Members**

<ParamField path="proc_domain" type="uint32_t">
  ID for the processor domain in which the AMDB is running.
</ParamField>

<ParamField path="num_modules" type="uint32_t">
  Number of modules being registered.
</ParamField>

<ParamField path="module_id" type="uint32_t">
  Array of module IDs for num\_modules (module\_id\[num\_modules]).
</ParamField>

### `amdb_load_unload_info_t`

Payload for AMDB\_CMD\_LOAD\_MODULES, AMDB\_CMD\_RSP\_LOAD\_MODULES, and AMDB\_CMD\_UNLOAD\_MODULES.

**Members**

<ParamField path="module_id" type="uint32_t">
  ID for the module.
</ParamField>

<ParamField path="handle_lsw" type="uint32_t">
  Lower 32 bits of the 64-bit handle to the module.
</ParamField>

<ParamField path="handle_msw" type="uint32_t">
  Upper 32 bits of the 64-bit handle to the module.
</ParamField>

### `amdb_module_load_unload_t`

Payload for AMDB\_CMD\_LOAD\_MODULES, AMDB\_CMD\_RSP\_LOAD\_MODULES, and AMDB\_CMD\_UNLOAD\_MODULES.

**Members**

<ParamField path="proc_domain" type="uint32_t">
  ID for the processor domain in which the AMDB is running.
</ParamField>

<ParamField path="error_code" type="uint32_t">
  Result of module loading.
</ParamField>

<ParamField path="num_modules" type="uint32_t">
  Number of modules being registered.
</ParamField>

<ParamField path="load_unload_info" type="amdb_load_unload_info_t">
  Array of load or unload information for num\_modules (of type load\_unload\_info\[num\_modules]).
</ParamField>

### `amdb_param_id_module_version_info_t`

Payload for AMDB\_PARAM\_ID\_MODULE\_VERSION\_INFO.

**Members**

<ParamField path="proc_domain" type="uint32_t">
  ID for the processor domain.
</ParamField>

<ParamField path="num_modules" type="uint32_t">
  Number of modules in the array.
</ParamField>

### `amdb_module_build_ts_info_t`

**Members**

<ParamField path="year" type="uint16_t">
  Year that the build was produced.
</ParamField>

<ParamField path="month" type="uint16_t">
  month the build was produced
</ParamField>

<ParamField path="day" type="uint16_t">
  day the build was produced
</ParamField>

<ParamField path="hour" type="uint16_t">
  hour the build was produced
</ParamField>

<ParamField path="minute" type="uint16_t">
  minute the build was produced
</ParamField>

<ParamField path="second" type="uint16_t">
  second the build was produced
</ParamField>

### `amdb_module_version_info_payload_t`

**Members**

<ParamField path="module_id" type="uint32_t">
  Requested module id, to be filled in by the client.
</ParamField>

<ParamField path="error_code" type="uint32_t">
  Indicates whether an error has occurred loading the module.
</ParamField>

<ParamField path="is_present" type="uint32_t">
  1 if and only if the module is present and not stubbed in the AMDB.
</ParamField>

<ParamField path="module_version_major" type="uint32_t">
  Major version of the requested module.
</ParamField>

<ParamField path="module_version_minor" type="uint32_t">
  Minor version of the requested module.
</ParamField>

<ParamField path="build_ts" type="amdb_module_build_ts_info_t">
  Indicates the time at which the build for the given module was created.
</ParamField>

## Type Definitions

### `amdb_module_reg_info_t`

```cpp theme={null}
typedef struct amdb_module_reg_info_t amdb_module_reg_info_t
```

### `amdb_capi_module_reg_info_t`

```cpp theme={null}
typedef struct amdb_capi_module_reg_info_t amdb_capi_module_reg_info_t
```

### `amdb_module_registration_t`

```cpp theme={null}
typedef struct amdb_module_registration_t amdb_module_registration_t
```

### `amdb_module_deregistration_t`

```cpp theme={null}
typedef struct amdb_module_deregistration_t amdb_module_deregistration_t
```

### `amdb_load_unload_info_t`

```cpp theme={null}
typedef struct amdb_load_unload_info_t amdb_load_unload_info_t
```

### `amdb_module_load_unload_t`

```cpp theme={null}
typedef struct amdb_module_load_unload_t amdb_module_load_unload_t
```

### `amdb_param_id_module_version_info_t`

```cpp theme={null}
typedef struct amdb_param_id_module_version_info_t amdb_param_id_module_version_info_t
```

### `amdb_module_build_ts_info_t`

```cpp theme={null}
typedef struct amdb_module_build_ts_info_t amdb_module_build_ts_info_t
```

### `amdb_module_version_info_payload_t`

```cpp theme={null}
typedef struct amdb_module_version_info_payload_t amdb_module_version_info_payload_t
```

## Macros

### `AMDB_MODULE_REG_STRUCT_V1`

```c theme={null}
#define AMDB_MODULE_REG_STRUCT_V1 1
```

### `AMDB_INTERFACE_TYPE_CAPI`

Interface type is the Common Audio Processor Interface.

```c theme={null}
#define AMDB_INTERFACE_TYPE_CAPI 2
```

### `AMDB_INTERFACE_VERSION_CAPI_V3`

Interface version is the Common Audio Processor Interface version 3.

```c theme={null}
#define AMDB_INTERFACE_VERSION_CAPI_V3 3
```

### `AMDB_MODULE_TYPE_GENERIC`

Module is generic, such as a preprocessor, postprocessor, and so on.

```c theme={null}
#define AMDB_MODULE_TYPE_GENERIC 2
```

### `AMDB_MODULE_TYPE_DECODER`

Module is a decoder.

```c theme={null}
#define AMDB_MODULE_TYPE_DECODER 3
```

### `AMDB_MODULE_TYPE_ENCODER`

Module is an encoder.

```c theme={null}
#define AMDB_MODULE_TYPE_ENCODER 4
```

### `AMDB_MODULE_TYPE_CONVERTER`

Module is a converter.

```c theme={null}
#define AMDB_MODULE_TYPE_CONVERTER 5
```

### `AMDB_MODULE_TYPE_PACKETIZER`

Module is a packetizer.

```c theme={null}
#define AMDB_MODULE_TYPE_PACKETIZER 6
```

### `AMDB_MODULE_TYPE_DEPACKETIZER`

Module is a de-packetizer.

```c theme={null}
#define AMDB_MODULE_TYPE_DEPACKETIZER 7
```

### `AMDB_MODULE_TYPE_DETECTOR`

Module is a detector (such as DTMF, VoiceUI).

```c theme={null}
#define AMDB_MODULE_TYPE_DETECTOR 8
```

### `AMDB_MODULE_TYPE_GENERATOR`

Module is a generator (such as DTMF, Ultrasound).

```c theme={null}
#define AMDB_MODULE_TYPE_GENERATOR 9
```

### `AMDB_MODULE_TYPE_PP`

Module is a pre or post-processor (such as filters).

```c theme={null}
#define AMDB_MODULE_TYPE_PP 10
```

### `AMDB_MODULE_TYPE_END_POINT`

Module is a an end point (software or hardware end point, such as I2S source or sink).

```c theme={null}
#define AMDB_MODULE_TYPE_END_POINT 11
```

### `AMDB_MODULE_INSTANCE_ID`

Instance ID for the AMDB module.

```c theme={null}
#define AMDB_MODULE_INSTANCE_ID 0x00000003
```

### `AMDB_CMD_REGISTER_MODULES`

Registers a module with the AMDB to enable the module for dynamic loading.

```c theme={null}
#define AMDB_CMD_REGISTER_MODULES 0x0100101E
```

### `AMDB_CMD_DEREGISTER_MODULES`

Deregisters one or more registered modules.

```c theme={null}
#define AMDB_CMD_DEREGISTER_MODULES 0x0100101F
```

### `AMDB_CMD_LOAD_MODULES`

Loads one or more modules if they were successfully registered with the AMDB.

```c theme={null}
#define AMDB_CMD_LOAD_MODULES 0x01001020
```

### `AMDB_CMD_RSP_LOAD_MODULES`

Sent in response to an AMDB\_CMD\_LOAD\_MODULES command.

```c theme={null}
#define AMDB_CMD_RSP_LOAD_MODULES 0x02001008
```

### `AMDB_CMD_UNLOAD_MODULES`

Unloads a module that was loaded via the AMDB\_CMD\_LOAD\_MODULES command.

```c theme={null}
#define AMDB_CMD_UNLOAD_MODULES 0x01001022
```

### `AMDB_PARAM_ID_MODULE_VERSION_INFO`

Identifier for the parameter that gets the module version info.

```c theme={null}
#define AMDB_PARAM_ID_MODULE_VERSION_INFO 0x080013D6
```

### `AMDB_MODULE_INFO_OK`

```c theme={null}
#define AMDB_MODULE_INFO_OK 0
```

### `AMDB_MODULE_INFO_ERR_FILE_NOT_FOUND`

```c theme={null}
#define AMDB_MODULE_INFO_ERR_FILE_NOT_FOUND 1
```

### `AMDB_MODULE_INFO_ERR_DYNAMIC_LINK`

```c theme={null}
#define AMDB_MODULE_INFO_ERR_DYNAMIC_LINK 2
```

### `AMDB_MODULE_INFO_ERR_GENERAL`

```c theme={null}
#define AMDB_MODULE_INFO_ERR_GENERAL 0xFFFFFFFF
```
