Mozzi  version v2.0
sound synthesis library for Arduino
config_checks_samd21.h
1 /*
2  * config_checks_samd21.h
3  *
4  * This file is part of Mozzi.
5  *
6  * Copyright 2023-2024 Thomas Friedrichsmeier and the Mozzi Team
7  *
8  * Mozzi is licensed under the GNU Lesser General Public Licence (LGPL) Version 2.1 or later.
9  *
10 */
11 
12 #ifndef CONFIG_CHECK_SAMD21_H
13 #define CONFIG_CHECK_SAMD21_H
14 
45 #if not IS_SAMD21()
46 #error This header should be included for SAMD21 architecture (Arduino Circuitplayground M0 and others), only
47 #endif
48 
49 #include "disable_2pinmode_on_github_workflow.h"
50 #if !defined(MOZZI_AUDIO_MODE)
51 #define MOZZI_AUDIO_MODE MOZZI_OUTPUT_INTERNAL_DAC
52 #endif
53 MOZZI_CHECK_SUPPORTED(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_EXTERNAL_TIMED, MOZZI_OUTPUT_EXTERNAL_CUSTOM, MOZZI_OUTPUT_INTERNAL_DAC)
54 
55 #if !defined(MOZZI_AUDIO_RATE)
56 #define MOZZI_AUDIO_RATE 32768
57 #endif
58 
59 #if defined(MOZZI_PWM_RATE)
60 #error Configuration of MOZZI_PWM_RATE is not currently supported on this platform (always same as MOZZI_AUDIO_RATE)
61 #endif
62 
63 #if !defined(MOZZI_ANALOG_READ)
64 # define MOZZI_ANALOG_READ MOZZI_ANALOG_READ_NONE
65 #endif
66 
67 MOZZI_CHECK_SUPPORTED(MOZZI_ANALOG_READ, MOZZI_ANALOG_READ_NONE)
68 
69 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_INTERNAL_DAC)
70 # if !defined(MOZZI_AUDIO_BITS)
71 # define MOZZI_AUDIO_BITS 10
72 # endif
73 # if !defined(MOZZI_AUDIO_PIN_1)
74 # define MOZZI_AUDIO_PIN_1 DAC0
75 # endif
76 # include "disable_stereo_on_github_workflow.h"
77 MOZZI_CHECK_SUPPORTED(MOZZI_AUDIO_CHANNELS, 1)
78 #endif
79 
80 #define MOZZI__INTERNAL_ANALOG_READ_RESOLUTION 12
81 
82 #endif // #ifndef CONFIG_CHECK_SAMD21_H
#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.
#define MOZZI_ANALOG_READ
Whether to compile in support for non-blocking analog reads.