Skip to content

Commit 90e86b0

Browse files
committed
first commit
0 parents  commit 90e86b0

File tree

249 files changed

+30644
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+30644
-0
lines changed

.vscode/settings.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"files.associations": {
3+
"displaysettings": "c",
4+
"glextensions": "c",
5+
"graphicscontext": "c",
6+
"types": "cpp",
7+
"*.tcc": "cpp",
8+
"complex": "cpp",
9+
"list": "cpp",
10+
"functional": "cpp",
11+
"limits": "cpp",
12+
"random": "cpp",
13+
"bit": "cpp",
14+
"chrono": "cpp",
15+
"ratio": "cpp",
16+
"thread": "cpp",
17+
"version": "cpp",
18+
"boundingbox": "cpp",
19+
"image": "cpp",
20+
"node": "cpp",
21+
"state": "cpp"
22+
}
23+
}

Doxyfile

+2,618
Large diffs are not rendered by default.

README.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Arduino AudioKit HAL
2+
3+
There are different ESP32 AudioKit boards available that can be programmed with the Espressif ADF Framework.
4+
5+
<img src="https://pschatzmann.github.io/arduino-audio-tools/resources/audio-toolkit.png" alt="Audio Kit" />
6+
7+
The ADF Framework contains an abstractioin layer to support different CODEC chips. Unfortunately ADF can not be used in Arduino, but it would be quite useful to have this functionality also available.
8+
9+
I converted the __audio_boards__ and their related __drivers__ into an __Arduino Library__ and provide an easy to use C++ class which configures both the CODEC and I2S. With this project it should get quite easy to use these boards also in Arduino.
10+
11+
## Configuration
12+
13+
You can define your board and the default settings in the ```AudioKitSettings.h``` file.
14+
15+
```
16+
* @brief AUDIOKIT_BOARD selects a specic board:
17+
* 1) lyrat_v4_3
18+
* 2) lyrat_v4_2
19+
* 3) lyrat_mini_v1_1
20+
* 4) lyratd_msc_v2_2
21+
* 5) lyratd_msc_v2_1
22+
* 6) ai_thinker_v2_2
23+
* 7) esp32_s2_kaluga_1_v1_2
24+
*/
25+
26+
#define AUDIOKIT_BOARD 1
27+
28+
```
29+
Here the lyrat v3.4 has been selected. Alternatively you can specify the board in a sketch with a #define before the #includes as shown in the next example.
30+
31+
32+
## Example Sketch
33+
34+
Here is an example sketch that writes audio data to the audio kit board via I2S. By default I2S is set up as master, the CODEC as slave, the sample size is 16 bits and the sample rate is 44.1k/sec if you did not change the default settings.
35+
36+
You can adjust these parameters by setting your requested values in the cfg below:
37+
38+
```
39+
#define AUDIOKIT_BOARD 7
40+
41+
#include "AudioKit.h"
42+
#include "SineWaveGenerator.h"
43+
44+
AudioKit kit;
45+
SineWaveGenerator wave;
46+
const int BUFFER_SIZE = 1024;
47+
uint8_t buffer[BUFFER_SIZE];
48+
49+
void setup() {
50+
// open in write mode
51+
auto cfg = kit.defaultConfig(true);
52+
cfg.sample_rate = AUDIO_HAL_22K_SAMPLES;
53+
kit.begin(cfg);
54+
55+
// 1000 hz
56+
wave.setFrequency(1000);
57+
wave.setSampleRate(cfg.sampleRate());
58+
}
59+
60+
void loop() {
61+
size_t l = wave.read(buffer, BUFFER_SIZE);
62+
kit.write(buffer, l);
63+
}
64+
65+
```
66+
67+
## Status
68+
69+
Early Development
70+
71+
72+

docs/html/_audio_kit_8h_source.html

+520
Large diffs are not rendered by default.

docs/html/_audio_kit_codec_8h_source.html

+225
Large diffs are not rendered by default.

docs/html/_audio_kit_config_8h_source.html

