完成SPI驱动
This commit is contained in:
parent
4e6bd4b7c2
commit
9b11b859c2
1
.vscode/c_cpp_properties.json
vendored
1
.vscode/c_cpp_properties.json
vendored
@ -80,6 +80,7 @@
|
|||||||
"${workspaceFolder}/apps\\soundbox\\include\\task_manager\\bt",
|
"${workspaceFolder}/apps\\soundbox\\include\\task_manager\\bt",
|
||||||
"${workspaceFolder}/apps\\soundbox\\include\\user_api",
|
"${workspaceFolder}/apps\\soundbox\\include\\user_api",
|
||||||
"${workspaceFolder}/apps\\common",
|
"${workspaceFolder}/apps\\common",
|
||||||
|
"${workspaceFolder}/apps\\kaotings",
|
||||||
"${workspaceFolder}/apps\\common\\device",
|
"${workspaceFolder}/apps\\common\\device",
|
||||||
"${workspaceFolder}/apps\\common\\audio",
|
"${workspaceFolder}/apps\\common\\audio",
|
||||||
"${workspaceFolder}/apps\\common\\audio\\stream",
|
"${workspaceFolder}/apps\\common\\audio\\stream",
|
||||||
|
BIN
FW/KT25-0813/KT25-0813_82A-UFLASH_19D2.fw
Normal file
BIN
FW/KT25-0813/KT25-0813_82A-UFLASH_19D2.fw
Normal file
Binary file not shown.
3
Makefile
3
Makefile
@ -166,6 +166,7 @@ INCLUDES := \
|
|||||||
-Iapps/soundbox/include/task_manager/bt \
|
-Iapps/soundbox/include/task_manager/bt \
|
||||||
-Iapps/soundbox/include/user_api \
|
-Iapps/soundbox/include/user_api \
|
||||||
-Iapps/common \
|
-Iapps/common \
|
||||||
|
-Iapps/kaotings \
|
||||||
-Iapps/common/device \
|
-Iapps/common/device \
|
||||||
-Iapps/common/audio \
|
-Iapps/common/audio \
|
||||||
-Iapps/common/audio/stream \
|
-Iapps/common/audio/stream \
|
||||||
@ -309,6 +310,8 @@ c_SRC_FILES := \
|
|||||||
apps/common/usb/host/usb_storage.c \
|
apps/common/usb/host/usb_storage.c \
|
||||||
apps/common/usb/usb_config.c \
|
apps/common/usb/usb_config.c \
|
||||||
apps/common/usb/usb_host_config.c \
|
apps/common/usb/usb_host_config.c \
|
||||||
|
apps/kaotings/kt.c \
|
||||||
|
apps/kaotings/kt_uart.c \
|
||||||
apps/soundbox/aec/br25/audio_aec.c \
|
apps/soundbox/aec/br25/audio_aec.c \
|
||||||
apps/soundbox/app_main.c \
|
apps/soundbox/app_main.c \
|
||||||
apps/soundbox/board/br25/board_ac6082_demo/board_ac6082_demo.c \
|
apps/soundbox/board/br25/board_ac6082_demo/board_ac6082_demo.c \
|
||||||
|
703
README.html
Normal file
703
README.html
Normal file
@ -0,0 +1,703 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>README.md</title>
|
||||||
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif);
|
||||||
|
font-size: var(--vscode-markdown-font-size, 14px);
|
||||||
|
padding: 0 26px;
|
||||||
|
line-height: var(--vscode-markdown-line-height, 22px);
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
#code-csp-warning {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
color: white;
|
||||||
|
margin: 16px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: sans-serif;
|
||||||
|
background-color:#444444;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 6px;
|
||||||
|
box-shadow: 1px 1px 1px rgba(0,0,0,.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
#code-csp-warning:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
background-color:#007acc;
|
||||||
|
box-shadow: 2px 2px 2px rgba(0,0,0,.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
body.scrollBeyondLastLine {
|
||||||
|
margin-bottom: calc(100vh - 22px);
|
||||||
|
}
|
||||||
|
|
||||||
|
body.showEditorSelection .code-line {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.showEditorSelection .code-active-line:before,
|
||||||
|
body.showEditorSelection .code-line:hover:before {
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: -12px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.showEditorSelection li.code-active-line:before,
|
||||||
|
body.showEditorSelection li.code-line:hover:before {
|
||||||
|
left: -30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-light.showEditorSelection .code-active-line:before {
|
||||||
|
border-left: 3px solid rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-light.showEditorSelection .code-line:hover:before {
|
||||||
|
border-left: 3px solid rgba(0, 0, 0, 0.40);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-light.showEditorSelection .code-line .code-line:hover:before {
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-dark.showEditorSelection .code-active-line:before {
|
||||||
|
border-left: 3px solid rgba(255, 255, 255, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-dark.showEditorSelection .code-line:hover:before {
|
||||||
|
border-left: 3px solid rgba(255, 255, 255, 0.60);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-high-contrast.showEditorSelection .code-active-line:before {
|
||||||
|
border-left: 3px solid rgba(255, 160, 0, 0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-high-contrast.showEditorSelection .code-line:hover:before {
|
||||||
|
border-left: 3px solid rgba(255, 160, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:focus,
|
||||||
|
input:focus,
|
||||||
|
select:focus,
|
||||||
|
textarea:focus {
|
||||||
|
outline: 1px solid -webkit-focus-ring-color;
|
||||||
|
outline-offset: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
border: 0;
|
||||||
|
height: 2px;
|
||||||
|
border-bottom: 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
padding-bottom: 0.3em;
|
||||||
|
line-height: 1.2;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2, h3 {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
table > thead > tr > th {
|
||||||
|
text-align: left;
|
||||||
|
border-bottom: 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
table > thead > tr > th,
|
||||||
|
table > thead > tr > td,
|
||||||
|
table > tbody > tr > th,
|
||||||
|
table > tbody > tr > td {
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table > tbody > tr + tr > td {
|
||||||
|
border-top: 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
margin: 0 7px 0 5px;
|
||||||
|
padding: 0 16px 0 10px;
|
||||||
|
border-left-width: 5px;
|
||||||
|
border-left-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
|
||||||
|
font-size: 1em;
|
||||||
|
line-height: 1.357em;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.wordWrap pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre:not(.hljs),
|
||||||
|
pre.hljs code > div {
|
||||||
|
padding: 16px;
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre code {
|
||||||
|
color: var(--vscode-editor-foreground);
|
||||||
|
tab-size: 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Theming */
|
||||||
|
|
||||||
|
.vscode-light pre {
|
||||||
|
background-color: rgba(220, 220, 220, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-dark pre {
|
||||||
|
background-color: rgba(10, 10, 10, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-high-contrast pre {
|
||||||
|
background-color: rgb(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-high-contrast h1 {
|
||||||
|
border-color: rgb(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-light table > thead > tr > th {
|
||||||
|
border-color: rgba(0, 0, 0, 0.69);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-dark table > thead > tr > th {
|
||||||
|
border-color: rgba(255, 255, 255, 0.69);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-light h1,
|
||||||
|
.vscode-light hr,
|
||||||
|
.vscode-light table > tbody > tr + tr > td {
|
||||||
|
border-color: rgba(0, 0, 0, 0.18);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-dark h1,
|
||||||
|
.vscode-dark hr,
|
||||||
|
.vscode-dark table > tbody > tr + tr > td {
|
||||||
|
border-color: rgba(255, 255, 255, 0.18);
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* Tomorrow Theme */
|
||||||
|
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
|
||||||
|
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
|
||||||
|
|
||||||
|
/* Tomorrow Comment */
|
||||||
|
.hljs-comment,
|
||||||
|
.hljs-quote {
|
||||||
|
color: #8e908c;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tomorrow Red */
|
||||||
|
.hljs-variable,
|
||||||
|
.hljs-template-variable,
|
||||||
|
.hljs-tag,
|
||||||
|
.hljs-name,
|
||||||
|
.hljs-selector-id,
|
||||||
|
.hljs-selector-class,
|
||||||
|
.hljs-regexp,
|
||||||
|
.hljs-deletion {
|
||||||
|
color: #c82829;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tomorrow Orange */
|
||||||
|
.hljs-number,
|
||||||
|
.hljs-built_in,
|
||||||
|
.hljs-builtin-name,
|
||||||
|
.hljs-literal,
|
||||||
|
.hljs-type,
|
||||||
|
.hljs-params,
|
||||||
|
.hljs-meta,
|
||||||
|
.hljs-link {
|
||||||
|
color: #f5871f;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tomorrow Yellow */
|
||||||
|
.hljs-attribute {
|
||||||
|
color: #eab700;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tomorrow Green */
|
||||||
|
.hljs-string,
|
||||||
|
.hljs-symbol,
|
||||||
|
.hljs-bullet,
|
||||||
|
.hljs-addition {
|
||||||
|
color: #718c00;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tomorrow Blue */
|
||||||
|
.hljs-title,
|
||||||
|
.hljs-section {
|
||||||
|
color: #4271ae;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tomorrow Purple */
|
||||||
|
.hljs-keyword,
|
||||||
|
.hljs-selector-tag {
|
||||||
|
color: #8959a8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs {
|
||||||
|
display: block;
|
||||||
|
overflow-x: auto;
|
||||||
|
color: #4d4d4c;
|
||||||
|
padding: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-emphasis {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/*
|
||||||
|
* Markdown PDF CSS
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "Meiryo";
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow-x: auto;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre:not(.hljs) {
|
||||||
|
padding: 23px;
|
||||||
|
line-height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
background: rgba(127, 127, 127, 0.1);
|
||||||
|
border-color: rgba(0, 122, 204, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.emoji {
|
||||||
|
height: 1.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* for inline code */
|
||||||
|
:not(pre):not(.hljs) > code {
|
||||||
|
color: #C9AE75; /* Change the old color so it seems less like an error */
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Page Break : use <div class="page"/> to insert page break
|
||||||
|
-------------------------------------------------------- */
|
||||||
|
.page {
|
||||||
|
page-break-after: always;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
mermaid.initialize({
|
||||||
|
startOnLoad: true,
|
||||||
|
theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
|
||||||
|
? 'dark'
|
||||||
|
: 'default'
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<h1 id="%E5%BC%95%E8%84%9A%E6%8E%92%E5%88%97">引脚排列</h1>
|
||||||
|
<p><img src="./pin" alt="引脚定义"></p>
|
||||||
|
<h2 id="uart-%E9%80%9A%E8%AE%AF%E5%8D%8F%E8%AE%AE-115200-n-8-1">UART 通讯协议 115200 N 8 1</h2>
|
||||||
|
<ul>
|
||||||
|
<li>发送
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>head</th>
|
||||||
|
<th>length</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>DATA</th>
|
||||||
|
<th>XOR</th>
|
||||||
|
<th>tail</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>02</td>
|
||||||
|
<td>04</td>
|
||||||
|
<td>A0</td>
|
||||||
|
<td>01</td>
|
||||||
|
<td>FF</td>
|
||||||
|
<td>03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</li>
|
||||||
|
<li>回复
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>head</th>
|
||||||
|
<th>length</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>ERR</th>
|
||||||
|
<th>XOR</th>
|
||||||
|
<th>tail</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>02</td>
|
||||||
|
<td>04</td>
|
||||||
|
<td>A0</td>
|
||||||
|
<td>00</td>
|
||||||
|
<td>FF</td>
|
||||||
|
<td>03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</li>
|
||||||
|
<li>解释:
|
||||||
|
<ul>
|
||||||
|
<li>heat:帧头 一个字节 0x02</li>
|
||||||
|
<li>tail:帧尾 一个字节 0x03</li>
|
||||||
|
<li>length:长度 一个字节 从长度到校验的长度,包含长度和校验</li>
|
||||||
|
<li>CMD:命令字 一个字节</li>
|
||||||
|
<li>DATA:数据区,不定长</li>
|
||||||
|
<li>XOR:校验,一个字节的xor校验,调试可以填写一个字节FF,当此字节为FF时,为不校验</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>指令列表:
|
||||||
|
<ul>
|
||||||
|
<li>0xA0 播放</li>
|
||||||
|
<li>0xA1 暂停</li>
|
||||||
|
<li>0xA2 播放/暂停</li>
|
||||||
|
<li>0xA3 下一曲</li>
|
||||||
|
<li>0xA4 上一曲</li>
|
||||||
|
<li>0xA5 停止</li>
|
||||||
|
<li>0xA6 音量加</li>
|
||||||
|
<li>0xA7 音量减</li>
|
||||||
|
<li>0xA8 设置音量</li>
|
||||||
|
<li>0xA9 静音</li>
|
||||||
|
<li>0xAA 解除静音</li>
|
||||||
|
<li>0xAB 播放指定曲目(通配符)</li>
|
||||||
|
<li>0xAC 播放指定曲目(带扩展名)</li>
|
||||||
|
<li>0xAD 播放指定曲目(数字)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2 id="%E6%8C%87%E4%BB%A4%E8%AF%A6%E8%BF%B0">指令详述</h2>
|
||||||
|
<ul>
|
||||||
|
<li>系统复位:0xA0/A1/A2/A3/A4/A5/A6/A7/A9/AA
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>HEAD</th>
|
||||||
|
<th>LENGTH</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>CHK</th>
|
||||||
|
<th>TAIL</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>0x02</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0xA0</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0x03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</li>
|
||||||
|
<li>播放/暂停:0xC2
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>HEAD</th>
|
||||||
|
<th>LENGTH</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>CHK</th>
|
||||||
|
<th>TAIL</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>0x02</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0xC2</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0x03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</li>
|
||||||
|
<li>设置音量:0xA8
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>HEAD</th>
|
||||||
|
<th>LENGTH</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>VOLUME</th>
|
||||||
|
<th>CHK</th>
|
||||||
|
<th>TAIL</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>0x02</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0xA8</td>
|
||||||
|
<td>0-30</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0x03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<ul>
|
||||||
|
<li>VOLUME : 0-30</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>播放指定曲目(通配符):AB
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>HEAD</th>
|
||||||
|
<th>LENGTH</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>STA</th>
|
||||||
|
<th>NAME</th>
|
||||||
|
<th>END</th>
|
||||||
|
<th>CHK</th>
|
||||||
|
<th>TAIL</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>0x02</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0xAB</td>
|
||||||
|
<td>'$'</td>
|
||||||
|
<td>'abc'</td>
|
||||||
|
<td>'$'</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0x03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<ul>
|
||||||
|
<li>STA :名字起始,字符'$'(0x24)。</li>
|
||||||
|
<li>END : 名字结束,字符'$'(0x24)。</li>
|
||||||
|
<li>NAME :名字字符串,支持通配符,注:会自动增加扩展名,实例为3字节‘abc’(61 62 63),<code>实际上是播放 "abc.*", 程序自动增加 ".*" 通配符扩展名,"ab*"也是合法的,会播放"ab*.*"</code></li>
|
||||||
|
<li>文件必须存在否则播放失败</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>播放指定曲目(全路径):AC
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>HEAD</th>
|
||||||
|
<th>LENGTH</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>STA</th>
|
||||||
|
<th>NAME</th>
|
||||||
|
<th>END</th>
|
||||||
|
<th>CHK</th>
|
||||||
|
<th>TAIL</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>0x02</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0xAC</td>
|
||||||
|
<td>'$'</td>
|
||||||
|
<td>'abc.mp3'</td>
|
||||||
|
<td>'$'</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0x03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<ul>
|
||||||
|
<li>STA :名字起始,字符'$'(0x24)。</li>
|
||||||
|
<li>END : 名字结束,字符'$'(0x24)。</li>
|
||||||
|
<li>NAME :名字字符串,必须写全文件名,例如:文件名采用8+3格式,只识别文件名的前2个字符,例如:01.mp3和010.mp3是不同的</li>
|
||||||
|
<li>文件必须存在否则播放失败</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>播放指定曲目(文件号):AD
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>HEAD</th>
|
||||||
|
<th>LENGTH</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>FH</th>
|
||||||
|
<th>FL</th>
|
||||||
|
<th>CHK</th>
|
||||||
|
<th>TAIL</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>0x02</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0xAD</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0x03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<ul>
|
||||||
|
<li>FH,FL:组合成以恶搞16bit的整形,例如 FH=0x00 FL=0x02 实际上是播放0x0002曲目,曲目的顺序号是拷贝进磁盘的顺序</li>
|
||||||
|
<li>文件必须存在否则播放失败</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>指定文件号播放:0xC8
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>HEAD</th>
|
||||||
|
<th>LENGTH</th>
|
||||||
|
<th>CMD</th>
|
||||||
|
<th>NUM</th>
|
||||||
|
<th>LOOP</th>
|
||||||
|
<th>CHK</th>
|
||||||
|
<th>TAIL</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>0x02</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0xC8</td>
|
||||||
|
<td>1-99</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>1Byte</td>
|
||||||
|
<td>0x03</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<ul>
|
||||||
|
<li>NUM : 文件名号码。注:文件名采用8+3格式,只识别文件名的前2个字符,例如:01.mp3和01月光小夜曲.mp3是相同的,月光小夜曲可有可无,但前面序号必须有,存放文件时需注意。</li>
|
||||||
|
<li>LOOP: 循环次数,0为单曲无限循环</li>
|
||||||
|
<li>文件必须存在否则播放失败</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2 id="%E9%99%84%E5%BD%951%E6%A0%A1%E9%AA%8C">附录1:校验</h2>
|
||||||
|
<ul>
|
||||||
|
<li>校验方式为校验和,计算方式为数据累计和取反加1的方式</li>
|
||||||
|
<li>举例发送系统复位指令A0:0x02 0x02 0xA0 CheckSum 0x03
|
||||||
|
<ul>
|
||||||
|
<li>其中头尾分别为02 03</li>
|
||||||
|
<li>计算:第二个02 + 指令A0,相加,结果取反再+1,得到CheckSum</li>
|
||||||
|
<li>校验:数据段+校验后的值为0</li>
|
||||||
|
<li>详细算法<pre class="hljs"><code><div> <span class="hljs-keyword">uint8_t</span> buf[<span class="hljs-number">16</span>];
|
||||||
|
<span class="hljs-keyword">int</span> index = <span class="hljs-number">0</span>;
|
||||||
|
buf[index++] = <span class="hljs-number">0x02</span>; <span class="hljs-comment">//头</span>
|
||||||
|
buf[index++] = <span class="hljs-number">0x00</span>; <span class="hljs-comment">//长度,临时赋值0</span>
|
||||||
|
buf[index++] = <span class="hljs-number">0xA0</span>; <span class="hljs-comment">//指令</span>
|
||||||
|
|
||||||
|
buf[<span class="hljs-number">1</span>] = index - <span class="hljs-number">1</span>; <span class="hljs-comment">//数据填充完成后,重新赋值长度(0x02)</span>
|
||||||
|
|
||||||
|
<span class="hljs-keyword">uint16_t</span> sum = <span class="hljs-number">0</span>;
|
||||||
|
|
||||||
|
<span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i < index - <span class="hljs-number">1</span>; i++)
|
||||||
|
{
|
||||||
|
sum += buf[<span class="hljs-number">1</span>+i]; <span class="hljs-comment">//从第一个字节开始累加,去除头,</span>
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="hljs-comment">//此时累加完成,sum:0x02 + 0xA0 = 0xA2</span>
|
||||||
|
|
||||||
|
sum = ~sum + <span class="hljs-number">1</span>; <span class="hljs-comment">//取反加1</span>
|
||||||
|
<span class="hljs-comment">//sum = 0xff5D + 1 = 0xff5E</span>
|
||||||
|
|
||||||
|
buf[index++] = (u8)sum; <span class="hljs-comment">//强制转换成uint8_t类型,截断后为 0x5E</span>
|
||||||
|
buf[index++] = <span class="hljs-number">0x03</span>; <span class="hljs-comment">//尾</span>
|
||||||
|
|
||||||
|
<span class="hljs-comment">//此时buf = {0x02,0x02,0xA0,0x5E,0x03}</span>
|
||||||
|
|
||||||
|
<span class="hljs-comment">//下面校验</span>
|
||||||
|
<span class="hljs-comment">//0x02 + 0xA0 + 0x5E = 0x0100</span>
|
||||||
|
<span class="hljs-comment">//将0x100强转为uint8_t后,截断后 = 0,校验通过</span>
|
||||||
|
</div></code></pre>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2 id="%E9%99%84%E5%BD%952-errcode-%E9%94%99%E8%AF%AF%E5%AE%9A%E4%B9%89">附录2 :ERRCODE 错误定义:</h2>
|
||||||
|
<pre><code>- 0:指令正确,数据正确,且执行正确
|
||||||
|
- 1:一个通用的错误,可能是一个未定义的错误
|
||||||
|
- 2:未识别的指令
|
||||||
|
- 3:参数错误
|
||||||
|
- 4:帧错误,此包数据未找到帧头,或者未找到帧尾
|
||||||
|
- 5:长度错误
|
||||||
|
- 6:校验错误</code></pre>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
BIN
README.jpeg
Normal file
BIN
README.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 662 KiB |
123
README.md
Normal file
123
README.md
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
# 引脚排列
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## UART 通讯协议 115200 N 8 1
|
||||||
|
- 发送
|
||||||
|
| head | length | CMD | DATA | XOR | tail |
|
||||||
|
|---------|-------------|----------|-----------|---------|---------|
|
||||||
|
| 02 | 04 | A0 | 01 | FF | 03 |
|
||||||
|
- 回复
|
||||||
|
| head | length | CMD | ERR | XOR | tail |
|
||||||
|
|---------|-------------|----------|-----------|---------|---------|
|
||||||
|
| 02 | 04 | A0 | 00 | FF | 03 |
|
||||||
|
- 解释:
|
||||||
|
- heat:帧头 一个字节 0x02
|
||||||
|
- tail:帧尾 一个字节 0x03
|
||||||
|
- length:长度 一个字节 从长度到校验的长度,包含长度和校验
|
||||||
|
- CMD:命令字 一个字节
|
||||||
|
- DATA:数据区,不定长
|
||||||
|
- XOR:校验,一个字节的xor校验,调试可以填写一个字节FF,当此字节为FF时,为不校验
|
||||||
|
- 指令列表:
|
||||||
|
- 0xA0 播放
|
||||||
|
- 0xA1 暂停
|
||||||
|
- 0xA2 播放/暂停
|
||||||
|
- 0xA3 下一曲
|
||||||
|
- 0xA4 上一曲
|
||||||
|
- 0xA5 停止
|
||||||
|
- 0xA6 音量加
|
||||||
|
- 0xA7 音量减
|
||||||
|
- 0xA8 设置音量
|
||||||
|
- 0xA9 静音
|
||||||
|
- 0xAA 解除静音
|
||||||
|
- 0xAB 播放指定曲目(通配符)
|
||||||
|
- 0xAC 播放指定曲目(带扩展名)
|
||||||
|
- 0xAD 播放指定曲目(数字)
|
||||||
|
## 指令详述
|
||||||
|
- 系统复位:0xA0/A1/A2/A3/A4/A5/A6/A7/A9/AA
|
||||||
|
| HEAD | LENGTH | CMD | CHK | TAIL |
|
||||||
|
|------|--------|--------|-------|------|
|
||||||
|
| 0x02 | 1Byte | 0xA0 | 1Byte | 0x03 |
|
||||||
|
- 播放/暂停:0xC2
|
||||||
|
| HEAD | LENGTH | CMD | CHK | TAIL |
|
||||||
|
|------|--------|--------|-------|------|
|
||||||
|
| 0x02 | 1Byte | 0xC2 | 1Byte | 0x03 |
|
||||||
|
- 设置音量:0xA8
|
||||||
|
| HEAD | LENGTH | CMD | VOLUME | CHK | TAIL |
|
||||||
|
|------|--------|--------|---------------|------|------|
|
||||||
|
| 0x02 | 1Byte | 0xA8 | 0-30 |1Byte | 0x03 |
|
||||||
|
- VOLUME : 0-30
|
||||||
|
- 播放指定曲目(通配符):AB
|
||||||
|
| HEAD | LENGTH | CMD | STA | NAME | END | CHK | TAIL |
|
||||||
|
|------|--------|--------|-----------|-----------|--------|------|------|
|
||||||
|
| 0x02 | 1Byte | 0xAB | '$' | 'abc' | '$' | 1Byte| 0x03 |
|
||||||
|
- STA :名字起始,字符'$'(0x24)。
|
||||||
|
- END : 名字结束,字符'$'(0x24)。
|
||||||
|
- NAME :名字字符串,支持通配符,注:会自动增加扩展名,实例为3字节‘abc’(61 62 63),```实际上是播放 "abc.*", 程序自动增加 ".*" 通配符扩展名,"ab*"也是合法的,会播放"ab*.*"```
|
||||||
|
- 文件必须存在否则播放失败
|
||||||
|
- 播放指定曲目(全路径):AC
|
||||||
|
| HEAD | LENGTH | CMD | STA | NAME | END | CHK | TAIL |
|
||||||
|
|------|--------|--------|-----------|---------------|--------|------|------|
|
||||||
|
| 0x02 | 1Byte | 0xAC | '$' | 'abc.mp3' | '$' | 1Byte| 0x03 |
|
||||||
|
- STA :名字起始,字符'$'(0x24)。
|
||||||
|
- END : 名字结束,字符'$'(0x24)。
|
||||||
|
- NAME :名字字符串,必须写全文件名,例如:文件名采用8+3格式,只识别文件名的前2个字符,例如:01.mp3和010.mp3是不同的
|
||||||
|
- 文件必须存在否则播放失败
|
||||||
|
- 播放指定曲目(文件号):AD
|
||||||
|
| HEAD | LENGTH | CMD | FH | FL | CHK | TAIL |
|
||||||
|
|------|--------|--------|----------|------------|-------|------|
|
||||||
|
| 0x02 | 1Byte | 0xAD | 1Byte | 1Byte | 1Byte | 0x03 |
|
||||||
|
- FH,FL:组合成以恶搞16bit的整形,例如 FH=0x00 FL=0x02 实际上是播放0x0002曲目,曲目的顺序号是拷贝进磁盘的顺序
|
||||||
|
- 文件必须存在否则播放失败
|
||||||
|
- 指定文件号播放:0xC8
|
||||||
|
| HEAD | LENGTH | CMD | NUM | LOOP | CHK | TAIL |
|
||||||
|
|------|--------|--------|-----------|-----------|------|------|
|
||||||
|
| 0x02 | 1Byte | 0xC8 | 1-99 | 1Byte | 1Byte| 0x03 |
|
||||||
|
- NUM : 文件名号码。注:文件名采用8+3格式,只识别文件名的前2个字符,例如:01.mp3和01月光小夜曲.mp3是相同的,月光小夜曲可有可无,但前面序号必须有,存放文件时需注意。
|
||||||
|
- LOOP: 循环次数,0为单曲无限循环
|
||||||
|
- 文件必须存在否则播放失败
|
||||||
|
## 附录1:校验
|
||||||
|
- 校验方式为校验和,计算方式为数据累计和取反加1的方式
|
||||||
|
- 举例发送系统复位指令A0:0x02 0x02 0xA0 CheckSum 0x03
|
||||||
|
- 其中头尾分别为02 03
|
||||||
|
- 计算:第二个02 + 指令A0,相加,结果取反再+1,得到CheckSum
|
||||||
|
- 校验:数据段+校验后的值为0
|
||||||
|
- 详细算法
|
||||||
|
```C
|
||||||
|
uint8_t buf[16];
|
||||||
|
int index = 0;
|
||||||
|
buf[index++] = 0x02; //头
|
||||||
|
buf[index++] = 0x00; //长度,临时赋值0
|
||||||
|
buf[index++] = 0xA0; //指令
|
||||||
|
|
||||||
|
buf[1] = index - 1; //数据填充完成后,重新赋值长度(0x02)
|
||||||
|
|
||||||
|
uint16_t sum = 0;
|
||||||
|
|
||||||
|
for(int i = 0; i < index - 1; i++)
|
||||||
|
{
|
||||||
|
sum += buf[1+i]; //从第一个字节开始累加,去除头,
|
||||||
|
}
|
||||||
|
|
||||||
|
//此时累加完成,sum:0x02 + 0xA0 = 0xA2
|
||||||
|
|
||||||
|
sum = ~sum + 1; //取反加1
|
||||||
|
//sum = 0xff5D + 1 = 0xff5E
|
||||||
|
|
||||||
|
buf[index++] = (u8)sum; //强制转换成uint8_t类型,截断后为 0x5E
|
||||||
|
buf[index++] = 0x03; //尾
|
||||||
|
|
||||||
|
//此时buf = {0x02,0x02,0xA0,0x5E,0x03}
|
||||||
|
|
||||||
|
//下面校验
|
||||||
|
//0x02 + 0xA0 + 0x5E = 0x0100
|
||||||
|
//将0x100强转为uint8_t后,截断后 = 0,校验通过
|
||||||
|
```
|
||||||
|
## 附录2 :ERRCODE 错误定义:
|
||||||
|
- 0:指令正确,数据正确,且执行正确
|
||||||
|
- 1:一个通用的错误,可能是一个未定义的错误
|
||||||
|
- 2:未识别的指令
|
||||||
|
- 3:参数错误
|
||||||
|
- 4:帧错误,此包数据未找到帧头,或者未找到帧尾
|
||||||
|
- 5:长度错误
|
||||||
|
- 6:校验错误
|
BIN
README.png
Normal file
BIN
README.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 305 KiB |
BIN
README_AC6082.pdf
Normal file
BIN
README_AC6082.pdf
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
#define USB_MALLOC_ENABLE 0
|
#define USB_MALLOC_ENABLE 0
|
||||||
#define USB_HOST_ASYNC 1
|
#define USB_HOST_ASYNC 1
|
||||||
#define USB_H_MALLOC_ENABLE 1
|
#define USB_H_MALLOC_ENABLE 1
|
||||||
#define USB_DEVICE_CLASS_CONFIG (SPEAKER_CLASS|MIC_CLASS|HID_CLASS|MASSSTORAGE_CLASS)
|
#define USB_DEVICE_CLASS_CONFIG (MASSSTORAGE_CLASS) //(SPEAKER_CLASS|MIC_CLASS|HID_CLASS|MASSSTORAGE_CLASS)
|
||||||
|
|
||||||
///////////MassStorage Class
|
///////////MassStorage Class
|
||||||
|
|
||||||
|
61
apps/kaotings/kt.c
Normal file
61
apps/kaotings/kt.c
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
#include "kt.h"
|
||||||
|
#include "app_task.h"
|
||||||
|
#include "music_player.h"
|
||||||
|
|
||||||
|
|
||||||
|
u16 tid;
|
||||||
|
|
||||||
|
|
||||||
|
void kt_busy_ctl_init(void)
|
||||||
|
{
|
||||||
|
/* pa ctl-mute*/
|
||||||
|
//gpio_set_direction(KT_PAMUTE_PORT, 0);
|
||||||
|
//gpio_set_pull_up(KT_PAMUTE_PORT, 0);
|
||||||
|
//gpio_set_pull_down(KT_PAMUTE_PORT, 0);
|
||||||
|
//gpio_set_hd(KT_PAMUTE_PORT, 1);
|
||||||
|
|
||||||
|
//gpio_set_output_value(KT_PAMUTE_PORT, 1);
|
||||||
|
|
||||||
|
gpio_set_direction(KT_BUSY_PORT, 0);
|
||||||
|
gpio_set_pull_up(KT_BUSY_PORT, 0);
|
||||||
|
gpio_set_pull_down(KT_BUSY_PORT, 0);
|
||||||
|
gpio_set_hd(KT_BUSY_PORT, 1);
|
||||||
|
|
||||||
|
gpio_set_output_value(KT_BUSY_PORT, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void timer_cb(void *arg)
|
||||||
|
{
|
||||||
|
if (app_get_curr_task() == APP_MUSIC_TASK)
|
||||||
|
{
|
||||||
|
if (music_player_get_play_status() == FILE_DEC_STATUS_PLAY)
|
||||||
|
{
|
||||||
|
gpio_set_output_value(KT_BUSY_PORT, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gpio_set_output_value(KT_BUSY_PORT, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gpio_set_output_value(KT_BUSY_PORT, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void start_timer(void)
|
||||||
|
{
|
||||||
|
if (tid)
|
||||||
|
{
|
||||||
|
sys_timer_del(tid);
|
||||||
|
}
|
||||||
|
tid = sys_timer_add(NULL,timer_cb, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void kt_init(void)
|
||||||
|
{
|
||||||
|
kt_busy_ctl_init();
|
||||||
|
kt_uart_init();
|
||||||
|
start_timer();
|
||||||
|
}
|
53
apps/kaotings/kt.h
Normal file
53
apps/kaotings/kt.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#ifndef __KT_H__
|
||||||
|
#define __KT_H__
|
||||||
|
|
||||||
|
#include "system/includes.h"
|
||||||
|
|
||||||
|
#define KT_UART_RX_BUF_SIZE 512
|
||||||
|
#define KT_UART_BAUDRATE 115200
|
||||||
|
#define KT_UART_TX_PORT IO_PORTB_06
|
||||||
|
#define KT_UART_RX_PORT IO_PORTB_07
|
||||||
|
|
||||||
|
#define KT_BUSY_PORT IO_PORTA_04
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
u32 leng;
|
||||||
|
u8 buf[KT_UART_RX_BUF_SIZE];
|
||||||
|
}tRxPacket;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define KT_OK 0 /* 指令正确,数据正确,且执行正确 */
|
||||||
|
#define KT_ERROR 1 /* 一个通用的错误,可能是一个未定义的错误 */
|
||||||
|
#define KT_ERR_UNCMD 2 /* 未识别的指令 */
|
||||||
|
#define KT_ERR_PARA 3 /* 参数错误 */
|
||||||
|
#define KT_ERR_PACK 4 /* 帧错误,此包数据未找到帧头,或者未找到帧尾 */
|
||||||
|
#define KT_ERR_LENGTH 5 /* 长度错误 */
|
||||||
|
#define KT_ERR_XOR 6 /* 校验错误 */
|
||||||
|
|
||||||
|
|
||||||
|
#define KT_CMD_PLAY 0xA0
|
||||||
|
#define KT_CMD_PAUSE 0xA1
|
||||||
|
#define KT_CMD_PP 0xA2
|
||||||
|
|
||||||
|
#define KT_CMD_NEXT 0xA3
|
||||||
|
#define KT_CMD_PREV 0xA4
|
||||||
|
#define KT_CMD_STOP 0xA5
|
||||||
|
|
||||||
|
#define KT_CMD_VOL_UP 0xA6
|
||||||
|
#define KT_CMD_VOL_DOWN 0xA7
|
||||||
|
#define KT_CMD_VOL_SET 0xA8
|
||||||
|
#define KT_CMD_VOL_MUTE 0xA9
|
||||||
|
#define KT_CMD_VOL_UNMUTE 0xAA
|
||||||
|
|
||||||
|
#define KT_CMD_PLAY_NAME 0xAB
|
||||||
|
#define KT_CMD_PLAY_FULL_NAME 0xAC
|
||||||
|
#define KT_CMD_PLAY_NUM 0xAD
|
||||||
|
|
||||||
|
void kt_uart_init(void);
|
||||||
|
void kt_uart_event(void);
|
||||||
|
void kt_init(void);
|
||||||
|
|
||||||
|
#endif
|
310
apps/kaotings/kt_uart.c
Normal file
310
apps/kaotings/kt_uart.c
Normal file
@ -0,0 +1,310 @@
|
|||||||
|
#include "kt.h"
|
||||||
|
|
||||||
|
#include "asm/uart_dev.h"
|
||||||
|
#include "system/event.h"
|
||||||
|
|
||||||
|
#include "music_player.h"
|
||||||
|
#include "key_event_deal.h"
|
||||||
|
#include "audio_config.h"
|
||||||
|
|
||||||
|
|
||||||
|
u8 kt_sys_mute = 0;
|
||||||
|
tRxPacket rx_pack;
|
||||||
|
uart_bus_t *uart_bus;
|
||||||
|
static u8 uart_cbuf[256] __attribute__((aligned(4)));
|
||||||
|
|
||||||
|
static void uart_isr_hook(void *arg, u32 status)
|
||||||
|
{
|
||||||
|
const uart_bus_t *ubus = arg;
|
||||||
|
struct sys_event e;
|
||||||
|
|
||||||
|
if (status == UT_RX)
|
||||||
|
{
|
||||||
|
//printf("uart_rx_isr\n");
|
||||||
|
|
||||||
|
e.type = SYS_DEVICE_EVENT;
|
||||||
|
e.arg = (void *)DEVICE_EVENT_FROM_UART_RX_OVERFLOW;
|
||||||
|
e.u.dev.event = DEVICE_EVENT_CHANGE;
|
||||||
|
e.u.dev.value = (int)ubus;
|
||||||
|
sys_event_notify(&e);
|
||||||
|
}
|
||||||
|
if (status == UT_RX_OT)
|
||||||
|
{
|
||||||
|
//printf("uart_rx_ot_isr\n");
|
||||||
|
|
||||||
|
e.type = SYS_DEVICE_EVENT;
|
||||||
|
e.arg = (void *)DEVICE_EVENT_FROM_UART_RX_OUTTIME;
|
||||||
|
e.u.dev.event = DEVICE_EVENT_CHANGE;
|
||||||
|
e.u.dev.value = (int)ubus;
|
||||||
|
sys_event_notify(&e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void kt_uart_init(void)
|
||||||
|
{
|
||||||
|
struct uart_platform_data_t u_arg = {0};
|
||||||
|
u_arg.tx_pin = KT_UART_TX_PORT;
|
||||||
|
u_arg.rx_pin = KT_UART_RX_PORT;
|
||||||
|
u_arg.rx_cbuf = uart_cbuf;
|
||||||
|
u_arg.rx_cbuf_size = 256;
|
||||||
|
u_arg.frame_length = 128;
|
||||||
|
u_arg.rx_timeout = 50;
|
||||||
|
u_arg.isr_cbfun = uart_isr_hook;
|
||||||
|
u_arg.baud = KT_UART_BAUDRATE;
|
||||||
|
u_arg.is_9bit = 0;
|
||||||
|
|
||||||
|
uart_bus = uart_dev_open(&u_arg);
|
||||||
|
if (uart_bus != NULL)
|
||||||
|
{
|
||||||
|
printf("uart_dev_open() success\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void uart_ack(u8 cmd, u8 err)
|
||||||
|
{
|
||||||
|
if (uart_bus == NULL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("tx_data cmd:%x err:%d \r\n", cmd, err);
|
||||||
|
u8 tx_buf[32] = {0};
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
tx_buf[index++] = 0x02;
|
||||||
|
tx_buf[index++] = 0x04;
|
||||||
|
tx_buf[index++] = cmd;
|
||||||
|
tx_buf[index++] = err;
|
||||||
|
|
||||||
|
u8 x = tx_buf[1];
|
||||||
|
|
||||||
|
x = x ^ tx_buf[2];
|
||||||
|
x = x ^ tx_buf[3];
|
||||||
|
|
||||||
|
tx_buf[index++] = x;
|
||||||
|
tx_buf[index++] = 0x03;
|
||||||
|
|
||||||
|
uart_bus->write(tx_buf,index);
|
||||||
|
}
|
||||||
|
|
||||||
|
char str_play_name[32];
|
||||||
|
char str_play_name_full[32];
|
||||||
|
static void uart_process(tRxPacket *pack)
|
||||||
|
{
|
||||||
|
if ((pack->buf[0] != 0x02) || (pack->buf[pack->leng - 1] != 0x03))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pack->buf[1] != pack->leng - 2)
|
||||||
|
{
|
||||||
|
uart_ack(pack->buf[2], KT_ERR_LENGTH);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 xor = pack->buf[1];
|
||||||
|
|
||||||
|
if (pack->buf[pack->leng - 2] != 0xFF)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < pack->buf[1] - 2; i++)
|
||||||
|
{
|
||||||
|
xor = xor ^ pack->buf[2 + i];
|
||||||
|
}
|
||||||
|
if (xor != pack->buf[pack->leng - 2])
|
||||||
|
{
|
||||||
|
printf("data err xor = %d x = %d \n", pack->buf[pack->leng - 2], xor);
|
||||||
|
uart_ack(pack->buf[2], KT_ERR_XOR); //err = 7 校验错误
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pack->buf[2] == KT_CMD_PLAY)
|
||||||
|
{
|
||||||
|
int sta = music_player_get_play_status();
|
||||||
|
if (sta == FILE_DEC_STATUS_STOP)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_MUSIC_PLAYER_START,0);
|
||||||
|
}
|
||||||
|
else if ((sta == FILE_DEC_STATUS_PAUSE) || (sta == FILE_DEC_STATUS_WAIT_PAUSE) || (sta == FILE_DEC_STATUS_PAUSE_SUCCESS))
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_MUSIC_PP,0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_PAUSE)
|
||||||
|
{
|
||||||
|
int sta = music_player_get_play_status();
|
||||||
|
if ((sta == FILE_DEC_STATUS_PLAY) || (sta == FILE_DEC_STATUS_WAIT_PLAY))
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_MUSIC_PP,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_PP)
|
||||||
|
{
|
||||||
|
int sta = music_player_get_play_status();
|
||||||
|
if (sta == FILE_DEC_STATUS_STOP)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_MUSIC_PLAYER_START,0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_MUSIC_PP,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_NEXT)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_MUSIC_NEXT,0);
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_PREV)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_MUSIC_PREV,0);
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_STOP)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_MUSIC_PLAYER_END,0);
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_VOL_UP)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_VOL_UP,0);
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_VOL_DOWN)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_VOL_DOWN,0);
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_VOL_SET)
|
||||||
|
{
|
||||||
|
app_audio_set_volume(APP_AUDIO_STATE_MUSIC, (s8)(pack->buf[3]), 1);
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_VOL_MUTE)
|
||||||
|
{
|
||||||
|
printf("KT_CMD_VOL_MUTE \n");
|
||||||
|
//KT_PA_MUTE();
|
||||||
|
kt_sys_mute = 1;
|
||||||
|
//KT_PA_MUTE();
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_VOL_UNMUTE)
|
||||||
|
{
|
||||||
|
printf("KT_CMD_VOL_UNMUTE \n");
|
||||||
|
kt_sys_mute = 0;
|
||||||
|
//KT_PA_UNMUTE();
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_PLAY_NAME) //0xAB
|
||||||
|
{
|
||||||
|
if (pack->buf[3] == '$')
|
||||||
|
{
|
||||||
|
//char temp[32];
|
||||||
|
memset(str_play_name,0,32);
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
if (pack->buf[4+i] != '$')
|
||||||
|
{
|
||||||
|
str_play_name[i] = pack->buf[4+i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
printf("%s\n",str_play_name);
|
||||||
|
if (strlen(str_play_name) < 12)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_USER_PLAY_NAME, (int)str_play_name); //test demo
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uart_ack(pack->buf[2], KT_ERR_PARA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uart_ack(pack->buf[2], KT_ERR_PARA);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_PLAY_FULL_NAME) //0xAC
|
||||||
|
{
|
||||||
|
if (pack->buf[3] == '$')
|
||||||
|
{
|
||||||
|
//char temp[32];
|
||||||
|
memset(str_play_name_full,0,32);
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
if (pack->buf[4+i] != '$')
|
||||||
|
{
|
||||||
|
str_play_name_full[i] = pack->buf[4+i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%s\n",str_play_name_full); //023.mp3
|
||||||
|
if (strlen(str_play_name_full) < 12)
|
||||||
|
{
|
||||||
|
app_task_put_key_msg(KEY_USER_PLAY_FULL_NAME, (int)str_play_name_full); //test demo
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uart_ack(pack->buf[2], KT_ERR_PARA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uart_ack(pack->buf[2], KT_ERR_PARA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (pack->buf[2] == KT_CMD_PLAY_NUM) //0xAD
|
||||||
|
{
|
||||||
|
u16 num = 0;
|
||||||
|
num = pack->buf[3];
|
||||||
|
num = num << 8;
|
||||||
|
num |= pack->buf[4];
|
||||||
|
|
||||||
|
app_task_put_key_msg(KEY_USER_PLAY_NUM, num); //test demo
|
||||||
|
uart_ack(pack->buf[2], KT_OK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uart_ack(pack->buf[2], KT_ERR_UNCMD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void kt_uart_event(void)
|
||||||
|
{
|
||||||
|
if (uart_bus != NULL)
|
||||||
|
{
|
||||||
|
rx_pack.leng = uart_bus->read(rx_pack.buf, KT_UART_RX_BUF_SIZE, 10);
|
||||||
|
|
||||||
|
if (rx_pack.leng > 4)
|
||||||
|
{
|
||||||
|
uart_process(&rx_pack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -728,7 +728,7 @@ struct port_wakeup port0 = {
|
|||||||
.pullup_down_enable = ENABLE, //配置I/O 内部上下拉是否使能
|
.pullup_down_enable = ENABLE, //配置I/O 内部上下拉是否使能
|
||||||
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||||
.attribute = BLUETOOTH_RESUME, //保留参数
|
.attribute = BLUETOOTH_RESUME, //保留参数
|
||||||
.iomap = IO_PORTB_06, //唤醒口选择
|
.iomap = IO_PORTA_03, //唤醒口选择
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct sub_wakeup sub_wkup = {
|
const struct sub_wakeup sub_wkup = {
|
||||||
|
@ -27,11 +27,11 @@
|
|||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
#define TCFG_APP_BT_EN 0
|
#define TCFG_APP_BT_EN 0
|
||||||
#define TCFG_APP_MUSIC_EN 1
|
#define TCFG_APP_MUSIC_EN 1
|
||||||
#define TCFG_APP_LINEIN_EN 1
|
#define TCFG_APP_LINEIN_EN 0
|
||||||
#define TCFG_APP_FM_EN 0
|
#define TCFG_APP_FM_EN 0
|
||||||
#define TCFG_APP_PC_EN 1
|
#define TCFG_APP_PC_EN 1
|
||||||
#define TCFG_APP_RTC_EN 0
|
#define TCFG_APP_RTC_EN 0
|
||||||
#define TCFG_APP_RECORD_EN 1
|
#define TCFG_APP_RECORD_EN 0
|
||||||
#define TCFG_APP_SPDIF_EN 0
|
#define TCFG_APP_SPDIF_EN 0
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
// PCM_DEBUG调试配置 //
|
// PCM_DEBUG调试配置 //
|
||||||
@ -42,12 +42,12 @@
|
|||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
// UART配置 //
|
// UART配置 //
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
#define TCFG_UART0_ENABLE ENABLE_THIS_MOUDLE //串口打印模块使能
|
#define TCFG_UART0_ENABLE DISABLE_THIS_MOUDLE //串口打印模块使能
|
||||||
#define TCFG_UART0_RX_PORT NO_CONFIG_PORT //串口接收脚配置(用于打印可以选择NO_CONFIG_PORT)
|
#define TCFG_UART0_RX_PORT NO_CONFIG_PORT //串口接收脚配置(用于打印可以选择NO_CONFIG_PORT)
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
#define TCFG_UART0_TX_PORT IO_PORTB_05 //串口发送脚配置
|
#define TCFG_UART0_TX_PORT IO_PORTA_05 //串口发送脚配置
|
||||||
#define TCFG_UART0_BAUDRATE 1000000 //串口波特率配置
|
#define TCFG_UART0_BAUDRATE 115200 //串口波特率配置
|
||||||
#else
|
#else
|
||||||
#define TCFG_UART0_TX_PORT IO_PORTA_05 //串口发送脚配置
|
#define TCFG_UART0_TX_PORT IO_PORTA_05 //串口发送脚配置
|
||||||
#define TCFG_UART0_BAUDRATE 1000000 //串口波特率配置
|
#define TCFG_UART0_BAUDRATE 1000000 //串口波特率配置
|
||||||
@ -77,12 +77,12 @@
|
|||||||
#define TCFG_HW_SPI1_ENABLE ENABLE_THIS_MOUDLE
|
#define TCFG_HW_SPI1_ENABLE ENABLE_THIS_MOUDLE
|
||||||
//A组IO: DI: PB2 DO: PB1 CLK: PB0
|
//A组IO: DI: PB2 DO: PB1 CLK: PB0
|
||||||
//B组IO: DI: PC3 DO: PC5 CLK: PC4
|
//B组IO: DI: PC3 DO: PC5 CLK: PC4
|
||||||
#define TCFG_HW_SPI1_PORT 'A'
|
#define TCFG_HW_SPI1_PORT 'B'
|
||||||
#define TCFG_HW_SPI1_BAUD 4000000L
|
#define TCFG_HW_SPI1_BAUD 4000000L
|
||||||
#define TCFG_HW_SPI1_MODE SPI_MODE_BIDIR_1BIT
|
#define TCFG_HW_SPI1_MODE SPI_MODE_UNIDIR_1BIT
|
||||||
#define TCFG_HW_SPI1_ROLE SPI_ROLE_MASTER
|
#define TCFG_HW_SPI1_ROLE SPI_ROLE_MASTER
|
||||||
|
|
||||||
#define TCFG_HW_SPI2_ENABLE ENABLE_THIS_MOUDLE
|
#define TCFG_HW_SPI2_ENABLE DISABLE_THIS_MOUDLE
|
||||||
//A组IO: DI: PB8 DO: PB10 CLK: PB9
|
//A组IO: DI: PB8 DO: PB10 CLK: PB9
|
||||||
//B组IO: DI: PA13 DO: DM CLK: DP
|
//B组IO: DI: PA13 DO: DM CLK: DP
|
||||||
#define TCFG_HW_SPI2_PORT 'A'
|
#define TCFG_HW_SPI2_PORT 'A'
|
||||||
@ -93,20 +93,20 @@
|
|||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
// FLASH 配置 //
|
// FLASH 配置 //
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
#define TCFG_NORFLASH_DEV_ENABLE DISABLE_THIS_MOUDLE //需要关闭SD0
|
#define TCFG_NORFLASH_DEV_ENABLE ENABLE_THIS_MOUDLE //需要关闭SD0
|
||||||
#define TCFG_FLASH_DEV_SPI_HW_NUM 1// 1: SPI1 2: SPI2
|
#define TCFG_FLASH_DEV_SPI_HW_NUM 1// 1: SPI1 2: SPI2
|
||||||
#define TCFG_FLASH_DEV_SPI_CS_PORT IO_PORTA_03
|
#define TCFG_FLASH_DEV_SPI_CS_PORT IO_PORTC_03
|
||||||
|
|
||||||
|
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
// 充电参数配置 //
|
// 充电参数配置 //
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
//是否支持芯片内置充电
|
//是否支持芯片内置充电
|
||||||
#define TCFG_CHARGE_ENABLE ENABLE_THIS_MOUDLE
|
#define TCFG_CHARGE_ENABLE DISABLE_THIS_MOUDLE
|
||||||
//是否支持开机充电
|
//是否支持开机充电
|
||||||
#define TCFG_CHARGE_POWERON_ENABLE ENABLE
|
#define TCFG_CHARGE_POWERON_ENABLE DISABLE
|
||||||
//是否支持拔出充电自动开机功能
|
//是否支持拔出充电自动开机功能
|
||||||
#define TCFG_CHARGE_OFF_POWERON_NE ENABLE
|
#define TCFG_CHARGE_OFF_POWERON_NE DISABLE
|
||||||
|
|
||||||
#define TCFG_CHARGE_FULL_V CHARGE_FULL_V_4202
|
#define TCFG_CHARGE_FULL_V CHARGE_FULL_V_4202
|
||||||
|
|
||||||
@ -126,7 +126,7 @@
|
|||||||
//A组IO: CMD:PC4 CLK:PC5 DAT0:PC3 //D组IO: CMD:PB2 CLK:PB0 DAT0:PB3
|
//A组IO: CMD:PC4 CLK:PC5 DAT0:PC3 //D组IO: CMD:PB2 CLK:PB0 DAT0:PB3
|
||||||
//B组IO: CMD:PB6 CLK:PB7 DAT0:PB5 //E组IO: CMD:PA4 CLK:PC5 DAT0:DM
|
//B组IO: CMD:PB6 CLK:PB7 DAT0:PB5 //E组IO: CMD:PA4 CLK:PC5 DAT0:DM
|
||||||
//C组IO: CMD:PA4 CLK:PA2 DAT0:PA3 //F组IO: CMD:PB6 CLK:PB7 DAT0:PB4
|
//C组IO: CMD:PA4 CLK:PA2 DAT0:PA3 //F组IO: CMD:PB6 CLK:PB7 DAT0:PB4
|
||||||
#define TCFG_SD0_ENABLE ENABLE_THIS_MOUDLE
|
#define TCFG_SD0_ENABLE DISABLE_THIS_MOUDLE
|
||||||
#define TCFG_SD0_PORTS 'A'
|
#define TCFG_SD0_PORTS 'A'
|
||||||
#define TCFG_SD0_DAT_MODE 1//AC696x不支持4线模式
|
#define TCFG_SD0_DAT_MODE 1//AC696x不支持4线模式
|
||||||
#define TCFG_SD0_DET_MODE SD_CLK_DECT
|
#define TCFG_SD0_DET_MODE SD_CLK_DECT
|
||||||
@ -138,7 +138,7 @@
|
|||||||
#if TCFG_SD0_SD1_USE_THE_SAME_HW
|
#if TCFG_SD0_SD1_USE_THE_SAME_HW
|
||||||
#define TCFG_SD1_ENABLE 1
|
#define TCFG_SD1_ENABLE 1
|
||||||
#else
|
#else
|
||||||
#define TCFG_SD1_ENABLE 0
|
#define TCFG_SD1_ENABLE DISABLE_THIS_MOUDLE
|
||||||
#endif
|
#endif
|
||||||
#define TCFG_SD1_PORTS 'F'
|
#define TCFG_SD1_PORTS 'F'
|
||||||
#define TCFG_SD1_DAT_MODE 1//AC696x不支持4线模式
|
#define TCFG_SD1_DAT_MODE 1//AC696x不支持4线模式
|
||||||
@ -151,7 +151,7 @@
|
|||||||
// USB 配置 //
|
// USB 配置 //
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
#define TCFG_PC_ENABLE TCFG_APP_PC_EN//PC模块使能
|
#define TCFG_PC_ENABLE TCFG_APP_PC_EN//PC模块使能
|
||||||
#define TCFG_UDISK_ENABLE ENABLE_THIS_MOUDLE//U盘模块使能
|
#define TCFG_UDISK_ENABLE DISABLE_THIS_MOUDLE//U盘模块使能
|
||||||
#define TCFG_OTG_USB_DEV_EN BIT(0)//USB0 = BIT(0) USB1 = BIT(1)
|
#define TCFG_OTG_USB_DEV_EN BIT(0)//USB0 = BIT(0) USB1 = BIT(1)
|
||||||
|
|
||||||
#include "usb_std_class_def.h"
|
#include "usb_std_class_def.h"
|
||||||
@ -193,7 +193,7 @@
|
|||||||
#if TCFG_NORFLASH_DEV_ENABLE
|
#if TCFG_NORFLASH_DEV_ENABLE
|
||||||
#define TCFG_NOR_FAT 1//ENABLE
|
#define TCFG_NOR_FAT 1//ENABLE
|
||||||
#define TCFG_NOR_FS 0//ENABLE
|
#define TCFG_NOR_FS 0//ENABLE
|
||||||
#define TCFG_NOR_REC 1//ENABLE
|
#define TCFG_NOR_REC 0//ENABLE
|
||||||
#else
|
#else
|
||||||
#define TCFG_NOR_FAT 0//ENABLE
|
#define TCFG_NOR_FAT 0//ENABLE
|
||||||
#define TCFG_NOR_FS 0//ENABLE
|
#define TCFG_NOR_FS 0//ENABLE
|
||||||
@ -221,7 +221,6 @@
|
|||||||
#define TCFG_IOKEY_ENABLE DISABLE_THIS_MOUDLE //是否使能IO按键
|
#define TCFG_IOKEY_ENABLE DISABLE_THIS_MOUDLE //是否使能IO按键
|
||||||
|
|
||||||
#define TCFG_IOKEY_POWER_CONNECT_WAY ONE_PORT_TO_LOW //按键一端接低电平一端接IO
|
#define TCFG_IOKEY_POWER_CONNECT_WAY ONE_PORT_TO_LOW //按键一端接低电平一端接IO
|
||||||
|
|
||||||
#define TCFG_IOKEY_POWER_ONE_PORT IO_PORTB_01 //IO按键端口
|
#define TCFG_IOKEY_POWER_ONE_PORT IO_PORTB_01 //IO按键端口
|
||||||
|
|
||||||
#define TCFG_IOKEY_PREV_CONNECT_WAY ONE_PORT_TO_LOW //按键一端接低电平一端接IO
|
#define TCFG_IOKEY_PREV_CONNECT_WAY ONE_PORT_TO_LOW //按键一端接低电平一端接IO
|
||||||
@ -237,9 +236,9 @@
|
|||||||
#define TCFG_ADKEY_LED_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 LED IO复用,led只能设置蓝灯显示
|
#define TCFG_ADKEY_LED_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 LED IO复用,led只能设置蓝灯显示
|
||||||
#define TCFG_ADKEY_IR_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 红外IO复用
|
#define TCFG_ADKEY_IR_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 红外IO复用
|
||||||
#define TCFG_ADKEY_LED_SPI_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 LED SPI IO复用
|
#define TCFG_ADKEY_LED_SPI_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 LED SPI IO复用
|
||||||
#define TCFG_ADKEY_PORT IO_PORTB_06 //AD按键端口(需要注意选择的IO口是否支持AD功能)
|
#define TCFG_ADKEY_PORT IO_PORTA_03 //AD按键端口(需要注意选择的IO口是否支持AD功能)
|
||||||
#define TCFG_ADKEY_AD_CHANNEL AD_CH_PB6
|
#define TCFG_ADKEY_AD_CHANNEL AD_CH_PA3
|
||||||
#define TCFG_ADKEY_EXTERN_UP_ENABLE ENABLE_THIS_MOUDLE //是否使用外部上拉
|
#define TCFG_ADKEY_EXTERN_UP_ENABLE DISABLE_THIS_MOUDLE //是否使用外部上拉
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
#if TCFG_ADKEY_EXTERN_UP_ENABLE
|
#if TCFG_ADKEY_EXTERN_UP_ENABLE
|
||||||
@ -525,7 +524,7 @@ DAC硬件上的连接方式,可选的配置:
|
|||||||
// EQ配置 //
|
// EQ配置 //
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
//EQ配置,使用在线EQ时,EQ文件和EQ模式无效。有EQ文件时,使能TCFG_USE_EQ_FILE,默认不用EQ模式切换功能
|
//EQ配置,使用在线EQ时,EQ文件和EQ模式无效。有EQ文件时,使能TCFG_USE_EQ_FILE,默认不用EQ模式切换功能
|
||||||
#define TCFG_EQ_ENABLE 1 //支持EQ功能,EQ总使能
|
#define TCFG_EQ_ENABLE 0 //支持EQ功能,EQ总使能
|
||||||
#if TCFG_EQ_ENABLE
|
#if TCFG_EQ_ENABLE
|
||||||
#define TCFG_EQ_ONLINE_ENABLE 0 //支持在线EQ调试
|
#define TCFG_EQ_ONLINE_ENABLE 0 //支持在线EQ调试
|
||||||
#define TCFG_BT_MUSIC_EQ_ENABLE 1 //支持蓝牙音乐EQ
|
#define TCFG_BT_MUSIC_EQ_ENABLE 1 //支持蓝牙音乐EQ
|
||||||
@ -544,7 +543,7 @@ DAC硬件上的连接方式,可选的配置:
|
|||||||
#define EQ_SECTION_MAX 10 //eq段数
|
#define EQ_SECTION_MAX 10 //eq段数
|
||||||
#endif//TCFG_EQ_ENABLE
|
#endif//TCFG_EQ_ENABLE
|
||||||
|
|
||||||
#define TCFG_DRC_ENABLE 1 //DRC 总使能
|
#define TCFG_DRC_ENABLE 0 //DRC 总使能
|
||||||
#if TCFG_DRC_ENABLE
|
#if TCFG_DRC_ENABLE
|
||||||
#define TCFG_BT_MUSIC_DRC_ENABLE 1 //支持蓝牙音乐DRC
|
#define TCFG_BT_MUSIC_DRC_ENABLE 1 //支持蓝牙音乐DRC
|
||||||
#define TCFG_MUSIC_MODE_DRC_ENABLE 1 //支持音乐模式DRC
|
#define TCFG_MUSIC_MODE_DRC_ENABLE 1 //支持音乐模式DRC
|
||||||
@ -630,7 +629,7 @@ DAC硬件上的连接方式,可选的配置:
|
|||||||
// 系统配置 //
|
// 系统配置 //
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
#define TCFG_AUTO_SHUT_DOWN_TIME 0 //没有蓝牙连接自动关机时间
|
#define TCFG_AUTO_SHUT_DOWN_TIME 0 //没有蓝牙连接自动关机时间
|
||||||
#define TCFG_SYS_LVD_EN 1 //电量检测使能
|
#define TCFG_SYS_LVD_EN 0 //电量检测使能
|
||||||
#define TCFG_POWER_ON_NEED_KEY 0 //是否需要按按键开机配置
|
#define TCFG_POWER_ON_NEED_KEY 0 //是否需要按按键开机配置
|
||||||
#define TWFG_APP_POWERON_IGNORE_DEV 0//上电忽略挂载设备,0时不忽略,非0则n毫秒忽略
|
#define TWFG_APP_POWERON_IGNORE_DEV 0//上电忽略挂载设备,0时不忽略,非0则n毫秒忽略
|
||||||
|
|
||||||
@ -641,7 +640,7 @@ DAC硬件上的连接方式,可选的配置:
|
|||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
#define TCFG_USER_TWS_ENABLE 0 //tws功能使能
|
#define TCFG_USER_TWS_ENABLE 0 //tws功能使能
|
||||||
#define TCFG_USER_BLE_ENABLE 0 //BLE功能使能
|
#define TCFG_USER_BLE_ENABLE 0 //BLE功能使能
|
||||||
#define TCFG_USER_BT_CLASSIC_ENABLE 1 //经典蓝牙功能使能
|
#define TCFG_USER_BT_CLASSIC_ENABLE 0 //经典蓝牙功能使能
|
||||||
#define TCFG_BT_SUPPORT_AAC 0 //AAC格式支持
|
#define TCFG_BT_SUPPORT_AAC 0 //AAC格式支持
|
||||||
#define TCFG_USER_EMITTER_ENABLE 0 //(暂不支持)emitter功能使能
|
#define TCFG_USER_EMITTER_ENABLE 0 //(暂不支持)emitter功能使能
|
||||||
#define TCFG_BT_SNIFF_ENABLE 0 //bt sniff 功能使能
|
#define TCFG_BT_SNIFF_ENABLE 0 //bt sniff 功能使能
|
||||||
@ -667,9 +666,9 @@ DAC硬件上的连接方式,可选的配置:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BT_INBAND_RINGTONE 0 //是否播放手机自带来电铃声
|
#define BT_INBAND_RINGTONE 0 //是否播放手机自带来电铃声
|
||||||
#define BT_PHONE_NUMBER 1 //是否播放来电报号
|
#define BT_PHONE_NUMBER 0 //是否播放来电报号
|
||||||
#define BT_SUPPORT_DISPLAY_BAT 1 //是否使能电量检测
|
#define BT_SUPPORT_DISPLAY_BAT 0 //是否使能电量检测
|
||||||
#define BT_SUPPORT_MUSIC_VOL_SYNC 1 //是否使能音量同步
|
#define BT_SUPPORT_MUSIC_VOL_SYNC 0 //是否使能音量同步
|
||||||
|
|
||||||
#define TCFG_BLUETOOTH_BACK_MODE 0 //不支持后台模式
|
#define TCFG_BLUETOOTH_BACK_MODE 0 //不支持后台模式
|
||||||
|
|
||||||
@ -700,7 +699,7 @@ DAC硬件上的连接方式,可选的配置:
|
|||||||
// REC 配置 //
|
// REC 配置 //
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
#define RECORDER_MIX_EN DISABLE//混合录音使能
|
#define RECORDER_MIX_EN DISABLE//混合录音使能
|
||||||
#define TCFG_RECORD_FOLDER_DEV_ENABLE ENABLE//音乐播放录音区分使能
|
#define TCFG_RECORD_FOLDER_DEV_ENABLE DISABLE//音乐播放录音区分使能
|
||||||
|
|
||||||
|
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
|
@ -97,6 +97,16 @@ static void app_init()
|
|||||||
|
|
||||||
board_init();
|
board_init();
|
||||||
|
|
||||||
|
gpio_set_pull_down(IO_PORTC_02,0);
|
||||||
|
gpio_set_pull_up(IO_PORTC_02,0);
|
||||||
|
gpio_set_die(IO_PORTC_02,1);
|
||||||
|
gpio_set_direction(IO_PORTC_02,1);
|
||||||
|
|
||||||
|
gpio_set_pull_down(IO_PORTA_02,0);
|
||||||
|
gpio_set_pull_up(IO_PORTA_02,0);
|
||||||
|
gpio_set_die(IO_PORTA_02,1);
|
||||||
|
gpio_set_direction(IO_PORTA_02,1);
|
||||||
|
|
||||||
do_initcall();
|
do_initcall();
|
||||||
|
|
||||||
do_module_initcall();
|
do_module_initcall();
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#define CONFIG_DEBUG_LIB(x) (x & LIB_DEBUG)
|
#define CONFIG_DEBUG_LIB(x) (x & LIB_DEBUG)
|
||||||
|
|
||||||
// #define CONFIG_DEBUG_ENABLE
|
#define CONFIG_DEBUG_ENABLE
|
||||||
|
|
||||||
#ifndef CONFIG_DEBUG_ENABLE
|
#ifndef CONFIG_DEBUG_ENABLE
|
||||||
//#define CONFIG_DEBUG_LITE_ENABLE //轻量级打印开关, 默认关闭
|
//#define CONFIG_DEBUG_LITE_ENABLE //轻量级打印开关, 默认关闭
|
||||||
|
@ -175,6 +175,10 @@ enum {
|
|||||||
KEY_TEST_DEMO_0,
|
KEY_TEST_DEMO_0,
|
||||||
KEY_TEST_DEMO_1,
|
KEY_TEST_DEMO_1,
|
||||||
|
|
||||||
|
KEY_USER_PLAY_NUM,
|
||||||
|
KEY_USER_PLAY_NAME,
|
||||||
|
KEY_USER_PLAY_FULL_NAME,
|
||||||
|
|
||||||
KEY_IR_NUM_0, //中间不允许插入
|
KEY_IR_NUM_0, //中间不允许插入
|
||||||
KEY_IR_NUM_1,
|
KEY_IR_NUM_1,
|
||||||
KEY_IR_NUM_2,
|
KEY_IR_NUM_2,
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "soundbox.h"
|
#include "soundbox.h"
|
||||||
#include "audio_recorder_mix.h"
|
#include "audio_recorder_mix.h"
|
||||||
#include "bt_emitter.h"
|
#include "bt_emitter.h"
|
||||||
|
#include "kt.h"
|
||||||
|
|
||||||
#define LOG_TAG_CONST APP_ACTION
|
#define LOG_TAG_CONST APP_ACTION
|
||||||
#define LOG_TAG "[APP_ACTION]"
|
#define LOG_TAG "[APP_ACTION]"
|
||||||
@ -48,14 +49,12 @@
|
|||||||
#define LOG_CLI_ENABLE
|
#define LOG_CLI_ENABLE
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
|
||||||
int JL_rcsp_event_handler(struct rcsp_event *rcsp);
|
int JL_rcsp_event_handler(struct rcsp_event *rcsp);
|
||||||
int bt_background_event_handler(struct sys_event *event);
|
int bt_background_event_handler(struct sys_event *event);
|
||||||
extern u32 timer_get_ms(void);
|
extern u32 timer_get_ms(void);
|
||||||
extern int alarm_sys_event_handler(struct sys_event *event);
|
extern int alarm_sys_event_handler(struct sys_event *event);
|
||||||
extern void bt_tws_sync_volume();
|
extern void bt_tws_sync_volume();
|
||||||
|
|
||||||
|
|
||||||
int app_common_key_msg_deal(struct sys_event *event)
|
int app_common_key_msg_deal(struct sys_event *event)
|
||||||
{
|
{
|
||||||
int ret = false;
|
int ret = false;
|
||||||
@ -63,36 +62,42 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
int key_event = event->u.key.event;
|
int key_event = event->u.key.event;
|
||||||
int key_value = event->u.key.value;
|
int key_value = event->u.key.value;
|
||||||
|
|
||||||
if (key_event == KEY_NULL) {
|
if (key_event == KEY_NULL)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key_is_ui_takeover()) {
|
if (key_is_ui_takeover())
|
||||||
|
{
|
||||||
ui_key_msg_post(key_event);
|
ui_key_msg_post(key_event);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (TCFG_UI_ENABLE && TCFG_APP_FM_EMITTER_EN)
|
#if (TCFG_UI_ENABLE && TCFG_APP_FM_EMITTER_EN)
|
||||||
if (!ui_fm_emitter_common_key_msg(key_event)) {
|
if (!ui_fm_emitter_common_key_msg(key_event))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
log_info("common_key_event:%d\n", key_event);
|
log_info("common_key_event:%d\n", key_event);
|
||||||
|
|
||||||
if ((key_event != KEY_POWEROFF) && (key_event != KEY_POWEROFF_HOLD)) {
|
if ((key_event != KEY_POWEROFF) && (key_event != KEY_POWEROFF_HOLD))
|
||||||
|
{
|
||||||
extern u8 goto_poweroff_first_flag;
|
extern u8 goto_poweroff_first_flag;
|
||||||
goto_poweroff_first_flag = 0;
|
goto_poweroff_first_flag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (SMART_BOX_EN)
|
#if (SMART_BOX_EN)
|
||||||
extern bool smartbox_key_event_filter_before(int key_event);
|
extern bool smartbox_key_event_filter_before(int key_event);
|
||||||
if (smartbox_key_event_filter_before(key_event)) {
|
if (smartbox_key_event_filter_before(key_event))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (key_event) {
|
switch (key_event)
|
||||||
|
{
|
||||||
#if TCFG_APP_BT_EN
|
#if TCFG_APP_BT_EN
|
||||||
|
|
||||||
#if TCFG_USER_TWS_ENABLE
|
#if TCFG_USER_TWS_ENABLE
|
||||||
@ -145,13 +150,14 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
|
|
||||||
case KEY_CHANGE_MODE:
|
case KEY_CHANGE_MODE:
|
||||||
#if (TCFG_DEC2TWS_ENABLE)
|
#if (TCFG_DEC2TWS_ENABLE)
|
||||||
if (!key->init) {
|
if (!key->init)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if TWFG_APP_POWERON_IGNORE_DEV
|
#if TWFG_APP_POWERON_IGNORE_DEV
|
||||||
if ((timer_get_ms() - app_var.start_time) > TWFG_APP_POWERON_IGNORE_DEV)
|
if ((timer_get_ms() - app_var.start_time) > TWFG_APP_POWERON_IGNORE_DEV)
|
||||||
#endif//TWFG_APP_POWERON_IGNORE_DEV
|
#endif // TWFG_APP_POWERON_IGNORE_DEV
|
||||||
|
|
||||||
{
|
{
|
||||||
printf("KEY_CHANGE_MODE\n");
|
printf("KEY_CHANGE_MODE\n");
|
||||||
@ -161,12 +167,15 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
|
|
||||||
case KEY_VOL_UP:
|
case KEY_VOL_UP:
|
||||||
log_info("COMMON KEY_VOL_UP\n");
|
log_info("COMMON KEY_VOL_UP\n");
|
||||||
if (!tone_get_status()) {
|
if (!tone_get_status())
|
||||||
|
{
|
||||||
app_audio_volume_up(1);
|
app_audio_volume_up(1);
|
||||||
printf("common vol+: %d", app_audio_get_volume(APP_AUDIO_CURRENT_STATE));
|
printf("common vol+: %d", app_audio_get_volume(APP_AUDIO_CURRENT_STATE));
|
||||||
}
|
}
|
||||||
if (app_audio_get_volume(APP_AUDIO_CURRENT_STATE) == app_audio_get_max_volume()) {
|
if (app_audio_get_volume(APP_AUDIO_CURRENT_STATE) == app_audio_get_max_volume())
|
||||||
if (tone_get_status() == 0) {
|
{
|
||||||
|
if (tone_get_status() == 0)
|
||||||
|
{
|
||||||
#if TCFG_MAX_VOL_PROMPT
|
#if TCFG_MAX_VOL_PROMPT
|
||||||
tone_play_by_path(tone_table[IDEX_TONE_MAX_VOL], 0);
|
tone_play_by_path(tone_table[IDEX_TONE_MAX_VOL], 0);
|
||||||
#endif
|
#endif
|
||||||
@ -190,13 +199,12 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_EQ_MODE:
|
case KEY_EQ_MODE:
|
||||||
#if(TCFG_EQ_ENABLE == 1)
|
#if (TCFG_EQ_ENABLE == 1)
|
||||||
eq_mode_sw();
|
eq_mode_sw();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
#if (AUDIO_OUTPUT_WAY == AUDIO_OUTPUT_WAY_BT)
|
#if (AUDIO_OUTPUT_WAY == AUDIO_OUTPUT_WAY_BT)
|
||||||
|
|
||||||
|
|
||||||
case KEY_BT_EMITTER_RECEIVER_SW:
|
case KEY_BT_EMITTER_RECEIVER_SW:
|
||||||
printf(" KEY_BT_EMITTER_RECEIVER_SW\n");
|
printf(" KEY_BT_EMITTER_RECEIVER_SW\n");
|
||||||
bt_emitter_receiver_sw();
|
bt_emitter_receiver_sw();
|
||||||
@ -217,16 +225,18 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
{
|
{
|
||||||
extern u8 bt_emitter_stu_sw(void);
|
extern u8 bt_emitter_stu_sw(void);
|
||||||
|
|
||||||
if (bt_emitter_stu_sw()) {
|
if (bt_emitter_stu_sw())
|
||||||
|
{
|
||||||
printf("bt emitter start \n");
|
printf("bt emitter start \n");
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
printf("bt emitter stop \n");
|
printf("bt emitter stop \n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if (TCFG_CHARGE_BOX_ENABLE)
|
#if (TCFG_CHARGE_BOX_ENABLE)
|
||||||
case KEY_BOX_POWER_CLICK:
|
case KEY_BOX_POWER_CLICK:
|
||||||
case KEY_BOX_POWER_LONG:
|
case KEY_BOX_POWER_LONG:
|
||||||
@ -240,14 +250,18 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
#if (TCFG_MIC_EFFECT_ENABLE)
|
#if (TCFG_MIC_EFFECT_ENABLE)
|
||||||
case KEY_REVERB_OPEN:
|
case KEY_REVERB_OPEN:
|
||||||
#if TCFG_USER_TWS_ENABLE
|
#if TCFG_USER_TWS_ENABLE
|
||||||
if (!key->init) {
|
if (!key->init)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (mic_effect_get_status()) {
|
if (mic_effect_get_status())
|
||||||
|
{
|
||||||
mic_effect_stop();
|
mic_effect_stop();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
mic_effect_start();
|
mic_effect_start();
|
||||||
}
|
}
|
||||||
ret = true;
|
ret = true;
|
||||||
@ -255,14 +269,17 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
#endif
|
#endif
|
||||||
case KEY_ENC_START:
|
case KEY_ENC_START:
|
||||||
#if (RECORDER_MIX_EN)
|
#if (RECORDER_MIX_EN)
|
||||||
if (recorder_mix_get_status()) {
|
if (recorder_mix_get_status())
|
||||||
|
{
|
||||||
printf("recorder_encode_stop\n");
|
printf("recorder_encode_stop\n");
|
||||||
recorder_mix_stop();
|
recorder_mix_stop();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
printf("recorder_encode_start\n");
|
printf("recorder_encode_start\n");
|
||||||
recorder_mix_start();
|
recorder_mix_start();
|
||||||
}
|
}
|
||||||
#endif/*RECORDER_MIX_EN*/
|
#endif /*RECORDER_MIX_EN*/
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ui_key_msg_post(key_event);
|
ui_key_msg_post(key_event);
|
||||||
@ -270,7 +287,6 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
soundcard_event_deal(event);
|
soundcard_event_deal(event);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
#if (SMART_BOX_EN)
|
#if (SMART_BOX_EN)
|
||||||
extern int smartbox_common_key_event_deal(u8 key_event, int ret);
|
extern int smartbox_common_key_event_deal(u8 key_event, int ret);
|
||||||
@ -281,8 +297,9 @@ int app_common_key_msg_deal(struct sys_event *event)
|
|||||||
|
|
||||||
int app_power_user_event_handler(struct device_event *dev)
|
int app_power_user_event_handler(struct device_event *dev)
|
||||||
{
|
{
|
||||||
#if(TCFG_SYS_LVD_EN == 1)
|
#if (TCFG_SYS_LVD_EN == 1)
|
||||||
switch (dev->event) {
|
switch (dev->event)
|
||||||
|
{
|
||||||
case POWER_EVENT_POWER_WARNING:
|
case POWER_EVENT_POWER_WARNING:
|
||||||
ui_update_status(STATUS_LOWPOWER);
|
ui_update_status(STATUS_LOWPOWER);
|
||||||
tone_play_by_path(tone_table[IDEX_TONE_LOW_POWER], 1);
|
tone_play_by_path(tone_table[IDEX_TONE_LOW_POWER], 1);
|
||||||
@ -300,14 +317,15 @@ static void app_common_device_event_handler(struct sys_event *event)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
const char *logo = NULL;
|
const char *logo = NULL;
|
||||||
const char *usb_msg = NULL;
|
const char *usb_msg = NULL;
|
||||||
u8 app = 0xff ;
|
u8 app = 0xff;
|
||||||
u8 alarm_flag = 0;
|
u8 alarm_flag = 0;
|
||||||
switch ((u32)event->arg) {
|
switch ((u32)event->arg)
|
||||||
|
{
|
||||||
#if TCFG_CHARGE_ENABLE
|
#if TCFG_CHARGE_ENABLE
|
||||||
case DEVICE_EVENT_FROM_CHARGE:
|
case DEVICE_EVENT_FROM_CHARGE:
|
||||||
app_charge_event_handler(&event->u.dev);
|
app_charge_event_handler(&event->u.dev);
|
||||||
break;
|
break;
|
||||||
#endif//TCFG_CHARGE_ENABLE
|
#endif // TCFG_CHARGE_ENABLE
|
||||||
|
|
||||||
#if TCFG_ONLINE_ENABLE
|
#if TCFG_ONLINE_ENABLE
|
||||||
case DEVICE_EVENT_FROM_CI_UART:
|
case DEVICE_EVENT_FROM_CI_UART:
|
||||||
@ -318,8 +336,18 @@ static void app_common_device_event_handler(struct sys_event *event)
|
|||||||
case DEVICE_EVENT_FROM_CI_TWS:
|
case DEVICE_EVENT_FROM_CI_TWS:
|
||||||
ci_data_rx_handler(CI_TWS);
|
ci_data_rx_handler(CI_TWS);
|
||||||
break;
|
break;
|
||||||
#endif//TCFG_USER_TWS_ENABLE
|
#endif // TCFG_USER_TWS_ENABLE
|
||||||
#endif//TCFG_ONLINE_ENABLE
|
#endif // TCFG_ONLINE_ENABLE
|
||||||
|
case DEVICE_EVENT_FROM_UART_RX_OVERFLOW:
|
||||||
|
{
|
||||||
|
kt_uart_event();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DEVICE_EVENT_FROM_UART_RX_OUTTIME:
|
||||||
|
{
|
||||||
|
kt_uart_event();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case DEVICE_EVENT_FROM_POWER:
|
case DEVICE_EVENT_FROM_POWER:
|
||||||
app_power_user_event_handler(&event->u.dev);
|
app_power_user_event_handler(&event->u.dev);
|
||||||
@ -329,30 +357,35 @@ static void app_common_device_event_handler(struct sys_event *event)
|
|||||||
case DEVICE_EVENT_CHARGE_STORE:
|
case DEVICE_EVENT_CHARGE_STORE:
|
||||||
app_chargestore_event_handler(&event->u.chargestore);
|
app_chargestore_event_handler(&event->u.chargestore);
|
||||||
break;
|
break;
|
||||||
#endif//TCFG_CHARGESTORE_ENABLE || TCFG_TEST_BOX_ENABLE
|
#endif // TCFG_CHARGESTORE_ENABLE || TCFG_TEST_BOX_ENABLE
|
||||||
|
|
||||||
#if(TCFG_CHARGE_BOX_ENABLE)
|
#if (TCFG_CHARGE_BOX_ENABLE)
|
||||||
case DEVICE_EVENT_FROM_CHARGEBOX:
|
case DEVICE_EVENT_FROM_CHARGEBOX:
|
||||||
charge_box_ctrl_event_handler(&event->u.chargebox);
|
charge_box_ctrl_event_handler(&event->u.chargebox);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
case DEVICE_EVENT_FROM_OTG:
|
case DEVICE_EVENT_FROM_OTG:
|
||||||
///先分析OTG设备类型
|
/// 先分析OTG设备类型
|
||||||
usb_msg = (const char *)event->u.dev.value;
|
usb_msg = (const char *)event->u.dev.value;
|
||||||
if (usb_msg[0] == 's') {
|
if (usb_msg[0] == 's')
|
||||||
///是从机
|
{
|
||||||
|
/// 是从机
|
||||||
#if TCFG_PC_ENABLE
|
#if TCFG_PC_ENABLE
|
||||||
ret = pc_device_event_handler(event);
|
ret = pc_device_event_handler(event);
|
||||||
if (ret == true) {
|
if (ret == true)
|
||||||
|
{
|
||||||
app = APP_PC_TASK;
|
app = APP_PC_TASK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
} else if (usb_msg[0] == 'h') {
|
}
|
||||||
///是主机, 统一于SD卡等响应主机处理,这里不break
|
else if (usb_msg[0] == 'h')
|
||||||
} else {
|
{
|
||||||
|
/// 是主机, 统一于SD卡等响应主机处理,这里不break
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
log_e("unknow otg devcie !!!\n");
|
log_e("unknow otg devcie !!!\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -360,11 +393,14 @@ static void app_common_device_event_handler(struct sys_event *event)
|
|||||||
case DRIVER_EVENT_FROM_SD1:
|
case DRIVER_EVENT_FROM_SD1:
|
||||||
case DRIVER_EVENT_FROM_SD2:
|
case DRIVER_EVENT_FROM_SD2:
|
||||||
#if TCFG_APP_MUSIC_EN
|
#if TCFG_APP_MUSIC_EN
|
||||||
ret = dev_status_event_filter(event);///解码设备上下线, 设备挂载等处理
|
ret = dev_status_event_filter(event); /// 解码设备上下线, 设备挂载等处理
|
||||||
if (ret == true) {
|
if (ret == true)
|
||||||
if (event->u.dev.event == DEVICE_EVENT_IN) {
|
{
|
||||||
///设备上线, 非解码模式切换到解码模式播放
|
if (event->u.dev.event == DEVICE_EVENT_IN)
|
||||||
if (app_get_curr_task() != APP_MUSIC_TASK) {
|
{
|
||||||
|
/// 设备上线, 非解码模式切换到解码模式播放
|
||||||
|
if (app_get_curr_task() != APP_MUSIC_TASK)
|
||||||
|
{
|
||||||
app = APP_MUSIC_TASK;
|
app = APP_MUSIC_TASK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -375,21 +411,23 @@ static void app_common_device_event_handler(struct sys_event *event)
|
|||||||
#if TCFG_APP_LINEIN_EN
|
#if TCFG_APP_LINEIN_EN
|
||||||
case DEVICE_EVENT_FROM_LINEIN:
|
case DEVICE_EVENT_FROM_LINEIN:
|
||||||
ret = linein_device_event_handler(event);
|
ret = linein_device_event_handler(event);
|
||||||
if (ret == true) {
|
if (ret == true)
|
||||||
|
{
|
||||||
app = APP_LINEIN_TASK;
|
app = APP_LINEIN_TASK;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif//TCFG_APP_LINEIN_EN
|
#endif // TCFG_APP_LINEIN_EN
|
||||||
|
|
||||||
#if TCFG_APP_RTC_EN
|
#if TCFG_APP_RTC_EN
|
||||||
case DEVICE_EVENT_FROM_ALM:
|
case DEVICE_EVENT_FROM_ALM:
|
||||||
ret = alarm_sys_event_handler(event);
|
ret = alarm_sys_event_handler(event);
|
||||||
if (ret == true) {
|
if (ret == true)
|
||||||
|
{
|
||||||
alarm_flag = 1;
|
alarm_flag = 1;
|
||||||
app = APP_RTC_TASK;
|
app = APP_RTC_TASK;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif//TCFG_APP_RTC_EN
|
#endif // TCFG_APP_RTC_EN
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* printf("unknow SYS_DEVICE_EVENT!!, %x\n", (u32)event->arg); */
|
/* printf("unknow SYS_DEVICE_EVENT!!, %x\n", (u32)event->arg); */
|
||||||
@ -401,19 +439,22 @@ static void app_common_device_event_handler(struct sys_event *event)
|
|||||||
smartbox_update_dev_state((u32)event->arg);
|
smartbox_update_dev_state((u32)event->arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (app != 0xff) {
|
if (app != 0xff)
|
||||||
if ((true != app_check_curr_task(APP_PC_TASK)) || alarm_flag) {
|
{
|
||||||
|
if ((true != app_check_curr_task(APP_PC_TASK)) || alarm_flag)
|
||||||
|
{
|
||||||
|
|
||||||
//PC 不响应因为设备上线引发的模式切换
|
// PC 不响应因为设备上线引发的模式切换
|
||||||
#if TWFG_APP_POWERON_IGNORE_DEV
|
#if TWFG_APP_POWERON_IGNORE_DEV
|
||||||
if ((timer_get_ms() - app_var.start_time) > TWFG_APP_POWERON_IGNORE_DEV)
|
if ((timer_get_ms() - app_var.start_time) > TWFG_APP_POWERON_IGNORE_DEV)
|
||||||
#endif//TWFG_APP_POWERON_IGNORE_DEV
|
#endif // TWFG_APP_POWERON_IGNORE_DEV
|
||||||
{
|
{
|
||||||
#if (TCFG_CHARGE_ENABLE && (!TCFG_CHARGE_POWERON_ENABLE))
|
#if (TCFG_CHARGE_ENABLE && (!TCFG_CHARGE_POWERON_ENABLE))
|
||||||
extern u8 get_charge_online_flag(void);
|
extern u8 get_charge_online_flag(void);
|
||||||
if (get_charge_online_flag()) {
|
if (get_charge_online_flag())
|
||||||
|
{
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -425,13 +466,13 @@ static void app_common_device_event_handler(struct sys_event *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 公共事件处理, 各自模式没有处理的事件, 会统一在这里处理
|
||||||
///公共事件处理, 各自模式没有处理的事件, 会统一在这里处理
|
|
||||||
void app_default_event_deal(struct sys_event *event)
|
void app_default_event_deal(struct sys_event *event)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
SYS_EVENT_HANDLER_SPECIFIC(event);
|
SYS_EVENT_HANDLER_SPECIFIC(event);
|
||||||
switch (event->type) {
|
switch (event->type)
|
||||||
|
{
|
||||||
case SYS_DEVICE_EVENT:
|
case SYS_DEVICE_EVENT:
|
||||||
/*默认公共设备事件处理*/
|
/*默认公共设备事件处理*/
|
||||||
/* printf(">>>>>>>>>>>>>%s %d \n", __FUNCTION__, __LINE__); */
|
/* printf(">>>>>>>>>>>>>%s %d \n", __FUNCTION__, __LINE__); */
|
||||||
@ -439,7 +480,8 @@ void app_default_event_deal(struct sys_event *event)
|
|||||||
break;
|
break;
|
||||||
#if TCFG_APP_BT_EN
|
#if TCFG_APP_BT_EN
|
||||||
case SYS_BT_EVENT:
|
case SYS_BT_EVENT:
|
||||||
if (true != app_check_curr_task(APP_BT_TASK)) {
|
if (true != app_check_curr_task(APP_BT_TASK))
|
||||||
|
{
|
||||||
/*默认公共BT事件处理*/
|
/*默认公共BT事件处理*/
|
||||||
bt_background_event_handler(event);
|
bt_background_event_handler(event);
|
||||||
}
|
}
|
||||||
@ -454,7 +496,6 @@ void app_default_event_deal(struct sys_event *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
extern int key_event_remap(struct sys_event *e);
|
extern int key_event_remap(struct sys_event *e);
|
||||||
extern const u16 bt_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX];
|
extern const u16 bt_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX];
|
||||||
@ -498,4 +539,3 @@ u8 app_common_key_var_2_event(u32 key_var)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -348,7 +348,8 @@ void app_pc_task()
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
int msg[32];
|
int msg[32];
|
||||||
tone_play_with_callback_by_name(tone_table[IDEX_TONE_PC], 1, pc_tone_play_end_callback, (void *)IDEX_TONE_PC);
|
//tone_play_with_callback_by_name(tone_table[IDEX_TONE_PC], 1, pc_tone_play_end_callback, (void *)IDEX_TONE_PC);
|
||||||
|
pc_task_start();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
app_task_get_msg(msg, ARRAY_SIZE(msg), 1);
|
app_task_get_msg(msg, ARRAY_SIZE(msg), 1);
|
||||||
|
@ -68,9 +68,9 @@ static int power_on_init(void)
|
|||||||
#if TCFG_USB_APPLE_DOCK_EN //苹果iap协议使用pc模式
|
#if TCFG_USB_APPLE_DOCK_EN //苹果iap协议使用pc模式
|
||||||
app_task_switch_to(APP_PC_TASK);
|
app_task_switch_to(APP_PC_TASK);
|
||||||
#else
|
#else
|
||||||
/* app_task_switch_to(APP_MUSIC_TASK); */
|
app_task_switch_to(APP_MUSIC_TASK); /** /
|
||||||
/* app_task_switch_to(APP_IDLE_TASK); */
|
/* app_task_switch_to(APP_IDLE_TASK); */
|
||||||
app_task_switch_to(APP_LINEIN_TASK);//如果带检测,设备不在线,则不跳转
|
//app_task_switch_to(APP_LINEIN_TASK);//如果带检测,设备不在线,则不跳转
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -130,6 +130,8 @@ void app_poweron_task()
|
|||||||
|
|
||||||
UI_SHOW_MENU(MENU_POWER_UP, 0, 0, NULL);
|
UI_SHOW_MENU(MENU_POWER_UP, 0, 0, NULL);
|
||||||
|
|
||||||
|
kt_init();
|
||||||
|
|
||||||
int err = tone_play_with_callback_by_name(tone_table[IDEX_TONE_POWER_ON], 1, tone_play_end_callback, (void *)IDEX_TONE_POWER_ON);
|
int err = tone_play_with_callback_by_name(tone_table[IDEX_TONE_POWER_ON], 1, tone_play_end_callback, (void *)IDEX_TONE_POWER_ON);
|
||||||
/* if (err) { //提示音没有,播放失败,直接init流程 */
|
/* if (err) { //提示音没有,播放失败,直接init流程 */
|
||||||
/* power_on_init(); */
|
/* power_on_init(); */
|
||||||
|
@ -4,6 +4,12 @@ fat_sdfile_fat_ops
|
|||||||
|
|
||||||
|
|
||||||
sdfile_vfs_ops
|
sdfile_vfs_ops
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
nor_fs_vfs_ops
|
||||||
|
nor_sdfile_vfs_ops
|
||||||
|
nor_rec_fs_vfs_ops
|
||||||
pcm_decoder
|
pcm_decoder
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
#define SPI0_ENABLE 0 //是否使能SPI0,使能后需定义spi0_p_data
|
#define SPI0_ENABLE 0 //是否使能SPI0,使能后需定义spi0_p_data
|
||||||
#define SPI1_ENABLE 1 //是否使能SPI1,使能后需定义spi1_p_data
|
#define SPI1_ENABLE 1 //是否使能SPI1,使能后需定义spi1_p_data
|
||||||
#define SPI2_ENABLE 1 //是否使能SPI2,使能后需定义spi2_p_data
|
#define SPI2_ENABLE 0 //是否使能SPI2,使能后需定义spi2_p_data
|
||||||
|
|
||||||
|
|
||||||
static const struct spi_io_mapping spi_io_map[SPI_MAX_HW_NUM] = {
|
static const struct spi_io_mapping spi_io_map[SPI_MAX_HW_NUM] = {
|
||||||
|
1
cpu/br25/tools/aec.bin
Normal file
1
cpu/br25/tools/aec.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/aeco.bin
Normal file
1
cpu/br25/tools/aeco.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/amr.bin
Normal file
1
cpu/br25/tools/amr.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/amro.bin
Normal file
1
cpu/br25/tools/amro.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/ape.bin
Normal file
1
cpu/br25/tools/ape.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/apeo.bin
Normal file
1
cpu/br25/tools/apeo.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
BIN
cpu/br25/tools/app.bin
Normal file
BIN
cpu/br25/tools/app.bin
Normal file
Binary file not shown.
BIN
cpu/br25/tools/data.bin
Normal file
BIN
cpu/br25/tools/data.bin
Normal file
Binary file not shown.
BIN
cpu/br25/tools/data_code.bin
Normal file
BIN
cpu/br25/tools/data_code.bin
Normal file
Binary file not shown.
1
cpu/br25/tools/dts.bin
Normal file
1
cpu/br25/tools/dts.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/dtso.bin
Normal file
1
cpu/br25/tools/dtso.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/flac.bin
Normal file
1
cpu/br25/tools/flac.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/flaco.bin
Normal file
1
cpu/br25/tools/flaco.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/fm.bin
Normal file
1
cpu/br25/tools/fm.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/fmo.bin
Normal file
1
cpu/br25/tools/fmo.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/m4a.bin
Normal file
1
cpu/br25/tools/m4a.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1
cpu/br25/tools/m4ao.bin
Normal file
1
cpu/br25/tools/m4ao.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
0
cpu/br25/tools/mp3.bin
Normal file
0
cpu/br25/tools/mp3.bin
Normal file
BIN
cpu/br25/tools/mp3o.bin
Normal file
BIN
cpu/br25/tools/mp3o.bin
Normal file
Binary file not shown.
1
cpu/br25/tools/sdk.elf.objs.txt
Normal file
1
cpu/br25/tools/sdk.elf.objs.txt
Normal file
File diff suppressed because one or more lines are too long
8324
cpu/br25/tools/sdk.elf.resolution.txt
Normal file
8324
cpu/br25/tools/sdk.elf.resolution.txt
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
44b10a8a9a97a7ea8795ce48fe8bb180954fc20c5763ded5954fc20c5763ded5399f4f1d
|
BIN
cpu/br25/tools/soundbox/standard_608n/app.bin
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/app.bin
Normal file
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard_608n/br25loader.bin
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/br25loader.bin
Normal file
Binary file not shown.
@ -2,18 +2,20 @@
|
|||||||
|
|
||||||
cd %~dp0
|
cd %~dp0
|
||||||
|
|
||||||
@rem 注意这里使用的lrc的uboot 与ota.bin
|
@rem ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD>lrc<EFBFBD><EFBFBD>uboot <20><>ota.bin
|
||||||
copy ..\..\script.ver .
|
copy ..\..\script.ver .
|
||||||
copy ..\..\uboot_lrc.boot uboot.boot
|
copy ..\..\uboot_lrc.boot uboot.boot
|
||||||
copy ..\..\ota_lrc.bin ota.bin
|
copy ..\..\ota_lrc.bin ota.bin
|
||||||
|
|
||||||
..\..\isd_download.exe -tonorflash -dev br25 -boot 0x12000 -div8 -wait 300 -uboot uboot.boot -app app.bin cfg_tool.bin -res tone.cfg -uboot_compress
|
::..\..\isd_download.exe -tonorflash -dev br25 -boot 0x12000 -div8 -wait 300 -uboot uboot.boot -app app.bin cfg_tool.bin -res tone.cfg -uboot_compress
|
||||||
|
|
||||||
|
..\..\isd_download.exe -tonorflash -dev br25 -boot 0x12000 -div8 -wait 300 -uboot uboot.boot -app app.bin cfg_tool.bin -res tone.cfg -uboot_compress -key KTS-AC69xx_5458.key
|
||||||
:: -format all
|
:: -format all
|
||||||
::-reboot 2500
|
::-reboot 2500
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@rem 删除临时文件-format all
|
@rem ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ļ<EFBFBD>-format all
|
||||||
if exist *.mp3 del *.mp3
|
if exist *.mp3 del *.mp3
|
||||||
if exist *.PIX del *.PIX
|
if exist *.PIX del *.PIX
|
||||||
if exist *.TAB del *.TAB
|
if exist *.TAB del *.TAB
|
||||||
@ -22,9 +24,9 @@ if exist *.sty del *.sty
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@rem 生成固件升级文件
|
@rem <EFBFBD><EFBFBD><EFBFBD>ɹ̼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||||
..\..\fw_add.exe -noenc -fw jl_isd.fw -add ota.bin -type 100 -out jl_isd.fw
|
..\..\fw_add.exe -noenc -fw jl_isd.fw -add ota.bin -type 100 -out jl_isd.fw
|
||||||
@rem 添加配置脚本的版本信息到 FW 文件中
|
@rem <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ýű<EFBFBD><EFBFBD>İ汾<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> FW <20>ļ<EFBFBD><C4BC><EFBFBD>
|
||||||
..\..\fw_add.exe -noenc -fw jl_isd.fw -add script.ver -out jl_isd.fw
|
..\..\fw_add.exe -noenc -fw jl_isd.fw -add script.ver -out jl_isd.fw
|
||||||
|
|
||||||
|
|
||||||
@ -33,16 +35,16 @@ copy jl_isd.ufw update.ufw
|
|||||||
del jl_isd.ufw
|
del jl_isd.ufw
|
||||||
|
|
||||||
|
|
||||||
@REM 生成配置文件升级文件
|
@REM <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||||
::ufw_maker.exe -chip AC800X %ADD_KEY% -output config.ufw -res bt_cfg.cfg
|
::ufw_maker.exe -chip AC800X %ADD_KEY% -output config.ufw -res bt_cfg.cfg
|
||||||
|
|
||||||
::IF EXIST jl_696x.bin del jl_696x.bin
|
::IF EXIST jl_696x.bin del jl_696x.bin
|
||||||
|
|
||||||
|
|
||||||
@rem 常用命令说明
|
@rem <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>
|
||||||
@rem -format vm //擦除VM 区域
|
@rem -format vm //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>VM <20><><EFBFBD><EFBFBD>
|
||||||
@rem -format cfg //擦除BT CFG 区域
|
@rem -format cfg //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>BT CFG <20><><EFBFBD><EFBFBD>
|
||||||
@rem -format 0x3f0-2 //表示从第 0x3f0 个 sector 开始连续擦除 2 个 sector(第一个参数为16进制或10进制都可,第二个参数必须是10进制)
|
@rem -format 0x3f0-2 //<EFBFBD><EFBFBD>ʾ<EFBFBD>ӵ<EFBFBD> 0x3f0 <20><> sector <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2 <20><> sector(<28><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ16<31><36><EFBFBD>ƻ<EFBFBD>10<31><30><EFBFBD>ƶ<EFBFBD><C6B6>ɣ<EFBFBD><C9A3>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>10<31><30><EFBFBD><EFBFBD>)
|
||||||
|
|
||||||
ping /n 2 127.1>null
|
ping /n 2 127.1>null
|
||||||
IF EXIST null del null
|
IF EXIST null del null
|
||||||
|
BIN
cpu/br25/tools/soundbox/standard_608n/jl_isd.bin
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/jl_isd.bin
Normal file
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard_608n/jl_isd.fw
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/jl_isd.fw
Normal file
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard_608n/ota.bin
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/ota.bin
Normal file
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard_608n/pwr_on.wav
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/pwr_on.wav
Normal file
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard_608n/pwr_on.wtg
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/pwr_on.wtg
Normal file
Binary file not shown.
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard_608n/uboot.boot
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/uboot.boot
Normal file
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard_608n/update.ufw
Normal file
BIN
cpu/br25/tools/soundbox/standard_608n/update.ufw
Normal file
Binary file not shown.
30552
cpu/br25/tools/symbol_tbl.txt
Normal file
30552
cpu/br25/tools/symbol_tbl.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
cpu/br25/tools/text.bin
Normal file
BIN
cpu/br25/tools/text.bin
Normal file
Binary file not shown.
1
cpu/br25/tools/wav.bin
Normal file
1
cpu/br25/tools/wav.bin
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
BIN
cpu/br25/tools/wavo.bin
Normal file
BIN
cpu/br25/tools/wavo.bin
Normal file
Binary file not shown.
0
cpu/br25/tools/wmao.bin
Normal file
0
cpu/br25/tools/wmao.bin
Normal file
Loading…
Reference in New Issue
Block a user