![]() |
CI130X SDK API手册
2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
|
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include "sdk_default_config.h"
#include "voice_module_uart_protocol.h"
#include "system_msg_deal.h"
#include "command_info.h"
#include "ci130x_spiflash.h"
#include "ci130x_dpmu.h"
#include "prompt_player.h"
#include "audio_play_api.h"
#include "asr_api.h"
#include "firmware_updater.h"
#include <stdlib.h>
#include "romlib_runtime.h"
#include "flash_manage_outside_port.h"
#include "baudrate_calibrate.h"
宏定义 | |
#define | TIMEOUT_ONE_PACKET_INTERVAL (1000)/*ms, in this code, it should be bigger than portTICK_PERIOD_MS */ |
#define | MAX_DATA_RECEIVE_PER_PACKET (80)/*???*/ |
#define | VMUP_PACKET_MIN_SIZE (8) |
#define | VMUP_PACKET_MAX_SIZE (VMUP_MSG_DATA_MAX_SIZE + VMUP_PACKET_MIN_SIZE) |
#define | log_debug(fmt, args...) do{}while(0) |
#define | log_info _printf |
#define | log_error _printf |
#define | cinv_assert(x) do{}while(0) |
枚举 | |
enum | vmup_receive_state_t { REV_STATE_HEAD0 = 0x00, REV_STATE_HEAD1 = 0x01, REV_STATE_LENGTH0 = 0x02, REV_STATE_LENGTH1 = 0x03, REV_STATE_TYPE = 0x04, REV_STATE_CMD = 0x05, REV_STATE_SEQ = 0x06, REV_STATE_DATA = 0x07, REV_STATE_CKSUM0 = 0x08, REV_STATE_CKSUM1 = 0x09, REV_STATE_TAIL = 0x0a } |
函数 | |
void | set_state_enter_wakeup (uint32_t exit_wakup_ms) |
设置状态为唤醒 更多... | |
static void | vmup_port_mutex_creat (void) |
static void | vmup_port_mutex_take (void) |
static void | vmup_port_mutex_give (void) |
int | vmup_port_send_packet_rev_msg (sys_msg_com_data_t *msg) |
static bool | vmup_port_timeout_one_packet (void) |
static uint16_t | vmup_port_checksum (uint16_t init_val, uint8_t *data, uint16_t length) |
static int | vmup_port_send_char (uint8_t ch) |
static void | vump_uart_irq_handler (void) |
static int | vmup_port_hw_init (void) |
void | vmup_receive_packet (uint8_t receive_char) |
串口RX中断接收协议,发送到消息处理任务 更多... | |
static int | vmup_send_packet (sys_msg_com_data_t *msg) |
void | vmup_communicate_init (void) |
2代串口协议初始化 更多... | |
void | vmup_send_notify (uint8_t notify_event) |
发送通知类协议 更多... | |
void | vmup_send_ack_common_err (uint8_t sequence, uint8_t cmd, uint8_t err_no) |
void | vmup_send_asr_result_cmd (cmd_handle_t cmd_handle, uint8_t asr_score) |
报告语音识别结果 更多... | |
void | vmup_send_asr_result_ack (uint8_t sequence) |
void | vmup_send_play_voice_cmd (uint8_t play_control, uint8_t play_setting, uint32_t play_id) |
void | vmup_send_play_voice_ack (uint8_t sequence, uint8_t status) |
void | vmup_send_unique_id_cmd (void) |
void | vmup_send_unique_id_ack (uint8_t sequence, uint8_t *unique_id) |
void | vmup_send_get_ver_cmd (uint8_t ver_type) |
void | vmup_send_get_ver_ack (uint8_t sequence, uint8_t *ver) |
void | vmup_send_reset_cmd (void) |
void | vmup_send_reset_ack (uint8_t sequence) |
void | vmup_send_setting_cmd (uint8_t set_type, uint32_t set_value) |
void | vmup_send_setting_ack (uint8_t sequence, uint8_t err_no) |
void | play_voice_callback (cmd_handle_t cmd_handle) |
void | userapp_deal_cmd (sys_msg_com_data_t *msg) |
根据协议命令控制不同的功能 更多... | |
void | userapp_deal_com_msg (sys_msg_com_data_t *msg) |
用户层解析RX接收到的协议,根据协议类型分开处理 更多... | |
变量 | |
uint8_t | glb_send_sequence |
static SemaphoreHandle_t | send_packet_mutex |
static uint32_t | baud_sync_req |
TickType_t | last_time |
sys_msg_com_data_t | recever_packet |
static uint8_t | rev_state = REV_STATE_HEAD0 |
static uint16_t | length0 = 0 |
static uint16_t | length1 = 0 |
static uint16_t | chk_sum0 = 0 |
static uint16_t | chk_sum1 = 0 |
static uint16_t | data_rev_count = 0 |
#define cinv_assert | ( | x | ) | do{}while(0) |
#define log_debug | ( | fmt, | |
args... | |||
) | do{}while(0) |
#define log_error _printf |
#define log_info _printf |
#define MAX_DATA_RECEIVE_PER_PACKET (80)/*???*/ |
#define TIMEOUT_ONE_PACKET_INTERVAL (1000)/*ms, in this code, it should be bigger than portTICK_PERIOD_MS */ |
#define VMUP_PACKET_MAX_SIZE (VMUP_MSG_DATA_MAX_SIZE + VMUP_PACKET_MIN_SIZE) |
#define VMUP_PACKET_MIN_SIZE (8) |
void play_voice_callback | ( | cmd_handle_t | cmd_handle | ) |
void set_state_enter_wakeup | ( | uint32_t | exit_wakup_ms | ) |
设置状态为唤醒
exit_wakup_ms | 下次退出唤醒时间,单位ms |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int vmup_port_send_packet_rev_msg | ( | sys_msg_com_data_t * | msg | ) |
|
static |
void vmup_send_ack_common_err | ( | uint8_t | sequence, |
uint8_t | cmd, | ||
uint8_t | err_no | ||
) |
void vmup_send_asr_result_ack | ( | uint8_t | sequence | ) |
void vmup_send_get_ver_ack | ( | uint8_t | sequence, |
uint8_t * | ver | ||
) |
void vmup_send_get_ver_cmd | ( | uint8_t | ver_type | ) |
|
static |
void vmup_send_play_voice_ack | ( | uint8_t | sequence, |
uint8_t | status | ||
) |
void vmup_send_play_voice_cmd | ( | uint8_t | play_control, |
uint8_t | play_setting, | ||
uint32_t | play_id | ||
) |
void vmup_send_reset_ack | ( | uint8_t | sequence | ) |
void vmup_send_reset_cmd | ( | void | ) |
void vmup_send_setting_ack | ( | uint8_t | sequence, |
uint8_t | err_no | ||
) |
void vmup_send_setting_cmd | ( | uint8_t | set_type, |
uint32_t | set_value | ||
) |
void vmup_send_unique_id_ack | ( | uint8_t | sequence, |
uint8_t * | unique_id | ||
) |
void vmup_send_unique_id_cmd | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
uint8_t glb_send_sequence |
TickType_t last_time |
|
static |
|
static |
sys_msg_com_data_t recever_packet |
|
static |
|
static |