Skip to content

Commit

Permalink
SAMD21 has only 10 bits DAC.
Browse files Browse the repository at this point in the history
  • Loading branch information
tfry-git committed Jan 6, 2021
1 parent 1680579 commit f49e8d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions AudioConfigSAMD21.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#ifndef AUDIOCONFIGSAMD21_H
#define AUDIOCONFIGSAMD21_H

/* Note: SAMD21 has 12 bits ADC, but only 10 bits DAC. See https://github.com/sensorium/Mozzi/issues/75 */
#define AUDIO_BITS 10

/** @ingroup core
*/
/* Used internally to put the 0-biased generated audio into the centre of the output range (12 bits) */
#define AUDIO_BIAS ((uint16_t) 2048)
/* Used internally to put the 0-biased generated audio into the centre of the output range (10 bits) */
#define AUDIO_BIAS ((uint16_t) 1 << (AUDIO_BITS - 1))


#define AUDIO_CHANNEL_1_PIN DAC0
Expand Down

0 comments on commit f49e8d0

Please sign in to comment.