Mozzi  version v2.0
sound synthesis library for Arduino
config_checks_template.h
1 
12 /*
13  * config_checks_template.h
14  *
15  * This file is part of Mozzi.
16  *
17  * Copyright 2023-2024 Thomas Friedrichsmeier and the Mozzi Team
18  * NOTE: In your port, don't forget to update the above copyright notice!
19  *
20  * Mozzi is licensed under the GNU Lesser General Public Licence (LGPL) Version 2.1 or later.
21  *
22 */
23 
25 #include "disable_2pinmode_on_github_workflow.h"
27 #if not defined(MOZZI_AUDIO_MODE)
28 # define MOZZI_AUDIO_MODE MOZZI_OUTPUT_PWM
29 #endif
32 MOZZI_CHECK_SUPPORTED(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PWM, MOZZI_OUTPUT_EXTERNAL_TIMED, MOZZI_OUTPUT_EXTERNAL_CUSTOM)
33 
34 
35 #if not defined(MOZZI_AUDIO_RATE)
36 # define MOZZI_AUDIO_RATE 32768
37 #endif
38 
40 #if not defined(MOZZI_ANALOG_READ)
41 # define MOZZI_ANALOG_READ MOZZI_ANALOG_READ_STANDARD
42 #endif
44 // MOZZI_CHECK_SUPPORTED(MOZZI_ANALOG_READ, MOZZI_ANALOG_READ)
45 
68 #define MOZZI__INTERNAL_ANALOG_READ_RESOLUTION 10
69 
71 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_INTERNAL_DAC)
72 # if !defined(MOZZI_AUDIO_PIN_1)
73 # define MOZZI_AUDIO_PIN_1 5
74 # endif
76 # if !defined(MOZZI_AUDIO_BITS)
77 # define MOZZI_AUDIO_BITS 10
78 # endif
80 # include "disable_stereo_on_github_workflow.h" // This allows stereo sketches to compile (in mono) in automated testing builds.
81 MOZZI_CHECK_SUPPORTED(MOZZI_AUDIO_CHANNELS, MOZZI_MONO)
82 #endif
83 
84 
92 /* @ingroup hardware
93  * @page hardware_MYPORT Mozzi on MYPORT architecture based boards (e.g. MOST PROMINENT BOARD)
94  *
95  * Port added by YOUR_NAME.
96  *
97  * @section MYPORT_status Status of this port and usage notes
98  * This port has been tested on BOARD A, BOARD B, but is expected to work on other boards using this family of MCUs, too.
99  * The default MOZZI_AUDIO_RATE is set to 32678 Hz. Asynchronous analog reads are not yet implemented, so be careful
100  * not to use mozziAnalogRead() too much. Also @ref MOZZI_AUDIO_INPUT is not available.
101  *
102  * When connecting external circuitry, keep in mind that the GPIO pins on this CPU are rated at a max of 3 mA. Be careful
103  * not to over-stress them. It is further recommended not to make use of feature X when using Mozzi, as it will
104  * introduce considerable noise into the audio.
105  *
106  * Also, something else to keep in mind about this port.
107  *
108  * @section MYPORT_output_modes Output modes
109  * The following audio modes (see @ref MOZZI_AUDIO_MODE) are currently supported on this hardware:
110  * - MOZZI_OUTPUT_EXTERNAL_TIMED
111  * - MOZZI_OUTPUT_EXTERNAL_CUSTOM
112  * - MOZZI_OUTPUT_INTERNAL_DAC
113  *
114  * The default mode is @ref MYPORT_internal_dac , meaning, only boards with an inbuilt DAC are covered by default
115  * (you could stil use one of the external output modes, however).
116  *
117  * @section MYPORT_internal_dac MOZZI_OUTPUT_INTERNAL_DAC
118  * Output resolution is 10 bits by default, and goes to pin DAC0. Hardware timer 1 is claimed by Mozzi.
119  * Only mono output is supported. Within the hardware limits of your board, you can configure the following:
120  *
121  * @code
122  * #define MOZZI_AUDIO_PIN_1 ... // default is DAC0
123  * #define MOZZI_AUDIO_BITS ... // default is 10
124  * @endcode
125  *
126  * @section MYPORT_external MOZZI_OUTPUT_EXTERNAL_TIMED and MOZZI_OUTPUT_EXTERNAL_CUSTOM
127  * See @ref external_audio
128 */
#define MOZZI_AUDIO_CHANNELS
This sets allows to change from a single/mono audio output channel to stereo output.
#define MOZZI_AUDIO_MODE
Configure how Mozzi outputs generated sounds.