CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
command_file_reader_v3.h
浏览该文件的文档.
1 #ifndef __COMMAND_FILE_READER_V3_H__
2 #define __COMMAND_FILE_READER_V3_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 #define CMD_FLAG_AUTO_PLAY 0x20
17 
18 
19 #pragma pack(push)
20 #pragma pack(1)
21 
26 typedef struct command_info_st
27 {
28  uint8_t flags;
29  uint8_t score;
30  uint16_t voice_start_index;
31  uint16_t voice_end_index;
32  uint16_t command_id;
33  uint32_t semantic_id;
34  uint16_t function_id;
36 
41 typedef struct Special_wait_count_st
42 {
43  uint16_t index_of_cmd_table;
44  uint8_t wait_count;
46 
51 typedef struct command_string_index_st
52 {
53  uint32_t command_string_offset;
54  uint16_t index_of_cmd_table;
56 
61 typedef struct voice_info_st
62 {
63  uint16_t voice_group;
64  uint16_t voice_id;
65  //uint32_t voice_data_addr; //!Address of voice data in flash.
67 
68 #pragma pack(pop)
69 
70 
77 extern uint32_t cmd_file_reader_init(uint32_t start_addr_in_flash);
78 
79 
85 extern uint32_t cmd_file_get_model_number();
86 
93 extern uint32_t cmd_file_change_model(uint32_t model_index);
94 
95 
104 extern uint32_t cmd_file_get_cur_model_id(uint32_t *p_dnn_id, uint32_t *p_asr_id);
105 
111 extern uint32_t cmd_file_get_command_number();
112 
120 extern uint32_t cmd_file_read_command_table(void* table_buffer);
121 
127 extern uint32_t cmd_file_get_special_word_number();
128 
136 extern uint32_t cmd_file_read_special_word_table(void* table_buffer);
137 
145 extern uint32_t cmd_file_read_string_index_table(void* table_buffer);
146 
152 extern uint32_t cmd_file_get_string_table_size();
153 
161 extern uint32_t cmd_file_read_string_table(void* table_buffer);
162 
168 extern uint32_t cmd_file_get_voice_number();
169 
177 extern uint32_t cmd_file_read_voice_table(void* table_buffer);
178 
184 extern uint32_t cmd_file_get_max_model_group_id();
185 
186 extern uint32_t cmd_file_change_cur_model_group(uint8_t model_group_id);
187 
188 extern int32_t cmd_file_get_send_data_item_len(void);
189 extern int32_t cmd_file_get_recieve_data_item_len(void);
190 extern int32_t cmd_file_read_send_data_table(uint8_t* p_send_data_table, uint8_t* p_item_length);
191 extern int32_t cmd_file_read_recieve_data_table(uint8_t* p_recieve_data_table, uint8_t* p_item_length);
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 #endif
197 
198 
struct command_string_index_st command_string_index_t
Index of command string, used to get command id by command string.
uint16_t command_id
Index of this command&#39;s voice in voice table.
Definition: command_file_reader_v2.h:31
struct command_info_st command_info_t
Command information
uint8_t flags
Definition: command_file_reader_v2.h:27
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
struct Special_wait_count_st special_wait_count_t
time wait after special word.
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
time wait after special word.
Definition: command_file_reader_v2.h:39
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
Voice information
Definition: command_file_reader_v2.h:59
uint32_t cmd_file_get_string_table_size()
Get size of string table.
Definition: command_file_reader_v2.c:277
Command information
Definition: command_file_reader_v2.h:25
uint32_t cmd_file_get_voice_number()
Get number of voice.
Definition: command_file_reader_v2.c:291
uint32_t cmd_file_get_special_word_number()
Get number of special words.
Definition: command_file_reader_v2.c:253
int32_t cmd_file_get_send_data_item_len(void)
Definition: command_file_reader_v3.c:298
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 wait_count
Identity of command.
Definition: command_file_reader_v2.h:42
uint32_t cmd_file_change_cur_model_group(uint8_t model_group_id)
Definition: command_file_reader_v2.c:97
uint32_t cmd_file_get_command_number()
Get number of commands in current model.
Definition: command_file_reader_v2.c:239
uint32_t cmd_file_change_model(uint32_t model_index)
Change current model group.
Definition: command_file_reader_v2.c:126
int32_t cmd_file_get_recieve_data_item_len(void)
Definition: command_file_reader_v3.c:303
uint32_t semantic_id
Identity of command.
Definition: command_file_reader_v2.h:32
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_group
Definition: command_file_reader_v2.h:61
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 voice_start_index
100 times the true float value of score.
Definition: command_file_reader_v2.h:29
uint32_t cmd_file_get_model_number()
Get models number.
Definition: command_file_reader_v2.c:91
uint16_t index_of_cmd_table
Definition: command_file_reader_v2.h:41
int32_t cmd_file_read_send_data_table(uint8_t *p_send_data_table, uint8_t *p_item_length)
Definition: command_file_reader_v3.c:308
struct voice_info_st voice_info_t
Voice information
uint32_t cmd_file_read_command_table(void *table_buffer)
Reads commands table to the specifiled buffer.
Definition: command_file_reader_v2.c:244
uint16_t function_id
Semantically related unique value.
Definition: command_file_reader_v3.h:34
int32_t cmd_file_read_recieve_data_table(uint8_t *p_recieve_data_table, uint8_t *p_item_length)
Definition: command_file_reader_v3.c:317
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
uint16_t voice_id
voice group information.
Definition: command_file_reader_v2.h:62
uint32_t command_string_offset
Definition: command_file_reader_v2.h:51
uint8_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_v2.h:28
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