-
Notifications
You must be signed in to change notification settings - Fork 88
/
userConfig.h
129 lines (101 loc) · 3.62 KB
/
userConfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
* @file userConfig.h
*
* macros for customization of RF24Audio
*/
/************ MANDATORY User Variables ************/
/**
* @brief The sample rate to use for transferring audio samples
*
* Maximum Range: Sample rate 16000, RF_SPEED RF24_250KBPS <br>
* Maximum Quality: Sample rate 44000, RF_SPEED RF24_2MBPS
* @note 44khz+ sample rate requires 8-bits per sample
*/
#define SAMPLE_RATE 24000
/**
* @brief configure the RF data rate
*
* These are not limits, just a guide:
* - RF24_250KBPS will do 13-20khz+ sample rate
* - RF24_1MBPS up to 24-44khz+
* - RF24_2MBPS for higher.
*/
#define RF_SPEED RF24_1MBPS
/** @brief The pin that analog readings will be taken from (microphone pin) */
#define ANALOG_PIN A0
/************ OverRides ************/
//10-bit audio requires more bandwidth. A 20khz sample rate will need 25KB/S transfer rate, which is about max for 250kbps data rate.
//With a 32khz sample rate, the volume can be set to -1 to shift the sample down to 9-bit, which is the highest the timers can handle at 32khz
//#define tenBit // Enable 10-bit samples Note: 44khz+ sample rate requires 8-bits per sample
//#define speakerPin 9 // If using a non-standard board, override the timer1 pins
//#define speakerPin 10
/**
* @brief Indicator pin
*
* Using pin 6 on Uno enables audio visualization. Pin 13 on Mega 2560 (TIMER0 COMPA)
* @note The pin number cannot be changed.
*/
#define ENABLE_LED
/************ Optional/Advanced User Variables ************/
/** Button pin to trigger recording & transmission */
#define TX_PIN A1
/** Pin for external volume control */
#define VOL_UP_PIN A2
/** Pin for external volume control */
#define VOL_DN_PIN A3
/** Pin for externally triggering remote recording */
#define REMOTE_TX_PIN A4
/** Pin for externally stopping remote recording (needs timeout enabled) */
#define REMOTE_RX_PIN 4
/** The size of the memory buffer to use. Not really configurable (set to maximum by default). */
#define buffSize 32
//#define speakerTX // Whether to output to speaker while transmitting
//#define oversampling // Oversampling is recommended for low sample rates only. This only affects playback.
//#define RX_ONLY
//#define TX_ONLY // Not functional yet
/************ Automated pin selections, override by defining above ************/
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || (__AVR_ATmega32U4__) || (__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) || (__AVR_ATmega128__) ||defined(__AVR_ATmega1281__)||defined(__AVR_ATmega2561__)
#define rampMega
// Speaker pin selection for mega etc
#if !defined (speakerPin)
#define speakerPin 11 // The pins to output audio on. (11,12 on Mega 2560)
#endif
#if !defined (speakerPin2)
#define speakerPin2 12
#endif
#if defined (ENABLE_LED)
#define ledPin 13
#endif
#else
//Speaker selection for Uno,Nano, etc
#if !defined (speakerPin)
/** The pin used to output audio on UNO */
#define speakerPin 9
#endif
#if !defined (speakerPin2)
/** The pin used to output audio on Nano */
#define speakerPin2 10
#endif
#if defined (ENABLE_LED)
#define ledPin 6
#endif
#endif
//********Radio Defines ****************************
/** Radio pipe addresses for the 2 nodes to communicate. */
const uint64_t pipes[14] =
{
0xABCDABCD71LL,
0x544d52687CLL,
0x544d526832LL,
0x544d52683CLL,
0x544d526846LL,
0x544d526850LL,
0x544d52685ALL,
0x544d526820LL,
0x544d52686ELL,
0x544d52684BLL,
0x544d526841LL,
0x544d526855LL,
0x544d52685FLL,
0x544d526869LL
};