arduino-audio-tools
Loading...
Searching...
No Matches
tangnano20k.h
Go to the documentation of this file.
1#pragma once
2
3// Sipeed Tang Nano 20K (RISC-V softcore, zephyr-sdk toolchain):
4// int32_t is defined as long, so we need a dedicated int constructor
5#define USE_INT24_FROM_INT
6
7// I2S: onboard MAX98357A; pins are defined by the gateware
8#define USE_I2S
9// ring buffer of 512 stereo 16 bit frames: this fits into the fast SRAM
10#undef I2S_BUFFER_SIZE
11#define I2S_BUFFER_SIZE 512
12#undef I2S_BUFFER_COUNT
13#define I2S_BUFFER_COUNT 4
14
15#define USE_TIMER
16
17// PWM: with Tools > PWM Audio: Enabled we use the PWMAudio hardware on
18// GPIO16/GPIO17, otherwise analogWrite() on up to 6 pins starting at GPIO0
19#define USE_PWM
20#define PIN_PWM_START 14
21#define PIN_PWM_COUNT 6
22#undef PWM_AUDIO_FREQUENCY
23#define PWM_AUDIO_FREQUENCY 50000
24
25// There is not FPU
26#define PREFER_FIXEDPOINT true
27
28// SD: the core bundles the standard Arduino SD library (no fs namespace);
29// the onboard microSD card uses SS as chip select (Tools > SD Card: Enabled)
30#define USE_SD_NO_NS
31#define PIN_CS SS