Skip to content

Commit

Permalink
Add some configuration examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tfry-git committed Nov 19, 2023
1 parent 5b946e0 commit 8628532
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 0 deletions.
19 changes: 19 additions & 0 deletions config/config_example_avr_hifi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Configuration example
This example is targetted at the AVR platform (Arduino Uno & friends), only!
Set configuration options according to the mode that was formerly known as "HIFI".
Do read up on the required hardware circuitry! */

#include "MozziConfigValues.h" // for named option values

#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_2PIN_PWM
//#define MOZZI_AUDIO_RATE 32768 // the default, in this mode
//#define MOZZI_PWM_RATE 125000 // the default, in this mode
//#define MOZZI_AUDIO_BITS_PER_CHANNEL 2 // the default, in this mode

// should you wish to customize the output pins:
//#define AUDIO_AUDIO_PIN_1 TIMER1_A_PIN
//#define MOZZI_AUDIO_PIN_1_REGISTER OCR1A // must also specify the hardware register responsible for this pin
//#define AUDIO_AUDIO_PIN_1_LOW TIMER1_B_PIN
//#define MOZZI_AUDIO_PIN_1_LOW_REGISTER OCR1B // must also specify the hardware register responsible for this pin
15 changes: 15 additions & 0 deletions config/config_example_avr_legacy_standard_mode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* Configuration example
This example is targetted at the AVR platform (Arduino Uno & friends), only!
Set configuration options according to the mode that was formerly known as "STANDARD" (not STANDARD_PLUS). */

#include "MozziConfigValues.h" // for named option values

#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_MODE_PWM
#define MOZZI_AUDIO_RATE 16384
#define MOZZI_PWM_RATE 16384

// should you wish to customize the output pin:
//#define AUDIO_AUDIO_PIN_1 TIMER1_A_PIN
//#define MOZZI_AUDIO_PIN_1_REGISTER OCR1A // must also specify the hardware register responsible for this pin
18 changes: 18 additions & 0 deletions config/config_example_avr_legacy_standardplus_mode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Configuration example
This example is targetted at the AVR platform (Arduino Uno & friends), only!
The configuration formerly known as STANDARD_PLUS is still the default on AVR, so you
do not need to configure anything! This file just lists the relevant settings involved: */

#include "MozziConfigValues.h" // for named option values

// all of these are the defaults on AVR, anyway, thus commented
//#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_MODE_PWM
//#define MOZZI_AUDIO_RATE 32768
//#define MOZZI_PWM_RATE 16384


// should you wish to customize the output pin:
//#define AUDIO_AUDIO_PIN_1 TIMER1_A_PIN
//#define MOZZI_AUDIO_PIN_1_REGISTER OCR1A // must also specify the hardware register responsible for this pin
15 changes: 15 additions & 0 deletions config/config_example_avr_stereo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* Configuration example
This example is targetted at the AVR platform (Arduino Uno & friends), only!
This example shows setting up stereo mode on AVR. */

#include "MozziConfigValues.h" // for named option values

#define MOZZI_AUDIO_CHANNELS MOZZI_STEREO

// should you wish to customize the output pins:
//#define AUDIO_AUDIO_PIN_1 TIMER1_A_PIN
//#define MOZZI_AUDIO_PIN_1_REGISTER OCR1A // must also specify the hardware register responsible for this pin
//#define AUDIO_AUDIO_PIN_2 TIMER1_B_PIN
//#define MOZZI_AUDIO_PIN_2_REGISTER OCR1B // must also specify the hardware register responsible for this pin
15 changes: 15 additions & 0 deletions config/config_example_external.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* Configuration example
Configure Mozzi for "external" audio output. You will need to provide an audioOutput() function in your sketch.
See TODO: link to relevant tutorial
*/

#include "MozziConfigValues.h" // for named option values

#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_EXTERNAL_TIMED
// or use this:
//#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_EXTERNAL_CUSTOM

//#define MOZZI_AUDIO_RATE 32768 // the default, in this mode
//#define AUDIO_BITS 16 // the default in this mode, but e.g. when connecting to a 24-bit DAC, you'd set 24, here.
File renamed without changes.

0 comments on commit 8628532

Please sign in to comment.