Mercurial > hg > beaglert
comparison include/BeagleRT.h @ 171:e63563507edd
Added command-line options for the PGA
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 28 Dec 2015 03:53:36 +0100 |
parents | 3c3a1357657d |
children | 2877bc2cd449 |
comparison
equal
deleted
inserted
replaced
170:e80340fe527a | 171:e63563507edd |
---|---|
70 | 70 |
71 /** | 71 /** |
72 * Default level of the audio ADC in decibels. See BeagleRT_setADCLevel(). | 72 * Default level of the audio ADC in decibels. See BeagleRT_setADCLevel(). |
73 */ | 73 */ |
74 #define DEFAULT_ADC_LEVEL -6.0 | 74 #define DEFAULT_ADC_LEVEL -6.0 |
75 | |
76 | |
77 /** | |
78 * Default level of the Programmable Gain Amplifier in decibels. | |
79 */ | |
80 #define DEFAULT_PGA_GAIN 16 | |
75 | 81 |
76 /** | 82 /** |
77 * Default level of the headphone output in decibels. See BeagleRT_setHeadphoneLevel(). | 83 * Default level of the headphone output in decibels. See BeagleRT_setHeadphoneLevel(). |
78 */ | 84 */ |
79 #define DEFAULT_HP_LEVEL -6.0 | 85 #define DEFAULT_HP_LEVEL -6.0 |
118 int beginMuted; | 124 int beginMuted; |
119 /// Level for the audio DAC output | 125 /// Level for the audio DAC output |
120 float dacLevel; | 126 float dacLevel; |
121 /// Level for the audio ADC input | 127 /// Level for the audio ADC input |
122 float adcLevel; | 128 float adcLevel; |
129 /// Gains for the PGA, left and right channels | |
130 float pgaGain[2]; | |
123 /// Level for the headphone output | 131 /// Level for the headphone output |
124 float headphoneLevel; | 132 float headphoneLevel; |
125 | 133 |
126 /// The external .bin file to load. If empty will use PRU code from pru_rtaudio_bin.h | 134 /// The external .bin file to load. If empty will use PRU code from pru_rtaudio_bin.h |
127 char pruFilename[MAX_PRU_FILENAME_LENGTH]; | 135 char pruFilename[MAX_PRU_FILENAME_LENGTH]; |
482 * | 490 * |
483 * \return 0 on success, or nonzero if an error occurred. | 491 * \return 0 on success, or nonzero if an error occurred. |
484 */ | 492 */ |
485 int BeagleRT_setADCLevel(float decibels); | 493 int BeagleRT_setADCLevel(float decibels); |
486 | 494 |
495 | |
496 /** | |
497 * \brief Set the gain of the audio preamplifier. | |
498 * | |
499 * This function sets the level of the Programmable Gain Amplifier(PGA), which | |
500 * amplifies the signal before the ADC. | |
501 * | |
502 * \b Important: do not call this function from within render(), as it does not make | |
503 * any guarantees on real-time performance. | |
504 * | |
505 * \param decibels Level of the PGA Valid levels range from 0 (lowest) to | |
506 * 59.5 (highest) in steps of 0.5dB. Levels between increments of 0.5 will be rounded. | |
507 * \param channel Specifies which channel to apply the gain to. Channel 0 is left, | |
508 * channel 1 is right | |
509 * | |
510 * \return 0 on success, or nonzero if an error occurred. | |
511 */ | |
512 int BeagleRT_setPgaGain(float decibels, int channel); | |
513 | |
487 /** | 514 /** |
488 * \brief Set the level of the onboard headphone amplifier. | 515 * \brief Set the level of the onboard headphone amplifier. |
489 * | 516 * |
490 * This function sets the level of the headphone output only (3-pin connector on the BeagleRT | 517 * This function sets the level of the headphone output only (3-pin connector on the BeagleRT |
491 * cape or the output jack on the BeagleBone Audio Cape). It does not affect the level of the | 518 * cape or the output jack on the BeagleBone Audio Cape). It does not affect the level of the |