+220
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5+
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6+
<meta name="generator" content="Doxygen 1.9.1"/>
7+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
8+
<title>Arduino AudioKit HAL: src/AudioKitSettings.h Source File</title>
9+
<link href="tabs.css" rel="stylesheet" type="text/css"/>
10+
<script type="text/javascript" src="jquery.js"></script>
11+
<script type="text/javascript" src="dynsections.js"></script>
12+
<link href="search/search.css" rel="stylesheet" type="text/css"/>
13+
<script type="text/javascript" src="search/searchdata.js"></script>
14+
<script type="text/javascript" src="search/search.js"></script>
15+
<link href="doxygen.css" rel="stylesheet" type="text/css" />
16+
</head>
17+
<body>
18+
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
19+
<div id="titlearea">
20+
<table cellspacing="0" cellpadding="0">
21+
<tbody>
22+
<tr style="height: 56px;">
23+
<td id="projectalign" style="padding-left: 0.5em;">
24+
<div id="projectname">Arduino AudioKit HAL
25+
</div>
26+
</td>
27+
</tr>
28+
</tbody>
29+
</table>
30+
</div>
31+
<!-- end header part -->
32+
<!-- Generated by Doxygen 1.9.1 -->
33+
<script type="text/javascript">
34+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
35+
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
36+
/* @license-end */
37+
</script>
38+
<script type="text/javascript" src="menudata.js"></script>
39+
<script type="text/javascript" src="menu.js"></script>
40+
<script type="text/javascript">
41+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
42+
$(function() {
43+
initMenu('',true,false,'search.php','Search');
44+
$(document).ready(function() { init_search(); });
45+
});
46+
/* @license-end */</script>
47+
<div id="main-nav"></div>
48+
<!-- window showing the filter options -->
49+
<div id="MSearchSelectWindow"
50+
onmouseover="return searchBox.OnSearchSelectShow()"
51+
onmouseout="return searchBox.OnSearchSelectHide()"
52+
onkeydown="return searchBox.OnSearchSelectKey(event)">
53+
</div>
54+
55+
<!-- iframe showing the search results (closed by default) -->
56+
<div id="MSearchResultsWindow">
57+
<iframe src="javascript:void(0)" frameborder="0"
58+
name="MSearchResults" id="MSearchResults">
59+
</iframe>
60+
</div>
61+
62+
<div id="nav-path" class="navpath">
63+
<ul>
64+
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
65+
</div>
66+
</div><!-- top -->
67+
<div class="header">
68+
<div class="headertitle">
69+
<div class="title">AudioKitSettings.h</div> </div>
70+
</div><!--header-->
71+
<div class="contents">
72+
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="preprocessor">#pragma once</span></div>
73+
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"></span> </div>
74+
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">/**</span></div>
75+
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * @brief AUDIOKIT_BOARD selects a specic board:</span></div>
76+
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * 1) lyrat_v4_3</span></div>
77+
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * 2) lyrat_v4_2</span></div>
78+
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * 3) lyrat_mini_v1_1</span></div>
79+
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * 4) lyratd_msc_v2_2</span></div>
80+
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * 5) lyratd_msc_v2_1</span></div>
81+
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * 6) ai_thinker_v2_2</span></div>
82+
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * 7) esp32_s2_kaluga_1_v1_2</span></div>
83+
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> */</span></div>
84+
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160; </div>
85+
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="preprocessor">#ifndef AUDIOKIT_BOARD</span></div>
86+
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#define AUDIOKIT_BOARD 1</span></div>
87+
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="preprocessor">#endif</span></div>
88+
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; </div>
89+
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#define AUDIOKIT_DEFAULT_INPUT AUDIO_HAL_ADC_INPUT_LINE1</span></div>
90+
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#define AUDIOKIT_DEFAULT_OUTPUT AUDIO_HAL_DAC_OUTPUT_ALL</span></div>
91+
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define AUDIOKIT_DEFAULT_MASTER_SLAVE AUDIO_HAL_MODE_SLAVE</span></div>
92+
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#define AUDIOKIT_DEFAULT_RATE AUDIO_HAL_44K_SAMPLES</span></div>
93+
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#define AUDIOKIT_DEFAULT_BITSIZE AUDIO_HAL_BIT_LENGTH_16BITS</span></div>
94+
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define AUDIOKIT_DEFAULT_I2S_FMT AUDIO_HAL_I2S_NORMAL</span></div>
95+
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; </div>
96+
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; </div>
97+
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; </div>
98+
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; </div>
99+
</div><!-- fragment --></div><!-- contents -->
100+
<!-- start footer part -->
101+
<hr class="footer"/><address class="footer"><small>
102+
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
103+
</small></address>
104+
</body>
105+
</html>

