Skip to content

Commit 64d9b9b

Browse files
committed
README
1 parent f603c93 commit 64d9b9b

File tree

11 files changed

+45
-89
lines changed

11 files changed

+45
-89
lines changed

README.md

Lines changed: 3 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -16,100 +16,14 @@ Supported audio codec chips are e.g
1616
- ES7243
1717
- etc
1818

19-
While you can use this library stand alone, I recommend to use it together with my [AudioTools](https://github.com/pschatzmann/arduino-audio-tools) project which provides a nice integration with it's [I2SCodecStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_i2_s_codec_stream.html) class.
19+
While you can use this library stand alone, I recommend to use it together with my [AudioTools](https://github.com/pschatzmann/arduino-audio-tools) project which provides a nice integration with it's [I2SCodecStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_i2_s_codec_stream.html) class. Further information can be found in the [Wiki](https://github.com/pschatzmann/arduino-audio-driver/wiki).
2020

21-
## AudioTools
2221

23-
```C++
24-
25-
#include "AudioTools.h"
26-
#include "AudioLibs/I2SCodecStream.h"
27-
28-
I2SCodecStream i2s(LyratV43);
29-
30-
void setup() {
31-
// setup i2s and codec
32-
auto cfg = i2s.defaultConfig();
33-
cfg.sample_rate = 44100;
34-
cfg.bits_per_sample = 16;
35-
cfg.channels = 1;
36-
i2s.begin();
37-
// set volume
38-
i2s.setVolume(0.5);
39-
}
40-
41-
```
42-
You can use the [I2SCodecStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_i2_s_codec_stream.html) like the I2SStream but it provides some additional functionality, like setting the volume via the codec. In the __constructor__ you need to provide an __audio board__ object.
43-
44-
45-
## Stand-Alone: Predefined Boards
46-
47-
A board definition consists of a driver class and pin definitions for that specific board. You can easily use the predefined boards. E.g. the following code is setting up and starting the codec on a Lyrat board:
48-
49-
```C++
50-
51-
#include "AudioBoard.h"
52-
53-
void setup() {
54-
CodecConfig cfg;
55-
cfg.adc_input = ADC_INPUT_LINE1;
56-
cfg.dac_output = DAC_OUTPUT_ALL;
57-
cfg.i2s.bits = BIT_LENGTH_16BITS;
58-
cfg.i2s.rate = RATE_44K;
59-
//cfg.i2s.fmt = I2S_NORMAL;
60-
//cfg.i2s.mode = MODE_SLAVE;
61-
LyratV43.begin(cfg);
62-
63-
}
64-
65-
```
66-
67-
Check the documentation for all available boards.
68-
69-
70-
## Stand-Alone: Custom Boards
71-
72-
You can also easily define your custom boards by defining the __driver__ and your __specifc pins__
73-
74-
```C++
75-
76-
#include "AudioBoard.h"
77-
78-
DriverPins my_pins;
79-
AudioBoard board(&AudioDriverES8388, my_pins);
80-
81-
void setup() {
82-
// add i2c codec pins: scl, sda, port
83-
my_pins.addI2C(CODEC, 32, 22, 0x20);
84-
// add i2s pins: mclk, bclk, ws, data_out, data_in
85-
my_pins.addI2S(CODEC, 0, 27, 26, 25, 35);
86-
// add other pins: PA on gpio 21
87-
my_pins.addPin(PA, 21);
88-
89-
// configure codec
90-
CodecConfig cfg;
91-
cfg.adc_input = ADC_INPUT_LINE1;
92-
cfg.dac_output = DAC_OUTPUT_ALL;
93-
cfg.i2s.bits = BIT_LENGTH_16BITS;
94-
cfg.i2s.rate = RATE_44K;
95-
//cfg.i2s.fmt = I2S_NORMAL;
96-
//cfg.i2s.mode = MODE_SLAVE;
97-
board.begin(cfg);
98-
}
99-
100-
```
101-
## Logging
102-
103-
The functionality has a built in logger. The default log level has been set to Warning. You can change it like this:
104-
105-
```C++
106-
107-
LOGLEVEL_AUDIODRIVER = AudioDriverDebug; // or AudiDriverInfo, AudioDriverWarning, AudioDriverError
108-
109-
```
11022
## Documentation
11123

24+
- [Wiki](https://github.com/pschatzmann/arduino-audio-driver/wiki)
11225
- [Classes and Objects](https://pschatzmann.github.io/arduino-audio-driver/html/group__audio__driver.html)
26+
- [Examples](https://github.com/pschatzmann/arduino-audio-driver/tree/main/examples)
11327

11428
## Support
11529

examples/audiotools-custom-max/audiotools-custom-max.ino renamed to examples/audiotools/audiotools-custom-max/audiotools-custom-max.ino

File renamed without changes.

examples/audiotools-custom-min/audiotools-custom-min.ino renamed to examples/audiotools/audiotools-custom-min/audiotools-custom-min.ino

File renamed without changes.
File renamed without changes.

examples/audiotools-standard/audiotools-standard.ino renamed to examples/audiotools/audiotools-standard/audiotools-standard.ino

File renamed without changes.
File renamed without changes.

src/AudioBoard.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ namespace audio_driver {
77
/**
88
* @brief Defitintion for audio board pins and an audio driver
99
* @ingroup audio_driver
10+
* @author Phil Schatzmann
11+
* @copyright GPLv3
1012
*/
1113
class AudioBoard {
1214
public:

src/Driver.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace audio_driver {
1313
/**
1414
* @brief I2S configuration and defition of input and output with default values
1515
* @ingroup audio_driver
16+
* @author Phil Schatzmann
17+
* @copyright GPLv3
1618
*/
1719
class CodecConfig : public codec_config_t {
1820
public:
@@ -58,6 +60,8 @@ class CodecConfig : public codec_config_t {
5860
/**
5961
* @brief Abstract Driver API for codec chips
6062
* @ingroup audio_driver
63+
* @author Phil Schatzmann
64+
* @copyright GPLv3
6165
*/
6266
class AudioDriver {
6367
public:
@@ -126,6 +130,8 @@ class AudioDriver {
126130

127131
/**
128132
* @brief Driver API for ES8388 codec chip
133+
* @author Phil Schatzmann
134+
* @copyright GPLv3
129135
*/
130136
class AudioDriverES8388Class : public AudioDriver {
131137
public:
@@ -174,6 +180,8 @@ class AudioDriverES8388Class : public AudioDriver {
174180

175181
/**
176182
* @brief Driver API for Lyrat ES8311 codec chip
183+
* @author Phil Schatzmann
184+
* @copyright GPLv3
177185
*/
178186
class AudioDriverES8311Class : public AudioDriver {
179187
public:
@@ -211,6 +219,8 @@ class AudioDriverES8311Class : public AudioDriver {
211219

212220
/**
213221
* @brief Driver API for Lyrat ES7243 codec chip
222+
* @author Phil Schatzmann
223+
* @copyright GPLv3
214224
*/
215225
class AudioDriverES7243Class : public AudioDriver {
216226
public:
@@ -246,6 +256,8 @@ class AudioDriverES7243Class : public AudioDriver {
246256

247257
/**
248258
* @brief Driver API for Lyrat Mini with a ES8311 and a ES7243 codec chip
259+
* @author Phil Schatzmann
260+
* @copyright GPLv3
249261
*/
250262
class AudioDriverLyratMiniClass : public AudioDriver {
251263
public:
@@ -277,6 +289,8 @@ class AudioDriverLyratMiniClass : public AudioDriver {
277289

278290
/**
279291
* @brief Driver API for AC101 codec chip
292+
* @author Phil Schatzmann
293+
* @copyright GPLv3
280294
*/
281295
class AudioDriverAC101Class : public AudioDriver {
282296
public:
@@ -309,6 +323,8 @@ class AudioDriverAC101Class : public AudioDriver {
309323

310324
/**
311325
* @brief Driver API for the CS43l22 codec chip
326+
* @author Phil Schatzmann
327+
* @copyright GPLv3
312328
*/
313329
class AudioDriverCS43l22Class : public AudioDriver {
314330
public:

0 commit comments

Comments
 (0)