CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
command_file_reader_v4.h
浏览该文件的文档.
1 #ifndef __COMMAND_FILE_READER_V2_H__
2 #define __COMMAND_FILE_READER_V2_H__
3 
4 #include <stdint.h>
5 
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 #define CMD_FLAG_WAKEUP_WORD 0x01
12 #define CMD_FLAG_COMBO_WORD 0x02
13 #define CMD_FLAG_EXPECTED_WORD 0x04
14 #define CMD_FLAG_UNEXPECTED_WORD 0x08
15 #define CMD_FLAG_SPECIAL_WORD 0x10
16 
17 
18 #pragma pack(push)
19 #pragma pack(1)
20 
25 typedef struct command_info_st
26 {
27  uint8_t flags;
28  int16_t score;
29  uint16_t voice_start_index;
30  uint16_t voice_end_index;
31  uint16_t command_id;
32  uint32_t semantic_id;
34 
39 typedef struct Special_wait_count_st
40 {
41  uint16_t index_of_cmd_table;
42  uint8_t wait_count;
44 
49 typedef struct command_string_index_st
50 {
51  uint32_t command_string_offset;
52  uint16_t index_of_cmd_table;
54 
59 typedef struct voice_info_st
60 {
61  uint16_t voice_group;
62  uint16_t voice_id;
63  //uint32_t voice_data_addr; //!Address of voice data in flash.
65 
66 #pragma pack(pop)
67 
68 
75 extern uint32_t cmd_file_reader_init(uint32_t start_addr_in_flash);
76 
77 
83 extern uint32_t cmd_file_get_model_number();
84 
91 extern uint32_t cmd_file_change_model(uint32_t model_index);
92 
93 
102 extern uint32_t cmd_file_get_cur_model_id(uint32_t *p_dnn_id, uint32_t *p_asr_id);
103 
109 extern uint32_t cmd_file_get_command_number();
110 
118 extern uint32_t cmd_file_read_command_table(void* table_buffer);
119 
125 extern uint32_t cmd_file_get_special_word_number();
126 
134 extern uint32_t cmd_file_read_special_word_table(void* table_buffer);
135 
143 extern uint32_t cmd_file_read_string_index_table(void* table_buffer);
144 
150 extern uint32_t cmd_file_get_string_table_size();
151 
159 extern uint32_t cmd_file_read_string_table(void* table_buffer);
160 
166 extern uint32_t cmd_file_get_voice_number();
167 
175 extern uint32_t cmd_file_read_voice_table(void* table_buffer);
176 
182 extern uint32_t cmd_file_get_max_model_group_id();
183 
184 extern uint32_t cmd_file_change_cur_model_group(uint8_t model_group_id);
185 
186 extern uint32_t cmd_file_get_max_command_number();
187 
188 extern uint32_t cmd_file_get_max_special_word_number();
189 
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 #endif
196 
197 
uint32_t cmd_file_get_model_number()
Get models number.
Definition: command_file_reader_v2.c:91
uint32_t cmd_file_read_special_word_table(void *table_buffer)
Reads special words table to the specifiled buffer.
Definition: command_file_reader_v2.c:258
uint32_t cmd_file_change_cur_model_group(uint8_t model_group_id)
Definition: command_file_reader_v2.c:97
uint16_t command_id
Index of this command&#39;s voice in voice table.
Definition: command_file_reader_v2.h:31
uint32_t cmd_file_read_string_table(void *table_buffer)
Read string table to the specifiled buffer.
Definition: command_file_reader_v2.c:282
uint8_t flags
Definition: command_file_reader_v2.h:27
uint32_t cmd_file_get_command_number()
Get number of commands in current model.
Definition: command_file_reader_v2.c:239
Index of command string, used to get command id by command string.
Definition: command_file_reader_v2.h:49
uint16_t voice_end_index
Index of this command&#39;s voice in voice table.
Definition: command_file_reader_v2.h:30
uint32_t cmd_file_get_max_command_number()
Definition: command_file_reader_v2.c:305
uint32_t cmd_file_read_command_table(void *table_buffer)
Reads commands table to the specifiled buffer.
Definition: command_file_reader_v2.c:244
time wait after special word.
Definition: command_file_reader_v2.h:39
struct Special_wait_count_st special_wait_count_t
time wait after special word.
uint32_t cmd_file_get_string_table_size()
Get size of string table.
Definition: command_file_reader_v2.c:277
Voice information
Definition: command_file_reader_v2.h:59
uint32_t cmd_file_get_max_model_group_id()
Get id of model group, that prun of asr is the max.
Definition: command_file_reader_v2.c:158
Command information
Definition: command_file_reader_v2.h:25
uint8_t wait_count
Identity of command.
Definition: command_file_reader_v2.h:42
uint32_t cmd_file_change_model(uint32_t model_index)
Change current model group.
Definition: command_file_reader_v2.c:126
uint32_t cmd_file_get_special_word_number()
Get number of special words.
Definition: command_file_reader_v2.c:253
struct voice_info_st voice_info_t
Voice information
uint32_t cmd_file_get_cur_model_id(uint32_t *p_dnn_id, uint32_t *p_asr_id)
Get models ID.
Definition: command_file_reader_v2.c:226
uint32_t cmd_file_get_max_special_word_number()
Definition: command_file_reader_v2.c:310
uint32_t cmd_file_get_voice_number()
Get number of voice.
Definition: command_file_reader_v2.c:291
uint32_t semantic_id
Identity of command.
Definition: command_file_reader_v2.h:32
uint16_t voice_group
Definition: command_file_reader_v2.h:61
uint16_t voice_start_index
100 times the true float value of score.
Definition: command_file_reader_v2.h:29
uint32_t cmd_file_read_voice_table(void *table_buffer)
Read voice table to the specifiled buffer.
Definition: command_file_reader_v2.c:296
uint16_t index_of_cmd_table
Definition: command_file_reader_v2.h:41
uint32_t cmd_file_read_string_index_table(void *table_buffer)
Read string index table to the specifiled buffer.
Definition: command_file_reader_v2.c:267
uint32_t cmd_file_get_max_cmd_string_table_size()
Definition: command_file_reader_v2.c:315
struct command_string_index_st command_string_index_t
Index of command string, used to get command id by command string.
uint32_t cmd_file_reader_init(uint32_t start_addr_in_flash)
Initialize command file reader.
Definition: command_file_reader_v2.c:79
uint16_t voice_id
voice group information.
Definition: command_file_reader_v2.h:62
struct command_info_st command_info_t
Command information
uint32_t command_string_offset
Definition: command_file_reader_v2.h:51
int16_t score
Use to save flags that indicate this command is a special word,or is a combo word,or is a expected word,and so on.
Definition: command_file_reader_v4.h:28