docs/html/annotated.html

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5+
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6+
<meta name="generator" content="Doxygen 1.9.1"/>
7+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
8+
<title>Arduino AudioKit HAL: Class List</title>
9+
<link href="tabs.css" rel="stylesheet" type="text/css"/>
10+
<script type="text/javascript" src="jquery.js"></script>
11+
<script type="text/javascript" src="dynsections.js"></script>
12+
<link href="search/search.css" rel="stylesheet" type="text/css"/>
13+
<script type="text/javascript" src="search/searchdata.js"></script>
14+
<script type="text/javascript" src="search/search.js"></script>
15+
<link href="doxygen.css" rel="stylesheet" type="text/css" />
16+
</head>
17+
<body>
18+
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
19+
<div id="titlearea">
20+
<table cellspacing="0" cellpadding="0">
21+
<tbody>
22+
<tr style="height: 56px;">
23+
<td id="projectalign" style="padding-left: 0.5em;">
24+
<div id="projectname">Arduino AudioKit HAL
25+
</div>
26+
</td>
27+
</tr>
28+
</tbody>
29+
</table>
30+
</div>
31+
<!-- end header part -->
32+
<!-- Generated by Doxygen 1.9.1 -->
33+
<script type="text/javascript">
34+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
35+
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
36+
/* @license-end */
37+
</script>
38+
<script type="text/javascript" src="menudata.js"></script>
39+
<script type="text/javascript" src="menu.js"></script>
40+
<script type="text/javascript">
41+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
42+
$(function() {
43+
initMenu('',true,false,'search.php','Search');
44+
$(document).ready(function() { init_search(); });
45+
});
46+
/* @license-end */</script>
47+
<div id="main-nav"></div>
48+
</div><!-- top -->
49+
<!-- window showing the filter options -->
50+
<div id="MSearchSelectWindow"
51+
onmouseover="return searchBox.OnSearchSelectShow()"
52+
onmouseout="return searchBox.OnSearchSelectHide()"
53+
onkeydown="return searchBox.OnSearchSelectKey(event)">
54+
</div>
55+
56+
<!-- iframe showing the search results (closed by default) -->
57+
<div id="MSearchResultsWindow">
58+
<iframe src="javascript:void(0)" frameborder="0"
59+
name="MSearchResults" id="MSearchResults">
60+
</iframe>
61+
</div>
62+
63+
<div class="header">
64+
<div class="headertitle">
65+
<div class="title">Class List</div> </div>
66+
</div><!--header-->
67+
<div class="contents">
68+
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
69+
<table class="directory">
70+
<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structaudio__hal.html" target="_self">audio_hal</a></td><td class="desc">Configuration of functions and variables used to operate audio codec chip </td></tr>
71+
<tr id="row_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="audio__hal_8h.html#structaudio__hal__codec__config__t" target="_self">audio_hal_codec_config_t</a></td><td class="desc">Configure media hal for initialization of audio codec chip </td></tr>
72+
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="audio__hal_8h.html#structaudio__hal__codec__i2s__iface__t" target="_self">audio_hal_codec_i2s_iface_t</a></td><td class="desc">I2s interface configuration for audio codec chip </td></tr>
73+
<tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_audio_kit.html" target="_self">AudioKit</a></td><td class="desc"><a class="el" href="class_audio_kit.html" title="AudioKit API using the audio_hal.">AudioKit</a> API using the <a class="el" href="structaudio__hal.html" title="Configuration of functions and variables used to operate audio codec chip.">audio_hal</a> </td></tr>
74+
<tr id="row_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_audio_kit_config.html" target="_self">AudioKitConfig</a></td><td class="desc">Configuation for <a class="el" href="class_audio_kit.html" title="AudioKit API using the audio_hal.">AudioKit</a> </td></tr>
75+
<tr id="row_5_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structes__i2s__clock__t.html" target="_self">es_i2s_clock_t</a></td><td class="desc">Configure ES8388 clock </td></tr>
76+
<tr id="row_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structperiph__led__cfg__t.html" target="_self">periph_led_cfg_t</a></td><td class="desc">The LED peripheral configuration </td></tr>
77+
</table>
78+
</div><!-- directory -->
79+
</div><!-- contents -->
80+
<!-- start footer part -->
81+
<hr class="footer"/><address class="footer"><small>
82+
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
83+
</small></address>
84+
</body>
85+
</html>

0 commit comments

Comments
 (0)